[PR #115] [CLOSED] feat(cli): install shell completion loaders #192

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

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/115
Author: @rbalachandar
Created: 8/3/2026
Status: ❌ Closed

Base: main ← Head: feat/cli-completion-install


📝 Commits (10+)

  • 58ccd28 feat(cli): install completion loaders
  • 62a5bdb fix(cli): harden completion loader writes
  • e2402d0 fix(cli): validate completion install paths
  • dd2fb60 test(cli): expand completion installer coverage
  • 6bdfbb2 fix(cli): resolve completion installer review and merge current main
  • c302d25 test(cli): cover loader path rejection and installer hardening parity
  • fd22371 fix(cli): address round 2 review — XDG paths, canonicalize-before-validate, privileged lock routing, stale-lock recovery, locked removal, behavioral installer coverage
  • cfef452 test(cli): pin XDG env in default-path assertions (runner images set XDG_CONFIG_HOME)
  • 16a04af Update scripts/tests/verify-completion-install.sh
  • 2206827 Apply batched suggestions from code review

📊 Changes

7 files changed (+790 additions, -8 deletions)

View changed files

📝 .github/workflows/ci.yml (+21 -0)
📝 Makefile (+7 -0)
📝 docs/src/getting-started/aenv-cli.md (+15 -0)
📝 scripts/install-cli.sh (+193 -8)
➕ scripts/install-completions.sh (+235 -0)
📝 scripts/install.sh (+111 -0)
➕ scripts/tests/verify-completion-install.sh (+208 -0)

📄 Description

Follow-up to #89, which adds the aenv completion command and visible aliases. This PR is intentionally scoped to automatic installation and removal.

What it does

  • Installs lightweight Bash, Zsh, and Fish completion loaders into standard completion directories.
  • Uses the installed aenv binary path so loaders do not depend on an unrelated PATH binary.
  • Canonicalizes prefix and HOME paths before selecting user versus system mode.
  • Never modifies .bashrc, .zshrc, or Fish configuration files.
  • Leaves unmanaged completion files and symlink destinations untouched.
  • Atomically stages managed completion files in their destination directory and supports managed upgrades.
  • make uninstall-aenv removes only files owned by the completion installer.
  • Prints actionable Zsh fpath and compinit guidance for user-local installs.
  • Treats staging and filesystem failures as non-fatal warnings so a CLI install is not aborted by completion setup.

The standalone installers remain self-contained because they are distributed as curl | bash entrypoints; their small loader-writing snippets mirror the shared Make/test helper without the previous shell configuration manager or synchronization machinery.

Validation

  • bash -n for all installer and test scripts
  • ShellCheck for all installer and test scripts
  • bash scripts/tests/verify-completion-install.sh
  • make check-completion-install
  • Functional coverage includes loader syntax, 0644 modes, install, managed upgrade, unmanaged Bash/Zsh/Fish preservation, symlink preservation, path traversal classification, staging-failure cleanup, standard system paths, and uninstall.

This draft should be reviewed after #89 is merged, since the loaders invoke the completion command introduced there.


🔄 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/115 **Author:** [@rbalachandar](https://github.com/rbalachandar) **Created:** 8/3/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/cli-completion-install` --- ### 📝 Commits (10+) - [`58ccd28`](https://github.com/kvcache-ai/AgentENV/commit/58ccd28376e8325e61d74fdbb0dd8ffc6946eb50) feat(cli): install completion loaders - [`62a5bdb`](https://github.com/kvcache-ai/AgentENV/commit/62a5bdb452327cdb44299e5e634c691dd19208cf) fix(cli): harden completion loader writes - [`e2402d0`](https://github.com/kvcache-ai/AgentENV/commit/e2402d04d8c6a44eed9a819dcce53cd716efecda) fix(cli): validate completion install paths - [`dd2fb60`](https://github.com/kvcache-ai/AgentENV/commit/dd2fb6075bdb1432f9e98007f3a8eaee186a9281) test(cli): expand completion installer coverage - [`6bdfbb2`](https://github.com/kvcache-ai/AgentENV/commit/6bdfbb2025da73095bfa5a3ac10a8b00513cc884) fix(cli): resolve completion installer review and merge current main - [`c302d25`](https://github.com/kvcache-ai/AgentENV/commit/c302d25f6b2cefb5565c68541286ce55972c0cdd) test(cli): cover loader path rejection and installer hardening parity - [`fd22371`](https://github.com/kvcache-ai/AgentENV/commit/fd2237104163b05e2b5bc9eb6abbdc10df0758dc) fix(cli): address round 2 review — XDG paths, canonicalize-before-validate, privileged lock routing, stale-lock recovery, locked removal, behavioral installer coverage - [`cfef452`](https://github.com/kvcache-ai/AgentENV/commit/cfef4520d3fb69641cd494fe8af8b098d6206c6e) test(cli): pin XDG env in default-path assertions (runner images set XDG_CONFIG_HOME) - [`16a04af`](https://github.com/kvcache-ai/AgentENV/commit/16a04afe41cca15cb774f818f684b3fb04821422) Update scripts/tests/verify-completion-install.sh - [`2206827`](https://github.com/kvcache-ai/AgentENV/commit/2206827f8d9ddb44a541412eaaf1a9036cc065f0) Apply batched suggestions from code review ### 📊 Changes **7 files changed** (+790 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+21 -0) 📝 `Makefile` (+7 -0) 📝 `docs/src/getting-started/aenv-cli.md` (+15 -0) 📝 `scripts/install-cli.sh` (+193 -8) ➕ `scripts/install-completions.sh` (+235 -0) 📝 `scripts/install.sh` (+111 -0) ➕ `scripts/tests/verify-completion-install.sh` (+208 -0) </details> ### 📄 Description Follow-up to #89, which adds the `aenv completion` command and visible aliases. This PR is intentionally scoped to automatic installation and removal. ## What it does - Installs lightweight Bash, Zsh, and Fish completion loaders into standard completion directories. - Uses the installed `aenv` binary path so loaders do not depend on an unrelated PATH binary. - Canonicalizes prefix and HOME paths before selecting user versus system mode. - Never modifies `.bashrc`, `.zshrc`, or Fish configuration files. - Leaves unmanaged completion files and symlink destinations untouched. - Atomically stages managed completion files in their destination directory and supports managed upgrades. - `make uninstall-aenv` removes only files owned by the completion installer. - Prints actionable Zsh `fpath` and `compinit` guidance for user-local installs. - Treats staging and filesystem failures as non-fatal warnings so a CLI install is not aborted by completion setup. The standalone installers remain self-contained because they are distributed as `curl | bash` entrypoints; their small loader-writing snippets mirror the shared Make/test helper without the previous shell configuration manager or synchronization machinery. ## Validation - `bash -n` for all installer and test scripts - ShellCheck for all installer and test scripts - `bash scripts/tests/verify-completion-install.sh` - `make check-completion-install` - Functional coverage includes loader syntax, 0644 modes, install, managed upgrade, unmanaged Bash/Zsh/Fish preservation, symlink preservation, path traversal classification, staging-failure cleanup, standard system paths, and uninstall. This draft should be reviewed after #89 is merged, since the loaders invoke the completion command introduced there. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:20:50 +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#192
No description provided.