Skip to content

feat: xcind — standalone dispatcher with full tab completion - #96

Merged
simensen merged 1 commit into
mainfrom
feat/xcind-dispatcher
Sep 15, 2026
Merged

simensen merged 1 commit into
mainfrom
feat/xcind-dispatcher

Conversation

@simensen

Copy link
Copy Markdown
Member

What

A standalone xcind binary that dispatches to the existing xcind-* commands, with full tab completion in bash and zsh.

  • xcind compose up -d is exactly xcind-compose up -d; every remaining argument passes through verbatim via exec.
  • app aliases application, mirroring the xcind-app symlink.
  • xcind <TAB> completes the command word. After the command, completion delegates to the existing per-command functions, so xcind run fr<TAB> completes declared bin/script names and xcind compose <TAB> keeps Docker's full Cobra completion, including service names.

How

The dispatcher is exec-only. It sources no libraries on the dispatch path, so it adds no startup cost. Only --version sources the lib for the build-provenance string.

The completion functions work by re-seating the word arrays. The per-command functions key off word positions and never read the command name at word 0 (this already powers the x-* wrappers), so the new top-level function shifts COMP_WORDS/COMP_CWORD (bash) or words/CURRENT (zsh) by one and delegates. The seven existing functions are untouched.

Behavior change

flake.nix mainProgram now points at xcind, so nix run lands on the dispatcher help instead of xcind-compose. The Docker ENTRYPOINT stays xcind-compose, so existing docker run invocations keep working.

Testing

  • Dispatcher behavior tests in test/test-xcind.sh: help, version, unknown-command exit code, and byte-for-byte passthrough equality against direct invocations.
  • Completion tests in test/test-xcind-completion.sh for both shells, driven through the same comp_run/zsh-driver harness as the existing suites, including docker-gated proofs of compose service-name delegation and dynamic run-name completion against a real fixture.
  • make check passes: lint clean, 2,280 assertions, 0 failures. contrib/check-file-manifest and nix flake check pass.

Add bin/xcind, a minimal exec-only dispatcher: `xcind compose ...` runs
`xcind-compose ...`, `app` aliases `application`, and every remaining
argument passes through verbatim. No libraries are sourced on the
dispatch path, so the dispatcher adds no startup cost; only --version
sources the lib for the build-provenance string.

Completion covers both shells. New top-level functions complete the
command word at `xcind <TAB>`, then re-seat COMP_WORDS/COMP_CWORD
(bash) or words/CURRENT (zsh) and delegate to the existing per-command
functions, which never read word 0. Dynamic completion carries through:
`xcind run fr<TAB>` completes declared bin/script names, and
`xcind compose <TAB>` keeps Docker's full Cobra completion including
service names.

Register the new binary in all seven install manifests. Repoint
flake.nix mainProgram from xcind-compose to xcind, so `nix run` now
lands on the dispatcher help (behavior change for nix run users). The
Docker ENTRYPOINT stays xcind-compose.
@simensen
simensen merged commit 660eb61 into main Sep 15, 2026
17 checks passed
@simensen
simensen deleted the feat/xcind-dispatcher branch September 15, 2026 19: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