attempt is a clap-based CLI with a fairly deep subcommand tree (hook, sync, snapshot, keys, daemon, repair, import, …), and typing it without completion is tedious.
What to do
Add attempt completions <bash|zsh|fish|powershell|elvish> that writes a completion script to stdout, using clap_complete. The CLI is defined in crates/attempt/src/cli.rs (derive API), so clap_complete::generate needs Cli::command() and nothing else.
- New file
crates/attempt/src/cmd_completions.rs, wired in crates/attempt/src/main.rs next to the other Command:: arms.
- Add
clap_complete to [workspace.dependencies] in the root Cargo.toml and to crates/attempt/Cargo.toml. It is a build-time-only code generator with no transitive weight, so it does not threaten the single-binary rule — say so in the PR.
- A unit test that generating for each shell produces non-empty output and does not panic.
Done when
attempt completions zsh | head prints a completion script, cargo test -p attemptdb passes, and README.md's install section mentions how to install completions.
Good first issue: self-contained, one new file, no design decisions.
attemptis a clap-based CLI with a fairly deep subcommand tree (hook,sync,snapshot,keys,daemon,repair,import, …), and typing it without completion is tedious.What to do
Add
attempt completions <bash|zsh|fish|powershell|elvish>that writes a completion script to stdout, usingclap_complete. The CLI is defined incrates/attempt/src/cli.rs(derive API), soclap_complete::generateneedsCli::command()and nothing else.crates/attempt/src/cmd_completions.rs, wired incrates/attempt/src/main.rsnext to the otherCommand::arms.clap_completeto[workspace.dependencies]in the rootCargo.tomland tocrates/attempt/Cargo.toml. It is a build-time-only code generator with no transitive weight, so it does not threaten the single-binary rule — say so in the PR.Done when
attempt completions zsh | headprints a completion script,cargo test -p attemptdbpasses, andREADME.md's install section mentions how to install completions.Good first issue: self-contained, one new file, no design decisions.