@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/cliOr run without installing:
npx @bike4mind/cliFrom Source (Development)
From the project root:
pnpm installUsage
Start Interactive Session
b4mThe 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:
- Run
b4mor use the/logincommand - Visit the verification URL shown in the terminal
- Enter the user code to authorize the CLI
- 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.comTo return to the main Bike4Mind service:
/reset-apiCheck your current API configuration:
/api-infoTool 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- RequirestoolApiKeys.openweather - 🔑
web_search- RequirestoolApiKeys.serper - 🔑
deep_research- RequirestoolApiKeys.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 typecheckArchitecture
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 # ExecutableDependencies
@bike4mind/agents- ReAct agent implementation@bike4mind/services- B4M tools@bike4mind/mcp- MCP integration@bike4mind/utils- LLM backendsink- React for CLIscommander- CLI argument parsinglowdb- 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
