Depends on
- Decline subcommand tree (hidden
__complete subcommand is part of the tree)
GET /api/clubs endpoint (slug source)
Blocks
None.
What
Tab completion for ccas in bash, zsh, fish. Two layers:
- Hidden
ccas __complete <args> subcommand. Given a partial argv, prints space-separated match candidates. Examples:
ccas __complete → list of top-level subcommands.
ccas __complete membership → list of club slugs.
ccas __complete logs → list of recent job IDs.
ccas completion <shell> prints a shell completion script (bash, zsh, fish) to stdout. Each script wires its native completion system to call ccas __complete for dynamic results.
Sources for dynamic completions:
- Club slugs: read from cache file
${XDG_CACHE_HOME:-~/.cache}/ccas/clubs.txt, refreshed after every successful command (Phase 1: write the response of GET /api/clubs to the cache after any non-__complete command finishes). Fallback to default_clubs from config if cache missing.
- Job IDs: cache file
${XDG_CACHE_HOME}/ccas/recent-jobs.txt, written by the CLI's poll loop on every job submission.
Completion must not block on network. Cache reads only.
Acceptance
eval "$(ccas completion bash)" enables ccas <TAB> completion in bash.
ccas <TAB><TAB> lists all subcommands.
ccas membership <TAB><TAB> lists known club slugs from cache.
ccas logs <TAB><TAB> lists recent job IDs.
- With an empty cache, falls back to
default_clubs from config.
- Completion latency under 50ms.
Files
src/main/scala/ccas/cli/complete/ — __complete subcommand, cache read/write.
- new
src/main/scala/ccas/cli/completion/ — bash.sh, zsh.sh, fish.sh templates emitted by ccas completion <shell>.
Out of scope
- PowerShell.
- Completion for
--since / --until date flags. Free-form dates aren't productively completable.
Reference
Tracked under epic #40 (CLI v0). Discussed in the planning thread; folded into the CLI epic.
Depends on
__completesubcommand is part of the tree)GET /api/clubsendpoint (slug source)Blocks
None.
What
Tab completion for
ccasin bash, zsh, fish. Two layers:ccas __complete <args>subcommand. Given a partial argv, prints space-separated match candidates. Examples:ccas __complete→ list of top-level subcommands.ccas __complete membership→ list of club slugs.ccas __complete logs→ list of recent job IDs.ccas completion <shell>prints a shell completion script (bash, zsh, fish) to stdout. Each script wires its native completion system to callccas __completefor dynamic results.Sources for dynamic completions:
${XDG_CACHE_HOME:-~/.cache}/ccas/clubs.txt, refreshed after every successful command (Phase 1: write the response ofGET /api/clubsto the cache after any non-__completecommand finishes). Fallback todefault_clubsfrom config if cache missing.${XDG_CACHE_HOME}/ccas/recent-jobs.txt, written by the CLI's poll loop on every job submission.Completion must not block on network. Cache reads only.
Acceptance
eval "$(ccas completion bash)"enablesccas <TAB>completion in bash.ccas <TAB><TAB>lists all subcommands.ccas membership <TAB><TAB>lists known club slugs from cache.ccas logs <TAB><TAB>lists recent job IDs.default_clubsfrom config.Files
src/main/scala/ccas/cli/complete/—__completesubcommand, cache read/write.src/main/scala/ccas/cli/completion/—bash.sh,zsh.sh,fish.shtemplates emitted byccas completion <shell>.Out of scope
--since/--untildate flags. Free-form dates aren't productively completable.Reference
Tracked under epic #40 (CLI v0). Discussed in the planning thread; folded into the CLI epic.