Added some Cobra CLI conventions to AGENTS.md
This commit is contained in:
@@ -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).
|
- Maintain write-route protections (allowlist and rate limiting).
|
||||||
- Keep storage behavior transparent for clients (compression is internal).
|
- Keep storage behavior transparent for clients (compression is internal).
|
||||||
- Add or update tests for behavior changes.
|
- 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.
|
||||||
|
|||||||
Reference in New Issue
Block a user