Skip to content

feat(complete): support shell alias registration - #1158

Merged
jdx merged 1 commit into
agent/external-clap-adoptersfrom
agent/completion-shell-aliases
Aug 21, 2026
Merged

feat(complete): support shell alias registration#1158
jdx merged 1 commit into
agent/external-clap-adoptersfrom
agent/completion-shell-aliases

Conversation

@jdx

@jdx jdx commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Replaces #1146, which GitHub automatically marked merged when dependent branch refs temporarily matched during a restack. This is the same layer on the corrected stack.\n\n_This pull request was generated by Codex._


Note

Low Risk
Additive completion-script generation only. Parsing and ordinary CLI behavior are unchanged; risk is limited to generated shell registration names.

Overview
Adds explicit shell-alias completion: generated scripts can register a short name like m while the callback still runs the real binary (mise). This is a registration API, not alias discovery, so it does not depend on interactive alias expansion.

script() now delegates to script_for(bin, name, shell). Bash, zsh, fish, Nu, and PowerShell register name and invoke bin. The same split is exposed as completion_script_for_alias on derived CLIs and the embedded App API. Both the registered name and the invoked binary are asserted to be a single safe shell word.

Reviewed by Cursor Bugbot for commit e454902. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: f906ff56-6e55-4dab-8ac2-5760b146680a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jdx
jdx force-pushed the agent/completion-shell-aliases branch from 7751ad1 to ce773ba Compare August 21, 2026 02:41
@jdx
jdx force-pushed the agent/completion-shell-aliases branch from ce773ba to 77b5402 Compare August 21, 2026 02:43
@jdx
jdx force-pushed the agent/completion-shell-aliases branch from 77b5402 to 11afcb4 Compare August 21, 2026 02:47
@jdx
jdx force-pushed the agent/completion-shell-aliases branch from 11afcb4 to 71903b1 Compare August 21, 2026 03:17
@jdx
jdx force-pushed the agent/completion-shell-aliases branch from 71903b1 to 925b457 Compare August 21, 2026 03:21
@jdx
jdx force-pushed the agent/completion-shell-aliases branch 2 times, most recently from 88c48a1 to 750419b Compare August 21, 2026 03:43

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 750419b. Configure here.

Comment thread argv/src/script.rs
@jdx
jdx force-pushed the agent/completion-shell-aliases branch 2 times, most recently from 88c48a1 to 5cca41d Compare August 21, 2026 03:56
@jdx
jdx force-pushed the agent/completion-shell-aliases branch from 5cca41d to 18cfabd Compare August 21, 2026 04:10
@jdx
jdx force-pushed the agent/completion-shell-aliases branch from 18cfabd to 2839c3c Compare August 21, 2026 04:19
@jdx
jdx force-pushed the agent/completion-shell-aliases branch from 2839c3c to 2c53ca4 Compare August 21, 2026 04:31
@jdx
jdx force-pushed the agent/completion-shell-aliases branch 3 times, most recently from ca73ffd to 95b3959 Compare August 21, 2026 04:43
@jdx
jdx force-pushed the agent/completion-shell-aliases branch 3 times, most recently from fb35a1d to 907066f Compare August 21, 2026 06:35
@jdx
jdx force-pushed the agent/completion-shell-aliases branch 2 times, most recently from 42ff905 to d37a160 Compare August 21, 2026 06:56
@jdx
jdx force-pushed the agent/completion-shell-aliases branch from d37a160 to 89ebfe3 Compare August 21, 2026 07:10
@jdx
jdx force-pushed the agent/completion-shell-aliases branch from 89ebfe3 to be6b2c8 Compare August 21, 2026 07:23
@jdx
jdx force-pushed the agent/completion-shell-aliases branch from be6b2c8 to 3a7a49a Compare August 21, 2026 07:30
@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
markdown ▁██ 226,113,376 → 226,081,848 -0.01% 21.96 → 20.86ms -4.99%
startup ▁█▆ 1,226,955 → 1,226,233 -0.06% 1.32 → 1.44ms +9.14%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

Shadow comparison

Parsing mise use -g node@20 against a shadow of mise's committed spec.
Reported, not gated: the shadow grows as the derive learns to express more, so
what to watch is the ratio rather than either column.

framework instructions, cold parse vs usage
usage 8316
argh 6307 0.8x
clap 6316072 759x
bpaf 21909147 2634x
                                              min       p01       p10    median
usage-rs: argv -> struct                      403       411       414       418  ns
argh: argv -> struct                          286       288       291       303  ns
clap: build tree + parse -> struct         512656    514350    516137    519563  ns
bpaf: build parser + parse -> struct      1562667   1562667   1580046   1601224  ns

usage: argv -> struct                             415 ns      0.41 µs
clap: build tree + parse -> struct             523748 ns    523.75 µs
clap: parse -> struct, tree reused              23093 ns     23.09 µs
clap: build tree only                          321629 ns    321.63 µs

e4549028527f vs df4693ff99fc · measured on the runner, not pushed to the history.

@jdx
jdx force-pushed the agent/completion-shell-aliases branch from 3a7a49a to 5528f09 Compare August 21, 2026 07:49
@jdx
jdx force-pushed the agent/completion-shell-aliases branch from 5528f09 to e95a993 Compare August 21, 2026 08:10
@jdx
jdx force-pushed the agent/completion-shell-aliases branch 2 times, most recently from 3988450 to f05095f Compare August 21, 2026 08:25
@jdx
jdx force-pushed the agent/completion-shell-aliases branch 3 times, most recently from d26ed83 to de54c61 Compare August 21, 2026 08:44
@jdx
jdx force-pushed the agent/completion-shell-aliases branch from de54c61 to c403518 Compare August 21, 2026 08:48
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