Skip to content

feat: add rust toolchain and shell completions - #5

Merged
manuelmauro merged 3 commits into
mainfrom
feat/shell-completions
Jun 12, 2026
Merged

feat: add rust toolchain and shell completions#5
manuelmauro merged 3 commits into
mainfrom
feat/shell-completions

Conversation

@manuelmauro

@manuelmauro manuelmauro commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Pin the Rust toolchain via rust-toolchain.toml (1.92.0 with rustfmt and clippy), matching the setup in skilo.
  • Add a self command group whose completions subcommand prints a shell completion script to stdout, generated with clap_complete.

Shell completions

arkouda self completions <shell> supports bash, zsh, fish, powershell, and elvish:

# Bash (add to ~/.bashrc)
eval "$(arkouda self completions bash)"

# Zsh (add to ~/.zshrc)
eval "$(arkouda self completions zsh)"

# Fish (add to ~/.config/fish/config.fish)
arkouda self completions fish | source

Changes

  • Cargo.toml: add clap_complete dependency.
  • src/cli.rs: self group + SelfCommand::Completions, CompletionsArgs, and a Shell value enum.
  • src/commands/completions.rs: generate completions to stdout.
  • src/main.rs: dispatch the nested self completions subcommand.
  • src/telemetry.rs: map the self group in Command::name().
  • README.md: document the command and toolchain.

Test plan

  • cargo fmt --all -- --check, cargo clippy --all-targets --all-features -- -D warnings, and cargo test --all (28 passing) all clean via the pre-commit hook.
  • Verified arkouda self --help lists completions and arkouda self completions zsh emits a valid script.

Summary by CodeRabbit

  • New Features

    • Added shell completions support via self completions command for bash, zsh, fish, PowerShell, and Elvish shells.
  • Documentation

    • Updated documentation with shell completions installation and usage instructions.
  • Chores

    • Pinned Rust toolchain version and enabled development tools configuration.

Pin the toolchain via rust-toolchain.toml (1.92.0 with rustfmt and
clippy), and add a `self` command group whose `completions` subcommand
generates shell completion scripts for bash, zsh, fish, powershell, and
elvish via clap_complete.
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@manuelmauro, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 51 minutes and 49 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ecd872d8-6971-4045-840b-016a2d1afd2a

📥 Commits

Reviewing files that changed from the base of the PR and between cdbabc0 and f1a2fc4.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • src/cli.rs
📝 Walkthrough

Walkthrough

This PR adds a new self completions subcommand that generates shell completion scripts for bash, zsh, fish, PowerShell, and Elvish. The implementation uses the clap_complete crate and includes CLI contract definitions, command dispatch wiring, telemetry integration, and user-facing documentation.

Changes

Shell Completions Feature

Layer / File(s) Summary
CLI contract and dependencies
src/cli.rs, Cargo.toml
Command::SelfCmd variant holds SelfArgs, which nests SelfCommand::Completions with CompletionsArgs. CompletionsArgs accepts a Shell enum supporting five shell types. The clap_complete crate is added as a dependency.
Completions command implementation
src/commands/completions.rs, src/commands/mod.rs
The completions::run() function generates shell-specific completion scripts by mapping the Shell enum to clap_complete shell types, constructing the CLI command, and writing output to stdout.
Main dispatch and telemetry
src/main.rs, src/telemetry.rs
src/main.rs imports SelfCommand and routes Command::SelfCmd to the completions handler. src/telemetry.rs registers the "self" command name for telemetry events.
Documentation and toolchain configuration
README.md, rust-toolchain.toml
The README documents the self completions command and provides shell-specific setup instructions. The toolchain is pinned to Rust 1.92.0 with rustfmt and clippy enabled.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A new command hops forth so bright,
Shell completions done just right!
From bash to fish, each shell's a friend,
Arkouda's helpers now extend!
🌟✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding Rust toolchain pinning and shell completions support.
Description check ✅ Passed The description covers all required template sections: Summary (what and why), Changes (key files modified), and Test plan. All critical information is present.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/shell-completions

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 and usage tips.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/cli.rs`:
- Around line 117-129: The ValueEnum-derived Shell enum currently
lowercases/kebab-cases the PowerShell variant, causing the CLI to expect
"power-shell" instead of "powershell"; fix this by adding an explicit value name
on the PowerShell variant (annotate the PowerShell enum variant so ValueEnum
uses "powershell" as its canonical name), keeping the #[derive(ValueEnum)] on
Shell and leaving other variants unchanged so the completion command accepts
"powershell" as documented.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ffc6685a-b339-4783-acc0-eb7fa0fa5710

📥 Commits

Reviewing files that changed from the base of the PR and between f4ebf35 and cdbabc0.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • Cargo.toml
  • README.md
  • rust-toolchain.toml
  • src/cli.rs
  • src/commands/completions.rs
  • src/commands/mod.rs
  • src/main.rs
  • src/telemetry.rs

Comment thread src/cli.rs
The derived ValueEnum kebab-cased the variant to "power-shell", which
didn't match the documented "powershell". Pin the value name so the CLI
accepts "powershell" as shown in the README.
@manuelmauro
manuelmauro merged commit cb2bb49 into main Jun 12, 2026
2 checks passed
@manuelmauro manuelmauro mentioned this pull request Jun 12, 2026
5 tasks
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