npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@bike4mind/cli

v0.1.4

Published

Interactive CLI tool for Bike4Mind with ReAct agents

Downloads

464

Readme

Bike4Mind CLI

Interactive command-line interface for Bike4Mind with ReAct agents.

Features

  • 🤖 ReAct agent with reasoning and tool use
  • 💬 Interactive chat interface
  • 💾 Session persistence
  • 🛠️ B4M tools + MCP integration
  • 🎨 Rich terminal UI with Ink

Installation

From NPM (Recommended)

Install globally:

npm install -g @bike4mind/cli

Or run without installing:

npx @bike4mind/cli

From Source (Development)

From the project root:

pnpm install

Usage

Start Interactive Session

b4m

The CLI will prompt you to authenticate with your Bike4Mind account on first run.

Commands

While in interactive mode:

Authentication:

  • /login - Authenticate with your B4M account
  • /logout - Clear authentication and sign out
  • /whoami - Show current authenticated user

Session Management:

  • /save <name> - Save current session
  • /sessions - List saved sessions

API Configuration:

  • /set-api <url> - Connect to self-hosted Bike4Mind instance
  • /reset-api - Reset to Bike4Mind main service
  • /api-info - Show current API configuration

Tool Permissions:

  • /trust <tool-name> - Trust a tool (won't ask permission again)
  • /untrust <tool-name> - Remove tool from trusted list
  • /trusted - List all trusted tools

General:

  • /help - Show help
  • /exit - Exit CLI
  • /config - Show configuration

Configuration

Configuration is stored in ~/.bike4mind/config.json

Authentication

The CLI uses OAuth to authenticate with your Bike4Mind account. On first run, you'll be prompted to log in through the device authorization flow:

  1. Run b4m or use the /login command
  2. Visit the verification URL shown in the terminal
  3. Enter the user code to authorize the CLI
  4. The CLI will automatically receive access tokens

Authentication tokens are securely stored in your config file with restricted permissions (0600).

API Configuration

By default, the CLI connects to the main Bike4Mind service at https://app.bike4mind.com.

For Self-Hosted Instances:

If your organization runs a self-hosted Bike4Mind instance, connect to it using:

/set-api https://your-company.bike4mind.com

To return to the main Bike4Mind service:

/reset-api

Check your current API configuration:

/api-info

Tool API Keys

Some built-in tools require API keys to function. Add them to ~/.bike4mind/config.json:

{
  "toolApiKeys": {
    "openweather": "your-openweather-key",
    "serper": "your-serper-key"
  }
}

Or use environment variables (config takes precedence):

export OPENWEATHER_API_KEY="your-key-here"
export SERPER_API_KEY="your-key-here"

Available Tools:

  • dice_roll - No API key needed
  • math_evaluate - No API key needed
  • current_datetime - No API key needed
  • prompt_enhancement - No API key needed
  • 🔑 weather_info - Requires toolApiKeys.openweather
  • 🔑 web_search - Requires toolApiKeys.serper
  • 🔑 deep_research - Requires toolApiKeys.serper

Get API Keys:

  • OpenWeather API: https://openweathermap.org/api
  • Serper API: https://serper.dev/

Optional: MCP Servers

MCP (Model Context Protocol) servers provide additional tools and capabilities. Configure them in ~/.bike4mind/config.json:

{
  "mcpServers": [
    {
      "name": "github",
      "command": "node",
      "args": ["path/to/mcp/server.js"],
      "env": {
        "GITHUB_ACCESS_TOKEN": "ghp_..."
      },
      "enabled": true
    }
  ]
}

Available MCP Servers:

  • 🔧 GitHub - Repository management, issues, PRs (requires GITHUB_ACCESS_TOKEN)
  • 🔧 LinkedIn - Post management, analytics (requires LINKEDIN_ACCESS_TOKEN, COMPANY_NAME)
  • 🔧 Atlassian - Jira/Confluence integration (requires ATLASSIAN_ACCESS_TOKEN, ATLASSIAN_CLOUD_ID, ATLASSIAN_SITE_URL)

Note: MCP servers must be built and available in the b4m-core/packages/mcp/dist/src/ directory. The CLI will automatically find them if you're running from the monorepo.

Session Storage

Sessions are saved to ~/.bike4mind/sessions/

Each session includes:

  • Full conversation history
  • Token usage tracking
  • Agent reasoning steps
  • Metadata

Development

# Run in development mode
cd apps/cli
pnpm dev

# Build for production
pnpm build

# Type check
pnpm typecheck

Architecture

apps/cli/
├── src/
│   ├── components/       # Ink React components
│   │   ├── App.tsx
│   │   ├── StatusBar.tsx
│   │   ├── MessageList.tsx
│   │   ├── InputPrompt.tsx
│   │   └── ThoughtStream.tsx
│   ├── storage/          # Local persistence
│   │   ├── SessionStore.ts
│   │   └── ConfigStore.ts
│   └── index.tsx         # Main entry point
└── bin/
    └── bike4mind-cli.js  # Executable

Dependencies

  • @bike4mind/agents - ReAct agent implementation
  • @bike4mind/services - B4M tools
  • @bike4mind/mcp - MCP integration
  • @bike4mind/utils - LLM backends
  • ink - React for CLIs
  • commander - CLI argument parsing
  • lowdb - Local storage

Development Status

Current implementation includes:

✅ Basic CLI structure ✅ ReAct agent integration ✅ Session persistence ✅ Configuration management ✅ Interactive UI with Ink ✅ B4M tools integration ✅ MCP tools support

Coming soon:

⏳ Advanced UI features (streaming visualization, syntax highlighting) ⏳ Export functionality (sessions to markdown/JSON) ⏳ Session search and management ⏳ Tool execution monitoring

License

Private - Bike4Mind