Step 22: Shell completion docs for bash, zsh, fish.

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) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 11:10:28 -07:00
parent d2bba75365
commit c00d9c65c3
3 changed files with 20 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ ARCHITECTURE.md for design details.
## Current Status ## Current Status
**Phase:** Phase 4 in progress. Step 21 complete, ready for Step 22. **Phase:** Phase 4 in progress. Steps 2122 complete, ready for Step 23.
**Last updated:** 2026-03-24 **Last updated:** 2026-03-24
@@ -42,7 +42,7 @@ ARCHITECTURE.md for design details.
## Up Next ## Up Next
Step 22: Shell Completion. Step 23: TLS Transport for sgardd.
## Known Issues / Decisions Deferred ## 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 | — | Locked files + dir-only entries. v2.0.0 released. |
| 2026-03-24 | — | Phase 4 planned (Steps 2127): lock/unlock, shell completion, TLS, DEK rotation, real FIDO2, test cleanup. | | 2026-03-24 | — | Phase 4 planned (Steps 2127): 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 | 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. |

View File

@@ -232,8 +232,8 @@ Depends on Steps 17, 18.
### Step 22: Shell Completion ### Step 22: Shell Completion
- [ ] `cmd/sgard/completion.go`: cobra's built-in completion for bash, zsh, fish - [x] Cobra provides built-in `sgard completion` for bash, zsh, fish, powershell — no code needed
- [ ] Update README with completion installation instructions - [x] README updated with shell completion installation instructions
### Step 23: TLS Transport for sgardd ### Step 23: TLS Transport for sgardd

View File

@@ -41,6 +41,21 @@ in your packages.
Binaries are also available on the Binaries are also available on the
[releases page](https://github.com/kisom/sgard/releases). [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 ## Quick start
```sh ```sh