@bike4mind/cli 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -34,20 +34,6 @@ From the project root:
34
34
  pnpm install
35
35
  ```
36
36
 
37
- ## Development
38
-
39
- ```bash
40
- # Run in development mode
41
- cd apps/cli
42
- pnpm dev
43
-
44
- # Build for production
45
- pnpm build
46
-
47
- # Type check
48
- pnpm typecheck
49
- ```
50
-
51
37
  ## Usage
52
38
 
53
39
  ### Start Interactive Session
@@ -56,79 +42,84 @@ pnpm typecheck
56
42
  b4m
57
43
  ```
58
44
 
59
- ### Quick Query
60
-
61
- ```bash
62
- b4m "What's the weather in San Francisco?"
63
- ```
45
+ The CLI will prompt you to authenticate with your Bike4Mind account on first run.
64
46
 
65
- ### With Options
47
+ ## Commands
66
48
 
67
- ```bash
68
- # Use specific model
69
- b4m --model claude-3-5-haiku-20241022
49
+ While in interactive mode:
70
50
 
71
- # Load saved session
72
- b4m --session my-project
51
+ **Authentication:**
52
+ - `/login` - Authenticate with your B4M account
53
+ - `/logout` - Clear authentication and sign out
54
+ - `/whoami` - Show current authenticated user
73
55
 
74
- # Debug mode
75
- b4m --debug
76
- ```
56
+ **Session Management:**
57
+ - `/save <name>` - Save current session
58
+ - `/sessions` - List saved sessions
77
59
 
78
- ## Commands
60
+ **API Configuration:**
61
+ - `/set-api <url>` - Connect to self-hosted Bike4Mind instance
62
+ - `/reset-api` - Reset to Bike4Mind main service
63
+ - `/api-info` - Show current API configuration
79
64
 
80
- While in interactive mode:
65
+ **Tool Permissions:**
66
+ - `/trust <tool-name>` - Trust a tool (won't ask permission again)
67
+ - `/untrust <tool-name>` - Remove tool from trusted list
68
+ - `/trusted` - List all trusted tools
81
69
 
70
+ **General:**
82
71
  - `/help` - Show help
83
72
  - `/exit` - Exit CLI
84
- - `/save <name>` - Save current session
85
- - `/sessions` - List saved sessions
86
73
  - `/config` - Show configuration
87
- - `/models` - List available models
88
- - `/tools` - List available tools
89
74
 
90
75
  ## Configuration
91
76
 
92
77
  Configuration is stored in `~/.bike4mind/config.json`
93
78
 
94
- ### Required: LLM API Keys
79
+ ### Authentication
95
80
 
96
- Set at least one LLM API key in `~/.bike4mind/config.json`:
81
+ 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:
97
82
 
98
- ```json
99
- {
100
- "apiKeys": {
101
- "anthropic": "sk-ant-...",
102
- "openai": "sk-..."
103
- },
104
- "defaultModel": "claude-3-5-sonnet-20241022",
105
- "preferences": {
106
- "maxTokens": 4096,
107
- "temperature": 0.7,
108
- "autoSave": true
109
- },
110
- "mcpServers": []
111
- }
83
+ 1. Run `b4m` or use the `/login` command
84
+ 2. Visit the verification URL shown in the terminal
85
+ 3. Enter the user code to authorize the CLI
86
+ 4. The CLI will automatically receive access tokens
87
+
88
+ Authentication tokens are securely stored in your config file with restricted permissions (0600).
89
+
90
+ ### API Configuration
91
+
92
+ By default, the CLI connects to the main Bike4Mind service at `https://app.bike4mind.com`.
93
+
94
+ **For Self-Hosted Instances:**
95
+
96
+ If your organization runs a self-hosted Bike4Mind instance, connect to it using:
97
+
98
+ ```bash
99
+ /set-api https://your-company.bike4mind.com
100
+ ```
101
+
102
+ To return to the main Bike4Mind service:
103
+
104
+ ```bash
105
+ /reset-api
106
+ ```
107
+
108
+ Check your current API configuration:
109
+
110
+ ```bash
111
+ /api-info
112
112
  ```
113
113
 
114
- ### Optional: Tool API Keys
114
+ ### Tool API Keys
115
115
 
116
- Some tools require additional API keys. Add them to your config file:
116
+ Some built-in tools require API keys to function. Add them to `~/.bike4mind/config.json`:
117
117
 
118
118
  ```json
119
119
  {
120
- "apiKeys": {
121
- "anthropic": "sk-ant-..."
122
- },
123
120
  "toolApiKeys": {
124
121
  "openweather": "your-openweather-key",
125
122
  "serper": "your-serper-key"
126
- },
127
- "defaultModel": "claude-3-5-sonnet-20241022",
128
- "preferences": {
129
- "maxTokens": 4096,
130
- "temperature": 0.7,
131
- "autoSave": true
132
123
  }
133
124
  }
134
125
  ```
@@ -140,7 +131,7 @@ export OPENWEATHER_API_KEY="your-key-here"
140
131
  export SERPER_API_KEY="your-key-here"
141
132
  ```
142
133
 
143
- **Available tools**:
134
+ **Available Tools:**
144
135
  - ✅ `dice_roll` - No API key needed
145
136
  - ✅ `math_evaluate` - No API key needed
146
137
  - ✅ `current_datetime` - No API key needed
@@ -149,19 +140,16 @@ export SERPER_API_KEY="your-key-here"
149
140
  - 🔑 `web_search` - Requires `toolApiKeys.serper`
150
141
  - 🔑 `deep_research` - Requires `toolApiKeys.serper`
151
142
 
152
- **Get API keys**:
143
+ **Get API Keys:**
153
144
  - OpenWeather API: https://openweathermap.org/api
154
145
  - Serper API: https://serper.dev/
155
146
 
156
147
  ### Optional: MCP Servers
157
148
 
158
- MCP (Model Context Protocol) servers provide additional tools and capabilities. Configure them in your config file:
149
+ MCP (Model Context Protocol) servers provide additional tools and capabilities. Configure them in `~/.bike4mind/config.json`:
159
150
 
160
151
  ```json
161
152
  {
162
- "apiKeys": {
163
- "anthropic": "sk-ant-..."
164
- },
165
153
  "mcpServers": [
166
154
  {
167
155
  "name": "github",
@@ -193,6 +181,20 @@ Each session includes:
193
181
  - Agent reasoning steps
194
182
  - Metadata
195
183
 
184
+ ## Development
185
+
186
+ ```bash
187
+ # Run in development mode
188
+ cd apps/cli
189
+ pnpm dev
190
+
191
+ # Build for production
192
+ pnpm build
193
+
194
+ # Type check
195
+ pnpm typecheck
196
+ ```
197
+
196
198
  ## Architecture
197
199
 
198
200
  ```
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-MKO2KCCS.js";
4
+ } from "./chunk-VVV7WLJ6.js";
5
5
  import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/artifactExtractor.js
@@ -6,12 +6,12 @@ import {
6
6
  getSettingsByNames,
7
7
  obfuscateApiKey,
8
8
  secureParameters
9
- } from "./chunk-B3YFSFVU.js";
9
+ } from "./chunk-EVPT4ARN.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
13
13
  isSupportedEmbeddingModel
14
- } from "./chunk-MKO2KCCS.js";
14
+ } from "./chunk-VVV7WLJ6.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
17
17
  import { z } from "zod";