Skip to content

Commit 8b7d835

Browse files
committed
feat(start): add option to generate Claude Code environment variables
- Add new command line option `--claude-code-env` to generate environment variables for Claude Code - Update `runServer` function to use new `claudeCodeEnv` option - Add `claude-code-env` to `start` command options in README.md
1 parent acb4cf3 commit 8b7d835

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ The following command line options are available for the `start` command:
161161
| --wait | Wait instead of error when rate limit is hit | false | -w |
162162
| --github-token | Provide GitHub token directly (must be generated using the `auth` subcommand) | none | -g |
163163
| --claude-code | Generate a command to launch Claude Code with Copilot API config | false | -c |
164+
| --claude-code-env | Generate Claude Code Environment variables | true | none |
164165
| --show-token | Show GitHub and Copilot tokens on fetch and refresh | false | none |
165166

166167
### Auth Command Options

src/start.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ interface RunServerOptions {
2323
githubToken?: string
2424
claudeCode: boolean
2525
showToken: boolean
26+
claudeCodeEnv?: boolean
2627
}
2728

2829
export async function runServer(options: RunServerOptions): Promise<void> {
@@ -60,7 +61,7 @@ export async function runServer(options: RunServerOptions): Promise<void> {
6061

6162
const serverUrl = `http://localhost:${options.port}`
6263

63-
if (options.claudeCode) {
64+
if (options.claudeCode && options.claudeCodeEnv) {
6465
invariant(state.models, "Models should be loaded by now")
6566

6667
const selectedModel = await consola.prompt(
@@ -169,6 +170,11 @@ export const start = defineCommand({
169170
default: false,
170171
description: "Show GitHub and Copilot tokens on fetch and refresh",
171172
},
173+
"claude-code-env": {
174+
type: "boolean",
175+
default: true,
176+
description: "Generate Claude Code Environment variables",
177+
},
172178
},
173179
run({ args }) {
174180
const rateLimitRaw = args["rate-limit"]
@@ -186,6 +192,7 @@ export const start = defineCommand({
186192
githubToken: args["github-token"],
187193
claudeCode: args["claude-code"],
188194
showToken: args["show-token"],
195+
claudeCodeEnv: args["claude-code-env"],
189196
})
190197
},
191198
})

0 commit comments

Comments
 (0)