Skip to content

Add shell completions command - #62

Merged
mohsen1 merged 2 commits into
prooflinedev:mainfrom
IliaZyrin:shell-completions
Nov 17, 2026
Merged

mohsen1 merged 2 commits into
prooflinedev:mainfrom
IliaZyrin:shell-completions

Conversation

@IliaZyrin

Copy link
Copy Markdown
Contributor

Summary

Adds proofline completions SHELL, which prints a shell completion script to stdout. It supports zsh, bash, fish and powershell, plus elvish, which comes free with clap_complete.

  • No sign-in or network needed. The command runs before the base URL is parsed, so it works before proofline login.
  • Hidden commands are left out. clap_complete's static generators also list hidden subcommands. The handler rebuilds the top-level command without them before generating, so __update-check is no longer offered. The global flags (--base-url, --org) are still completed.
  • No update check. A shell profile may run source <(proofline completions zsh) at every start-up, so the background update check is skipped for this command.
  • Unknown shells are refused. The error lists the valid shells.
  • The README has a short usage note.

The only new dependency is clap_complete 4.6.11.

Testing

New tests in tests/completions.rs:

  • each shell gets its own script that lists the visible commands and leaves out __update-check;
  • an unknown shell is refused, with nothing on stdout;
  • the generated bash script, loaded into a real bash, completes proofline comp to completions.

IliaZyrin and others added 2 commits November 12, 2026 02:12
`proofline completions zsh|bash|fish|powershell|elvish` prints a
completion script built with clap_complete. It runs before the base
URL is parsed, so it works with no sign-in and makes no network call.

The static generators would also offer the hidden `__update-check`
command, so the top-level command is rebuilt without hidden
subcommands before generating. A shell profile may run this command
at every start-up, so it also skips the background update check.

@mohsen1 mohsen1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex

Resolved README and lockfile conflicts while retaining current dependencies and the existing clap_complete entry. Completions remain offline and hide internal commands. Both required jobs passed.

@mohsen1
mohsen1 merged commit ce46c18 into prooflinedev:main Nov 17, 2026
2 of 3 checks passed
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.

2 participants