Skip to content

feat: add isolated installation and version management for external CLIs#568

Open
ByteYue wants to merge 2 commits intojackwener:mainfrom
ByteYue:feature/external-cli-isolated-install
Open

feat: add isolated installation and version management for external CLIs#568
ByteYue wants to merge 2 commits intojackwener:mainfrom
ByteYue:feature/external-cli-isolated-install

Conversation

@ByteYue
Copy link
Copy Markdown
Collaborator

@ByteYue ByteYue commented Mar 28, 2026

Summary

This PR adds isolated installation and version management for external CLIs in opencli.

New Features

  • Isolated installation mode: Install external CLIs to ~/.opencli/opt/ without polluting the global environment
  • Multiple version support: Install multiple versions of the same CLI side-by-side
  • Version switching: opencli switch <name> <version> to quickly switch between versions
  • Clean uninstallation: opencli uninstall <name> completely removes all files
  • Backward compatible: Global installation remains the default, existing external CLIs continue to work

New CLI Commands

  • opencli install <name> --isolated [--version <ver>] — Install with optional isolation and version
  • opencli uninstall <name> [--version <ver>] — Uninstall isolated installation
  • opencli switch <name> <version> — Switch active version

Bug Fixes

  • install and uninstall commands now properly set process.exitCode = 1 on failure

New Files

  • src/external-store.ts — Lock file management for isolated installations
  • tests/e2e/external-cli-management.test.ts — 9 e2e tests covering all new commands

Modified Files

  • src/external.ts — Extended with isolated install, uninstall, switch logic
  • src/cli.ts — Added new CLI commands, fixed exit code handling
  • vitest.config.ts — Registered new e2e test file

ByteYue and others added 2 commits March 29, 2026 10:29
This change adds:
- Isolated installation mode: install external CLIs to ~/.opencli/opt/ without polluting global
- Version management: support multiple versions, switch between versions
- Uninstall: cleanly uninstall isolated installations
- New CLI commands:
  * opencli install <name> [--version <ver>] [--isolated]
  * opencli uninstall <name> [--version <ver>]
  * opencli switch <name> <version>
- Backward compatible: global installation remains default

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

- Add external-cli-management.test.ts with 9 e2e tests covering:
  register, isolated install, version-specific install, switch,
  uninstall (specific version and all), and error cases
- Fix install/uninstall commands to set process.exitCode on failure
- Register new test file in vitest.config.ts
@ByteYue ByteYue force-pushed the feature/external-cli-isolated-install branch from d2c571c to 5670eba Compare March 29, 2026 02:30
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