[PR #163] [MERGED] experiment(cli): evaluate clap dynamic completion #219

Closed
opened 2026-10-29 14:21:09 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/163
Author: @NickNYU
Created: 8/12/2026
Status: ✅ Merged
Merged: 8/21/2026
Merged by: @LSX-s-Software

Base: main ← Head: experiment/completion-clap-dynamic


📝 Commits (4)

  • d5a06cf Document the safe first slice of dynamic CLI completion
  • d505294 feat(cli): evaluate clap dynamic completion
  • e2527f8 fix(cli): refine dynamic sandbox completion
  • 044f945 fix(cli): emit dynamic completion registration script

📊 Changes

14 files changed (+188 additions, -34 deletions)

View changed files

📝 Cargo.lock (+21 -3)
📝 crates/aenv/Cargo.toml (+1 -1)
📝 crates/aenv/src/client/mod.rs (+16 -2)
📝 crates/aenv/src/commands/completion.rs (+138 -27)
📝 crates/aenv/src/commands/connect.rs (+1 -0)
📝 crates/aenv/src/commands/delete.rs (+1 -0)
📝 crates/aenv/src/commands/download.rs (+1 -0)
📝 crates/aenv/src/commands/exec.rs (+1 -0)
📝 crates/aenv/src/commands/pause.rs (+1 -0)
📝 crates/aenv/src/commands/resume.rs (+1 -0)
📝 crates/aenv/src/commands/snapshot.rs (+1 -0)
📝 crates/aenv/src/commands/timeout.rs (+1 -0)
📝 crates/aenv/src/commands/upload.rs (+1 -0)
📝 crates/aenv/src/main.rs (+3 -1)

📄 Description

Summary

This is one of two parallel experiments for #37. It evaluates clap_complete unstable-dynamic for dynamic sandbox-ID completion while preserving the existing static aenv completion bash|zsh|fish command.

What it adds

  • CompleteEnv shell adapter for Bash, Zsh, and Fish.
  • Dynamic candidates backed by the existing sandbox list API.
  • State-aware candidates for running, paused, and active sandbox IDs.
  • Short completion-specific network timeouts and silent failure behavior.
  • Focused tests and a design note.

Trade-off

This keeps the shell protocol small and shell-portable, but depends on clap_complete unstable-dynamic and its generated shell adapter contract. The companion PR proposes an AgentENV-owned aenv __complete protocol instead. These are alternatives; please review and choose one direction rather than merging both.

Verification

  • cargo fmt --all
  • cargo check -p aenv --bin aenv
  • cargo test -p aenv --bin aenv (56 passed; one pre-existing macOS /var symlink test failure in download tests)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/163 **Author:** [@NickNYU](https://github.com/NickNYU) **Created:** 8/12/2026 **Status:** ✅ Merged **Merged:** 8/21/2026 **Merged by:** [@LSX-s-Software](https://github.com/LSX-s-Software) **Base:** `main` ← **Head:** `experiment/completion-clap-dynamic` --- ### 📝 Commits (4) - [`d5a06cf`](https://github.com/kvcache-ai/AgentENV/commit/d5a06cf80390affb92dc0b605a033fdd9b20a703) Document the safe first slice of dynamic CLI completion - [`d505294`](https://github.com/kvcache-ai/AgentENV/commit/d50529490c3eea1b3b22f4ca67e3325d490e2f0d) feat(cli): evaluate clap dynamic completion - [`e2527f8`](https://github.com/kvcache-ai/AgentENV/commit/e2527f8a44afabc62dc3cf1287742482adb5f0fd) fix(cli): refine dynamic sandbox completion - [`044f945`](https://github.com/kvcache-ai/AgentENV/commit/044f945d902904dd07aa9ed7118630f094892e95) fix(cli): emit dynamic completion registration script ### 📊 Changes **14 files changed** (+188 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+21 -3) 📝 `crates/aenv/Cargo.toml` (+1 -1) 📝 `crates/aenv/src/client/mod.rs` (+16 -2) 📝 `crates/aenv/src/commands/completion.rs` (+138 -27) 📝 `crates/aenv/src/commands/connect.rs` (+1 -0) 📝 `crates/aenv/src/commands/delete.rs` (+1 -0) 📝 `crates/aenv/src/commands/download.rs` (+1 -0) 📝 `crates/aenv/src/commands/exec.rs` (+1 -0) 📝 `crates/aenv/src/commands/pause.rs` (+1 -0) 📝 `crates/aenv/src/commands/resume.rs` (+1 -0) 📝 `crates/aenv/src/commands/snapshot.rs` (+1 -0) 📝 `crates/aenv/src/commands/timeout.rs` (+1 -0) 📝 `crates/aenv/src/commands/upload.rs` (+1 -0) 📝 `crates/aenv/src/main.rs` (+3 -1) </details> ### 📄 Description ## Summary This is one of two parallel experiments for #37. It evaluates `clap_complete` `unstable-dynamic` for dynamic sandbox-ID completion while preserving the existing static `aenv completion bash|zsh|fish` command. ## What it adds - `CompleteEnv` shell adapter for Bash, Zsh, and Fish. - Dynamic candidates backed by the existing sandbox list API. - State-aware candidates for running, paused, and active sandbox IDs. - Short completion-specific network timeouts and silent failure behavior. - Focused tests and a design note. ## Trade-off This keeps the shell protocol small and shell-portable, but depends on `clap_complete` unstable-dynamic and its generated shell adapter contract. The companion PR proposes an AgentENV-owned `aenv __complete` protocol instead. These are alternatives; please review and choose one direction rather than merging both. ## Verification - `cargo fmt --all` - `cargo check -p aenv --bin aenv` - `cargo test -p aenv --bin aenv` (56 passed; one pre-existing macOS `/var` symlink test failure in download tests) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:21:09 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#219
No description provided.