Skip to content

fix(completion): sync top-level command suggestions#588

Open
inori-3333 wants to merge 1 commit intojackwener:mainfrom
inori-3333:main
Open

fix(completion): sync top-level command suggestions#588
inori-3333 wants to merge 1 commit intojackwener:mainfrom
inori-3333:main

Conversation

@inori-3333
Copy link
Copy Markdown
Contributor

Description

Fix shell completion so top-level command suggestions match the current CLI surface.
Btw, sorry for my last PR which didn't attach the test output. This time I atttached it below, thanks.

This change:

  • removes stale setup from completion candidates
  • adds missing top-level built-ins: plugin, install, and register
  • adds a unit test covering the top-level completion list to prevent regressions

Related issue:

  • N/A

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🌐 New site adapter
  • 📝 Documentation
  • ♻️ Refactor
  • 🔧 CI / build / tooling

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful

Documentation (if adding/modifying an adapter)

N/A — this PR does not add or modify an adapter.

  • Added doc page under docs/adapters/ (if new adapter)
  • Updated docs/adapters/index.md table (if new adapter)
  • Updated sidebar in docs/.vitepress/config.mts (if new adapter)
  • Updated README.md / README.zh-CN.md when command discoverability changed
  • Used positional args for the command's primary subject unless a named flag is clearly better
  • Normalized expected adapter failures to CliError subclasses instead of raw Error

Screenshots / Output

Checks run:

  • npx vitest run src/completion.test.ts --project unit
  • npm run typecheck

Completion output after this change:

E:\Inori_Code\Intrest\fromGit\opencli> npx vitest run src/completion.test.ts --project unit

 RUN  v4.1.1 E:/Inori_Code/Intrest/fromGit/opencli

 ✓  unit  src/completion.test.ts (2 tests) 4ms
   ✓ getCompletions (2)
     ✓ includes top-level built-ins that are registered outside the site registry 2ms
     ✓ still includes discovered site names 0ms

 Test Files  1 passed (1)
      Tests  2 passed (2)
   Start at  01:38:35
   Duration  239ms (transform 37ms, setup 0ms, import 82ms, tests 4ms, environment 0ms)
E:\Inori_Code\Intrest\fromGit\opencli> npm run typecheck

> @jackwener/opencli@1.5.5 typecheck
> tsc --noEmit

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