Skip to content

Commit b10a680

Browse files
avivsinaiclaude
andcommitted
docs: remove deprecated config command references
- Remove all references to `promptcode config` command - Update documentation to reflect API keys are only set via environment variables - Simplify configuration instructions across all docs - Update error messages to only mention environment variables - Remove `--set-<provider>-key` flags from examples This change improves security by ensuring API keys are only handled through environment variables, never stored in config files. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 30b2a28 commit b10a680

File tree

10 files changed

+32
-39
lines changed

10 files changed

+32
-39
lines changed

.claude/CLAUDE.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,19 @@ promptcode expert "Review this code for security issues" src/api/**/*.ts
6666

6767
## Configuration
6868

69-
API keys can be set via environment variables or config:
69+
API keys must be set via environment variables:
7070
```bash
7171
export OPENAI_API_KEY=sk-...
7272
export ANTHROPIC_API_KEY=sk-ant-...
73-
export GEMINI_API_KEY=...
74-
export GROK_API_KEY=xai-...
75-
76-
# Or use config command
77-
promptcode config --set-openai-key sk-...
73+
export GOOGLE_API_KEY=... # or GEMINI_API_KEY
74+
export XAI_API_KEY=... # or GROK_API_KEY
7875
```
7976

8077
<details>
8178
<summary>⚠️ Troubleshooting</summary>
8279

8380
**Command not found** – The CLI auto-installs to `~/.local/bin`. Ensure it's in PATH
84-
**Missing API key** – Set via environment variable or `promptcode config`
81+
**Missing API key** – Set via environment variable as shown above
8582
**Context too large** – Use more specific file patterns or create focused presets
8683
**Preset not found** – Check `.promptcode/presets/` directory exists
8784
</details>

.claude/commands/expert-consultation.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@ Instructions:
5555

5656
5. Parse the response:
5757
- If successful: Summarize key insights
58-
- If API key missing: Tell user to run:
58+
- If API key missing: Tell user to set environment variable:
5959
```bash
60-
promptcode config --set-openai-key sk-...
61-
# Or set OPENAI_API_KEY environment variable
60+
export OPENAI_API_KEY=sk-...
61+
# Or for other providers:
62+
export ANTHROPIC_API_KEY=sk-ant-...
63+
export GOOGLE_API_KEY=...
64+
export XAI_API_KEY=...
6265
```
6366
- For other errors: Report exact error message
6467

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export OPENAI_API_KEY=sk-...
292292
<summary>⚠️ Troubleshooting</summary>
293293

294294
**Command not found** – The CLI auto-installs to `~/.local/bin`. Ensure it's in PATH
295-
**Missing API key** – Set via environment variable or `promptcode config`
295+
**Missing API key** – Set via environment variable as shown above
296296
**Context too large** – Use more specific file patterns or create focused presets
297297
**Preset not found** – Check `.promptcode/presets/` directory exists
298298
</details>

INSTALLATION.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,12 @@ promptcode preset --edit my-project
7272

7373
### 2. Set Up AI Expert (Optional)
7474
```bash
75-
# Configure OpenAI API key for expert consultation
76-
promptcode config --set-openai-key sk-your-api-key
75+
# Set environment variable for API key
76+
export OPENAI_API_KEY=sk-your-api-key
77+
# Or for other providers:
78+
export ANTHROPIC_API_KEY=sk-ant-...
79+
export GOOGLE_API_KEY=...
80+
export XAI_API_KEY=...
7781
```
7882

7983
### 3. Verify Installation

packages/cli/README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,7 @@ Custom templates go in `~/.config/promptcode/prompts/`.
151151

152152
## Configuration
153153

154-
Configuration is stored in `~/.config/promptcode/config.json`:
155-
156-
```bash
157-
promptcode config --show # View config
158-
export OPENAI_API_KEY=KEY # Set API key (use env vars)
159-
promptcode config --reset # Reset all
160-
```
161-
162-
Environment variables (first match wins):
154+
API keys must be set via environment variables (first match wins):
163155
- **OpenAI**: `OPENAI_API_KEY`, `OPENAI_KEY`
164156
- **Anthropic**: `ANTHROPIC_API_KEY`, `CLAUDE_API_KEY`
165157
- **Google**: `GOOGLE_API_KEY`, `GOOGLE_CLOUD_API_KEY`, `GOOGLE_AI_API_KEY`, `GEMINI_API_KEY`
@@ -217,4 +209,4 @@ promptcode diff suggestions.md --apply
217209

