@agentbrain/cli 1.1.1 → 1.2.0
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 +45 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -163,9 +163,13 @@ agentbrain config --show
|
|
|
163
163
|
|
|
164
164
|
Configuration stored at `~/.agentbrain/config.json` with secure permissions.
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## API Key Configuration
|
|
169
|
+
|
|
170
|
+
AgentBrain supports multiple ways to provide your API key. They are checked in this priority order:
|
|
167
171
|
|
|
168
|
-
|
|
172
|
+
### 1. Environment Variables (Highest Priority)
|
|
169
173
|
|
|
170
174
|
```bash
|
|
171
175
|
# Anthropic
|
|
@@ -175,7 +179,45 @@ export ANTHROPIC_API_KEY="sk-ant-..."
|
|
|
175
179
|
export OPENAI_API_KEY="sk-..."
|
|
176
180
|
```
|
|
177
181
|
|
|
178
|
-
|
|
182
|
+
### 2. `.env` Files
|
|
183
|
+
|
|
184
|
+
Create a `.env` or `.env.local` file in your project:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# In your project directory
|
|
188
|
+
cat > .env <<EOF
|
|
189
|
+
OPENAI_API_KEY=sk-...
|
|
190
|
+
EOF
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
AgentBrain will automatically load API keys from:
|
|
194
|
+
- `.env.local` in current directory
|
|
195
|
+
- `.env` in current directory
|
|
196
|
+
- `.env.local` in git repository root
|
|
197
|
+
- `.env` in git repository root
|
|
198
|
+
|
|
199
|
+
**Note:** `.env` files are loaded automatically - no need to export or source them!
|
|
200
|
+
|
|
201
|
+
### 3. Stored Configuration (Lowest Priority)
|
|
202
|
+
|
|
203
|
+
Use the `agentbrain config` command to store your key persistently:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
agentbrain config
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
This stores the key securely at `~/.agentbrain/config.json` with 0600 permissions.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Summary: API Key Priority
|
|
214
|
+
|
|
215
|
+
1. ✅ Environment variables (`ANTHROPIC_API_KEY` or `OPENAI_API_KEY`)
|
|
216
|
+
2. ✅ `.env.local` in current directory
|
|
217
|
+
3. ✅ `.env` in current directory
|
|
218
|
+
4. ✅ `.env.local` in git root
|
|
219
|
+
5. ✅ `.env` in git root
|
|
220
|
+
6. ✅ `~/.agentbrain/config.json`
|
|
179
221
|
|
|
180
222
|
## Usage with AI Agents
|
|
181
223
|
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ const program = new Command();
|
|
|
9
9
|
program
|
|
10
10
|
.name('agentbrain')
|
|
11
11
|
.description('Generate smart context docs for coding agents')
|
|
12
|
-
.version('1.
|
|
12
|
+
.version('1.2.0');
|
|
13
13
|
// Add commands
|
|
14
14
|
program.addCommand(createInitCommand());
|
|
15
15
|
program.addCommand(createStandardsCommand());
|