Skip to content

[0.0.28] Dynamic shell completion for profiles, plugins, and local subcommand values #2575

Closed

Description

@Xuepoo

Priority: P2 | Area: cli | Labels: feat,P2,area:cli | Milestone: v0.0.28 | Task: CTX-1486

Report

Owner request: when typing bitty --profile <TAB>, the shell should complete existing profile names. The same pattern should apply to other dynamic values, for example bitty plugin enable/disable <TAB> should complete installed plugin IDs, and other subcommands should be able to expose their own dynamic candidates.

Expected

  • Bash, Zsh, and Fish completion scripts gain dynamic candidates for:
    • --profile / --profile=
    • bitty plugin enable <id>, bitty plugin disable <id>, and equivalent bitty enable/disable aliases if present
    • bitty profile show/use/path <name> where applicable
  • Candidates are read-only and local: no network, no plugin execution, no runtime instance, no secrets; bounded time/output. A failure returns no candidates without breaking the shell.
  • Prefer one bounded hidden helper (for example +list-profiles / +list-plugins) that emits one candidate per line, optionally --json, and is covered by tests; static completion remains generated from the grammar tree.
  • PowerShell and Nushell either implement equivalent dynamic completion or explicitly fall back to static candidates with a documented limitation.
  • Completion handles spaces/Unicode in profile/plugin IDs, and never prints host paths or diagnostics into the candidate stream.
  • Tests: generated scripts contain the dynamic hooks; helper output is sorted/stable/bounded; malformed store/config fails soft; no network/plugin VM.
  • Docs/manual updated; no new public state.

Acceptance

  • Fresh shell with the generated completion can complete --profile <TAB> and plugin enable/disable <TAB> from real local state.
  • Unknown/missing store returns an empty candidate set and exit 0 for the helper.
  • No completion path invokes plugin code or performs network I/O.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2area:clifeat

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions