Skip to content

feat: improve external CLI version display in opencli list#570

Open
ByteYue wants to merge 4 commits intojackwener:mainfrom
ByteYue:feature/external-cli-version-display
Open

feat: improve external CLI version display in opencli list#570
ByteYue wants to merge 4 commits intojackwener:mainfrom
ByteYue:feature/external-cli-version-display

Conversation

@ByteYue
Copy link
Copy Markdown
Collaborator

@ByteYue ByteYue commented Mar 29, 2026

Summary

This PR improves version display for external CLIs in opencli list. Depends on #568.

Improvements

  • Shows the installed version number for both isolated and global installations
  • Adds installation type marker: (isolated) for isolated installations, (system) for global installations
  • Caches version detection results for 24 hours to avoid repeated --version calls
  • Automatically extracts version from --version / -v output
  • Includes version and install type information in JSON/YAML output formats

Output example

  external CLIs
    lark-cli v1.5.2 (isolated) — Lark/Feishu CLI with 200+ commands
    gh v2.40.0 (system) — GitHub CLI
    docker [auto-install] — Docker CLI

New Files

  • tests/e2e/external-cli-version-display.test.ts — 6 e2e tests for version display

Modified Files

  • src/external.ts — Added version detection, caching, and collectListEntries
  • src/cli.ts — Updated opencli list output to include version information
  • vitest.config.ts — Registered new e2e test file

Bug Fixes (from PR#3 merge)

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

ByteYue and others added 4 commits March 29, 2026 15:21
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>
This change adds:
- Show installed version for both isolated and global external CLIs
- Display installation type marker: (isolated) or (system)
- Cache version detection results for 24h to avoid repeated --version calls
- Include version and install type in JSON/YAML output formats
- Automatic version detection from --version/-v output

Output example:
  lark-cli v1.5.2 (isolated) — Lark/Feishu CLI with 200+ commands
  gh v2.40.0 (system) — GitHub CLI
  docker [auto-install] — Docker CLI

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
- Add external-cli-version-display.test.ts with 6 e2e tests covering:
  table format version/isolated display, JSON format version/installType fields,
  YAML format version display, lock file version caching, non-installed CLI display
- Register new test file in vitest.config.ts
@ByteYue ByteYue force-pushed the feature/external-cli-version-display branch from 6e389f5 to 2d20cb4 Compare March 29, 2026 07:21
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