218210
- **Command not found**: Ensure `~/.local/bin` is in your PATH
219211
- **Token counts wrong**: Clear cache with `promptcode cache clear`
220-
- **API errors**: Check your API keys with `promptcode config --show`
212+
- **API errors**: Check your API keys are set in environment variables

packages/cli/src/claude-templates/CLAUDE.md.template

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,19 @@ To use it in Claude, simply ask: "Consult an expert about [your question]"
119119

120120
## Configuration
121121

122-
API keys can be set via environment variables or config:
122+
API keys must be set via environment variables:
123123
```bash
124124
export OPENAI_API_KEY=sk-...
125125
export ANTHROPIC_API_KEY=sk-ant-...
126-
export GEMINI_API_KEY=...
127-
export GROK_API_KEY=xai-...
128-
129-
# Set via environment variables
130-
export OPENAI_API_KEY=sk-...
126+
export GOOGLE_API_KEY=... # or GEMINI_API_KEY
127+
export XAI_API_KEY=... # or GROK_API_KEY
131128
```
132129

133130
<details>
134131
<summary>⚠️ Troubleshooting</summary>
135132

136133
• **Command not found** – The CLI auto-installs to `~/.local/bin`. Ensure it's in PATH
137-
• **Missing API key** – Set via environment variable or `promptcode config`
134+
• **Missing API key** – Set via environment variable as shown above
138135
• **Context too large** – Use more specific file patterns or create focused presets
139136
• **Preset not found** – Check `.promptcode/presets/` directory exists
140137
</details>

packages/cli/src/claude-templates/expert-consultation.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@ Instructions:
5555

5656
5. Parse the response:
5757
- If successful: Summarize key insights
58-
- If API key missing: Tell user to run:
58+
- If API key missing: Tell user to set environment variable:
5959
```bash
60-
promptcode config --set-openai-key sk-...
61-
# Or set OPENAI_API_KEY environment variable
60+
export OPENAI_API_KEY=sk-...
61+
# Or for other providers:
62+
export ANTHROPIC_API_KEY=sk-ant-...
63+
export GOOGLE_API_KEY=...
64+
export XAI_API_KEY=...
6265
```
6366
- For other errors: Report exact error message
6467

packages/cli/src/commands/expert.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ export async function expertCommand(question: string | undefined, options: Exper
394394
console.log(' export ANTHROPIC_API_KEY="sk-ant-..." # or CLAUDE_API_KEY');
395395
console.log(' export GOOGLE_API_KEY="..." # or GOOGLE_CLOUD_API_KEY, GEMINI_API_KEY');
396396
console.log(' export XAI_API_KEY="..." # or GROK_API_KEY');
397-
console.log('\n2. Or run: promptcode config --set-<provider>-key <key>');
398397
}
399398

400399
process.exit(1);

packages/cli/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Common Workflows:
117117
$ promptcode "Review this code" file1.py file2.js # Specific files
118118
119119
2. Expert consultation:
120-
$ promptcode config --set-openai-key sk-...
120+
$ export OPENAI_API_KEY=sk-...
121121
$ promptcode expert "Explain the auth flow" --preset auth
122122
123123
3. Apply AI changes:

packages/cli/src/providers/ai-provider.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ export class AIProvider {
167167
if (!keys.openai) {
168168
throw new Error(
169169
`API key not configured for openai. ` +
170-
`Set via "promptcode config --set-openai-key <key>" ` +
171-
`or export OPENAI_API_KEY=...`
170+
`Set via environment variable: export OPENAI_API_KEY=...`
172171
);
173172
}
174173
// Use responses API for web search support
@@ -181,8 +180,7 @@ export class AIProvider {
181180
const envName = config.provider.toUpperCase() + '_API_KEY';
182181
throw new Error(
183182
`API key not configured for ${config.provider}. ` +
184-
`Set via "promptcode config --set-${config.provider}-key <key>" ` +
185-
`or export ${envName}=...`
183+
`Set via environment variable: export ${envName}=...`
186184
);
187185
}
188186

0 commit comments

Comments
 (0)