@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 +69 -67
- package/dist/{artifactExtractor-QN34RFDM.js → artifactExtractor-JZD2HZ6K.js} +1 -1
- package/dist/{chunk-XANFVWI6.js → chunk-43ZKBRTE.js} +2 -2
- package/dist/{chunk-B3YFSFVU.js → chunk-EVPT4ARN.js} +262 -204
- package/dist/{chunk-TPSQ5MIR.js → chunk-FNZZAMET.js} +2 -2
- package/dist/{chunk-MKO2KCCS.js → chunk-VVV7WLJ6.js} +1 -0
- package/dist/{chunk-KZGZGNHL.js → chunk-ZT7Z4QVD.js} +2 -2
- package/dist/{create-DGRMWHIN.js → create-42PUCFSO.js} +3 -3
- package/dist/index.js +142 -161
- package/dist/{llmMarkdownGenerator-JBDLN44A.js → llmMarkdownGenerator-KV37M3II.js} +1 -1
- package/dist/{markdownGenerator-MM5N3H5I.js → markdownGenerator-XVTS6PUQ.js} +1 -1
- package/dist/{mementoService-23ROW7I4.js → mementoService-ZGZR3QN6.js} +3 -3
- package/dist/{src-OVEHYUVN.js → src-2BQJS6GJ.js} +1 -1
- package/dist/{src-K5MFQICX.js → src-DPL74BDD.js} +2 -2
- package/dist/{subtractCredits-YAWCGKMX.js → subtractCredits-3GIBRYWF.js} +3 -3
- package/package.json +2 -1
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
|
-
|
|
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
|
-
|
|
47
|
+
## Commands
|
|
66
48
|
|
|
67
|
-
|
|
68
|
-
# Use specific model
|
|
69
|
-
b4m --model claude-3-5-haiku-20241022
|
|
49
|
+
While in interactive mode:
|
|
70
50
|
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
56
|
+
**Session Management:**
|
|
57
|
+
- `/save <name>` - Save current session
|
|
58
|
+
- `/sessions` - List saved sessions
|
|
77
59
|
|
|
78
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
79
|
+
### Authentication
|
|
95
80
|
|
|
96
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
###
|
|
114
|
+
### Tool API Keys
|
|
115
115
|
|
|
116
|
-
Some tools require
|
|
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
|
|
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
|
|
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
|
|
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
|
```
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
getSettingsByNames,
|
|
7
7
|
obfuscateApiKey,
|
|
8
8
|
secureParameters
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EVPT4ARN.js";
|
|
10
10
|
import {
|
|
11
11
|
ApiKeyType,
|
|
12
12
|
MementoTier,
|
|
13
13
|
isSupportedEmbeddingModel
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VVV7WLJ6.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
|
|
17
17
|
import { z } from "zod";
|