summaryrefslogtreecommitdiff
path: root/packages/cli
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli')
-rw-r--r--packages/cli/src/config/config.ts2
-rw-r--r--packages/cli/src/gemini.ts19
-rw-r--r--packages/cli/src/utils/sandbox.ts14
3 files changed, 27 insertions, 8 deletions
diff --git a/packages/cli/src/config/config.ts b/packages/cli/src/config/config.ts
index 9f03bee4..bb9c34e2 100644
--- a/packages/cli/src/config/config.ts
+++ b/packages/cli/src/config/config.ts
@@ -59,7 +59,7 @@ async function parseArguments(): Promise<CliArgs> {
alias: 'm',
type: 'string',
description: `Model`,
- default: process.env.GEMINI_CODE_MODEL || DEFAULT_GEMINI_MODEL,
+ default: process.env.GEMINI_MODEL || DEFAULT_GEMINI_MODEL,
})
.option('prompt', {
alias: 'p',
diff --git a/packages/cli/src/gemini.ts b/packages/cli/src/gemini.ts
index 4225e8c3..2adf4c7d 100644
--- a/packages/cli/src/gemini.ts
+++ b/packages/cli/src/gemini.ts
@@ -24,6 +24,25 @@ const __dirname = dirname(__filename);
async function main() {
const settings = loadSettings(process.cwd());
const config = await loadCliConfig(settings.merged);
+
+ // warn about deprecated environment variables
+ if (process.env.GEMINI_CODE_MODEL) {
+ console.warn('GEMINI_CODE_MODEL is deprecated. Use GEMINI_MODEL instead.');
+ process.env.GEMINI_MODEL = process.env.GEMINI_CODE_MODEL;
+ }
+ if (process.env.GEMINI_CODE_SANDBOX) {
+ console.warn(
+ 'GEMINI_CODE_SANDBOX is deprecated. Use GEMINI_SANDBOX instead.',
+ );
+ process.env.GEMINI_SANDBOX = process.env.GEMINI_CODE_SANDBOX;
+ }
+ if (process.env.GEMINI_CODE_SANDBOX_IMAGE) {
+ console.warn(
+ 'GEMINI_CODE_SANDBOX_IMAGE is deprecated. Use GEMINI_SANDBOX_IMAGE_NAME instead.',
+ );
+ process.env.GEMINI_SANDBOX_IMAGE = process.env.GEMINI_CODE_SANDBOX_IMAGE;
+ }
+
if (settings.merged.theme) {
if (!themeManager.setActiveTheme(settings.merged.theme)) {
// If the theme is not found during initial load, log a warning and continue.
diff --git a/packages/cli/src/utils/sandbox.ts b/packages/cli/src/utils/sandbox.ts
index 53733bfc..aa8d9f2a 100644
--- a/packages/cli/src/utils/sandbox.ts
+++ b/packages/cli/src/utils/sandbox.ts
@@ -73,7 +73,7 @@ async function shouldUseCurrentUserInSandbox(): Promise<boolean> {
// node.js equivalent of scripts/sandbox_command.sh
export function sandbox_command(sandbox?: string | boolean): string {
// note environment variable takes precedence over argument (from command line or settings)
- sandbox = process.env.GEMINI_CODE_SANDBOX?.toLowerCase().trim() ?? sandbox;
+ sandbox = process.env.GEMINI_SANDBOX?.toLowerCase().trim() ?? sandbox;
if (sandbox === '1' || sandbox === 'true') sandbox = true;
else if (sandbox === '0' || sandbox === 'false') sandbox = false;
@@ -86,7 +86,7 @@ export function sandbox_command(sandbox?: string | boolean): string {
} else {
console.error(
'ERROR: failed to determine command for sandbox; ' +
- 'install docker or podman or specify command in GEMINI_CODE_SANDBOX',
+ 'install docker or podman or specify command in GEMINI_SANDBOX',
);
process.exit(1);
}
@@ -96,7 +96,7 @@ export function sandbox_command(sandbox?: string | boolean): string {
return sandbox;
} else {
console.error(
- `ERROR: missing sandbox command '${sandbox}' (from GEMINI_CODE_SANDBOX)`,
+ `ERROR: missing sandbox command '${sandbox}' (from GEMINI_SANDBOX)`,
);
process.exit(1);
}
@@ -255,7 +255,7 @@ export async function start_sandbox(sandbox: string) {
// determine full path for gemini-code to distinguish linked vs installed setting
const gcPath = execSync(`realpath $(which gemini)`).toString().trim();
- const image = process.env.GEMINI_CODE_SANDBOX_IMAGE ?? 'gemini-code-sandbox';
+ const image = process.env.GEMINI_SANDBOX_IMAGE ?? 'gemini-code-sandbox';
const workdir = process.cwd();
// if BUILD_SANDBOX is set, then call scripts/build_sandbox.sh under gemini-code repo
@@ -383,9 +383,9 @@ export async function start_sandbox(sandbox: string) {
args.push('--env', `GEMINI_API_KEY=${process.env.GEMINI_API_KEY}`);
}
- // copy GEMINI_CODE_MODEL
- if (process.env.GEMINI_CODE_MODEL) {
- args.push('--env', `GEMINI_CODE_MODEL=${process.env.GEMINI_CODE_MODEL}`);
+ // copy GEMINI_MODEL
+ if (process.env.GEMINI_MODEL) {
+ args.push('--env', `GEMINI_MODEL=${process.env.GEMINI_MODEL}`);
}
// copy TERM and COLORTERM to try to maintain terminal setup