Skip to content

Shell completions#16

Merged
rayokamoto merged 9 commits intomainfrom
shell-completions
May 1, 2026
Merged

Shell completions#16
rayokamoto merged 9 commits intomainfrom
shell-completions

Conversation

@xxori
Copy link
Copy Markdown
Collaborator

@xxori xxori commented Apr 17, 2026

Add shell completions for zsh, bash, and fish.

They will complete competitions after -c or as the anonymous arg in aucpl comp finish, etc. They will complete problems after -p and other relevant spot. They will also complete for example aucpl <tab>, suggesting problem, comp, etc using Clap introspection.

Again, this requires evaluating aucpl shellinit.

@xxori xxori force-pushed the shell-completions branch from 6beda9a to 64d18c2 Compare April 17, 2026 16:09
@xxori xxori requested review from Copilot and rayokamoto and removed request for rayokamoto April 17, 2026 16:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds dynamic shell completions for aucpl (bash/zsh/fish) by introducing an internal completion subcommand and extending shellinit to register shell hooks, with README updates describing how to enable them.

Changes:

  • Add a hidden __complete subcommand that prints completion candidates based on CLI context and project state.
  • Extend aucpl shellinit to install completion hooks for bash/zsh and fish in addition to the existing aucpl cd wrapper.
  • Update README instructions to enable the shell hook for bash/zsh and fish and show completion examples.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
crates/cli/src/main.rs Routes the new internal __complete subcommand to its handler.
crates/cli/src/cli/mod.rs Registers the new complete module and adds it to the builtin command list.
crates/cli/src/cli/complete.rs Implements the hidden __complete command that emits completion candidates.
crates/cli/src/cli/shellinit.rs Emits shell integration snippets to enable wrappers + completions.
README.md Documents enabling the shell hook and demonstrates the new completions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/cli/src/cli/shellinit.rs Outdated
Comment thread README.md Outdated
Comment thread crates/cli/src/cli/complete.rs Outdated
Comment thread crates/cli/src/cli/shellinit.rs Outdated
@xxori xxori requested a review from rayokamoto April 25, 2026 13:45
Comment thread crates/cli/src/cli/complete.rs Outdated
Comment thread crates/cli/src/main.rs
Comment thread crates/cli/src/cli/shellinit.rs
xxori and others added 8 commits May 1, 2026 01:37
Use a manual loop instead of mapfile to do completions

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Unquoted substitution does work, but it is safer to use the quoted version

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@rayokamoto rayokamoto self-requested a review April 30, 2026 16:42
@rayokamoto rayokamoto merged commit 45fc723 into main May 1, 2026
1 check passed
@rayokamoto rayokamoto deleted the shell-completions branch May 1, 2026 01:05
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.

3 participants