Skip to content

Align Gemini config isolation with Claude/Codex#1

Open
hmirin wants to merge 55 commits intomainfrom
fix/gemini-cli-home-isolation
Open

Align Gemini config isolation with Claude/Codex#1
hmirin wants to merge 55 commits intomainfrom
fix/gemini-cli-home-isolation

Conversation

@hmirin
Copy link
Copy Markdown
Contributor

@hmirin hmirin commented Feb 21, 2026

Summary

  • enable project-local Gemini isolation by setting GEMINI_CLI_HOME in runAction
  • remove outdated Gemini fallback warning that said isolation was unsupported
  • align avm list output so Gemini shows local config path when project config exists, matching Claude/Codex behavior

Testing

  • npm test

hmirin and others added 30 commits January 17, 2026 16:51
- Isolate Claude and Codex config/state per project using environment
  variables (CLAUDE_CONFIG_DIR, CODEX_HOME)
- Skip isolation for Gemini CLI with warning (no env var support yet,
  see github.com/google-gemini/gemini-cli/issues/2815)
- Enhanced `avm list` output to show config and install paths
- Add .avm/ to .gitignore (local agent state)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Simplify config resolution to nearest project + global only, always print Using ... on run, and add run --debug.
Drop the ccenv ls alias; list is the only supported command name.
Profile runtime updates are now ccenv update <profile>. Keep ccenv self-update for updating ccenv itself.
hmirin and others added 25 commits March 1, 2026 18:13
- Delete unused `resolveProfileForAgent()` wrapper (zero call sites)
- Delete unused `formatItem` in `selectProfileViaTui`
- Remove redundant `InstallTarget.agent` field (duplicated by `name`)
- Inline `resolveProfileName()` wrapper into call sites
- Remove redundant `|| null` after `readJson(..., null)`
- Remove unreachable `CliUserError` branch in `resolveExitCode`

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deduplicate identical sourceLabel() definitions from listAction and
currentAction into a single shared function.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Simplify fetchLatestCcenvVersion by using the built-in fetch API
(Node 18+) with AbortController for timeout instead of manual
stream handling with node:https.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Break up the 2400-line commands.ts God Module into focused modules:
- config.ts: config loading, merging, serialization, healing, updating
- resolution.ts: profile/agent resolution and installed profile reading
- tui.ts: blessed TUI profile selector and rendering
- agents.ts: add shellEscapeArg and stringifyArgs (moved from commands.ts)
- commands.ts: command action functions only

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ates

- Replace dynamic import('node:fs/promises') with static import in config.ts
- Remove duplicated assertSupportedAgent from config.ts (import from agents)
- Remove duplicated assertValidProfileName from resolution.ts (import from agents)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Strip prerelease suffixes (e.g. -beta.1) before numeric comparison
to avoid incorrect results from parseInt on hyphenated segments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add agents.test.cjs with unit tests for parseArgsString,
  normalizeAgentName, normalizeProfileName, assertValidProfileName,
  assertSupportedAgent, shellEscapeArg, and stringifyArgs
- Add t.after() cleanup to all integration tests to remove temp dirs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…port

- Handle ENOENT in loadConfigFile by returning empty config instead of
  throwing, fixing race condition when file is deleted between exists
  check and read
- Fix err.message type-unsafe access (use instanceof Error check)
- Import selfUpdateAction directly in cli.ts from selfUpdate.ts instead
  of re-exporting through commands.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
blessed has been unmaintained since ~2015. Switch to neo-blessed (0.2.0),
a maintained fork with the same API surface.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Create src/types.ts with ProfileConfig, CcenvConfig, ProfileRecord,
  ResolvedProfile, ProfileSettings, and other shared interfaces
- Replace all `any` annotations with proper types across all modules
- Normalize unsetEnv to consistently use Set<string> everywhere
- Enable strict: true in tsconfig.json
- Remove biome noExplicitAny override (no longer needed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
These were evaluated once at module load time, so changing
process.env.CCENV_HOME after import had no effect. Now they use
Object.defineProperty getters so the values are resolved on each access.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, dry-run

- Shell completions: `ccenv completions bash|zsh|fish` generates completion scripts
- Command aliases: i (install), up (update), rm (remove), ls (list)
- Clone command: `ccenv clone <source> <target>` duplicates profiles with settings
- Fuzzy suggestions: "Did you mean ...?" on mistyped profile names (Levenshtein)
- Dry-run: `ccenv run --dry-run` previews resolved profile/args/env without running
- Add docs/dx-improvements.md with full DX improvement roadmap

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Every error now provides concrete next steps:
- "No profiles installed" shows quick start guide with all 3 agents
- "Multiple profiles found" shows how to specify or set a default
- "No installed profile for agent" shows install commands
- Profile not found shows available profiles and fuzzy suggestions
- Unsupported agent shows full agent list with descriptions
- --profile/--agent conflicts show correct usage patterns
- Missing executable suggests reinstall command
- TUI TTY error suggests non-interactive alternatives
- "No changes" on profile/project edit shows usage with the actual profile name

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- --env-file: load env vars from .env file in install, profile edit, project edit
  Supports comments (#), quoted values, and KEY=VALUE format
- ccenv which <profile>: print the resolved binary path for a profile
- ccenv open <profile> [--config]: open profile dir in file manager
- CCENV_PROFILE: set in child process env during ccenv run so agents
  can detect which profile they were launched from
- Remove completed items from docs/dx-improvements.md
- Update shell completions for new commands

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add missing commands (which, open, clone, completions, self-update),
flags (--env-file, --tui, --dry-run, --debug), aliases, selector
resolution docs, shell completions section, and config schema examples.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Runs format, lint, typecheck, and tests on push to main and PRs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rename bin alias ce -> agent for clarity (short for "agent")
- Rewrite README with compelling tagline, why/use-case sections,
  and progressive quick start flow
- Update shell completions for the new alias

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Aligns with dotfile conventions used by similar tools (.nvmrc, .envrc).
Renames schema file to .ccenv.schema.json accordingly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant