From c50388a38c2320fd7608b57ad697a05ac96d9b91 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Sun, 31 May 2026 17:09:53 -0500 Subject: [PATCH] Added some Cobra CLI conventions to AGENTS.md --- AGENTS.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index ea30f49..110808d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -39,3 +39,10 @@ Use `make help` as the source of truth for available build/test targets and desc - Maintain write-route protections (allowlist and rate limiting). - Keep storage behavior transparent for clients (compression is internal). - Add or update tests for behavior changes. + +## Cobra CLI conventions + +- Keep `cmd/pastebin/main.go` focused on `main()` and root command wiring. +- Put each Cobra subcommand in its own file (for example `cmd/pastebin/server.go`). +- Start the service through the explicit subcommand (`scratchbox server`), not from the root command directly. +- Validate command arguments with Cobra arg validators (for example `cobra.NoArgs`) where applicable.