From c00d9c65c3833553b3b9f580e9b075397ac4456a Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Tue, 24 Mar 2026 11:10:28 -0700 Subject: [PATCH] Step 22: Shell completion docs for bash, zsh, fish. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cobra provides built-in sgard completion subcommand — no additional code needed. README updated with installation instructions for each shell. Co-Authored-By: Claude Opus 4.6 (1M context) --- PROGRESS.md | 5 +++-- PROJECT_PLAN.md | 4 ++-- README.md | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/PROGRESS.md b/PROGRESS.md index 9f5877a..6d1fbf7 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -7,7 +7,7 @@ ARCHITECTURE.md for design details. ## Current Status -**Phase:** Phase 4 in progress. Step 21 complete, ready for Step 22. +**Phase:** Phase 4 in progress. Steps 21–22 complete, ready for Step 23. **Last updated:** 2026-03-24 @@ -42,7 +42,7 @@ ARCHITECTURE.md for design details. ## Up Next -Step 22: Shell Completion. +Step 23: TLS Transport for sgardd. ## Known Issues / Decisions Deferred @@ -85,3 +85,4 @@ Step 22: Shell Completion. | 2026-03-24 | — | Locked files + dir-only entries. v2.0.0 released. | | 2026-03-24 | — | Phase 4 planned (Steps 21–27): lock/unlock, shell completion, TLS, DEK rotation, real FIDO2, test cleanup. | | 2026-03-24 | 21 | Lock/unlock toggle commands. garden/lock.go, cmd/sgard/lock.go, 6 tests. | +| 2026-03-24 | 22 | Shell completion: cobra built-in, README docs for bash/zsh/fish. | diff --git a/PROJECT_PLAN.md b/PROJECT_PLAN.md index 2202e62..03de787 100644 --- a/PROJECT_PLAN.md +++ b/PROJECT_PLAN.md @@ -232,8 +232,8 @@ Depends on Steps 17, 18. ### Step 22: Shell Completion -- [ ] `cmd/sgard/completion.go`: cobra's built-in completion for bash, zsh, fish -- [ ] Update README with completion installation instructions +- [x] Cobra provides built-in `sgard completion` for bash, zsh, fish, powershell — no code needed +- [x] README updated with shell completion installation instructions ### Step 23: TLS Transport for sgardd diff --git a/README.md b/README.md index 4cc53d8..f79a3df 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,21 @@ in your packages. Binaries are also available on the [releases page](https://github.com/kisom/sgard/releases). +### Shell completion + +```sh +# Bash (add to ~/.bashrc) +source <(sgard completion bash) + +# Zsh (add to ~/.zshrc) +source <(sgard completion zsh) + +# Fish +sgard completion fish | source +# To load on startup: +sgard completion fish > ~/.config/fish/completions/sgard.fish +``` + ## Quick start ```sh