You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(template): add search, get --raw, and help --all (#170)
## Summary
- Add `template get --raw` flag to export raw YAML spec from
`https://zeabur.com/templates/{code}.yaml`, so users can save, modify,
and redeploy templates
- Add `template search` command to filter templates by keyword
(name/description) and sort by deployment count
- Add `help --all` flag to print all commands and flags at once, making
it easy for AI agents to discover available CLI features
- Fix `template get` interactive prompt not being skipped when `--code`
flag is already provided
- Add `CLAUDE.md` with project conventions for AI-assisted development
## Usage
```bash
# Export raw YAML to a file
zeabur template get -c GSQQIJ --raw > my-template.yaml
# Search templates by keyword
zeabur template search wordpress
# Show all commands and flags
zeabur help --all
```
## Test plan
- [ ] `zeabur template get -c <code>` — shows table as before
- [ ] `zeabur template get -c <code> --raw` — outputs raw YAML
- [ ] `zeabur template search <keyword>` — filters and sorts by
deployment count
- [ ] `zeabur help --all` — prints all commands with flags
- [ ] `zeabur help` — default help still works
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added `--raw` to view templates as streamed raw YAML.
* Added template search to find and list templates by keyword.
* Replaced default help with a custom help command and new `--all`
option to print all commands and flags.
* **Usability**
* Template Code prompt now only appears when no code is provided.
* **Documentation**
* Added developer notes documenting project conventions and workflows.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
-`internal/cmd/root/root.go` — root command, registers all subcommands
15
+
16
+
## Important: Keep `help --all` in sync
17
+
When adding or modifying CLI commands, flags, or subcommands, the output of `zeabur help --all` automatically reflects changes (it walks the Cobra command tree at runtime). No manual update is needed for the help output itself.
18
+
19
+
However, when adding a **new subcommand**, you must:
20
+
1. Create the command package under `internal/cmd/<parent>/<new>/`
21
+
2. Register it in the parent command file (e.g., `internal/cmd/template/template.go`)
22
+
23
+
## Conventions
24
+
- Each subcommand lives in its own package: `internal/cmd/<parent>/<sub>/<sub>.go`
25
+
- Commands support both interactive and non-interactive modes; if a flag is provided, skip the interactive prompt
26
+
- Use `cmdutil.SpinnerCharSet`, `cmdutil.SpinnerInterval`, `cmdutil.SpinnerColor` for spinners
27
+
- Models in `pkg/model/` use `graphql:"fieldName"` struct tags — only add fields that exist in the backend GraphQL schema
28
+
- Backend GraphQL schema lives in `../backend/internal/gateway/graphql/`
0 commit comments