main.go: CLI entrypoint; embedsSKILL.mdandagents/openai.yaml, injects build metadata intointernal/version.cmd/: Cobra commands (root,version,plugin,init,update,completion,install skill,skills).internal/: non-exported packages:plugin/for plugin discovery/exec + manifest handling (~/.clime/plugins.yaml).installer/for plugin install/update/uninstall across sources (GitHub, npm, Homebrew, script).skill/for AI agent skill install/uninstall + manifest handling (~/.clime/skills.yaml).selfupdate/for CLI self-update flow.githubrelease/shared GitHub release fetch/extract helpers.prompt/for interactive terminal prompts (select, input, multiselect).version/build/version string formatting.
scripts/install.sh: installer used for release-based bootstrap..github/workflows/: CI (go vet,go test,go build) and tagged release via GoReleaser.
make build: builds./climewith ldflags metadata.make install: installs viago installand runsclime init.make test: runsgo test ./... -v.make lint: runsgo vet ./....make clean: removes localclimebinary.- Quick local run:
go run . versionorgo run . update --help.
- Language: Go (
go 1.25pergo.mod). - Formatting: always run
gofmt -won changed Go files. - Keep packages small and single-purpose under
internal/. - File and package names should be lowercase; command files in
cmd/should map to subcommands (for example,update.go->clime update). - Error messages should wrap context (
fmt.Errorf("...: %w", err)). - Log messages must start with a capital letter.
- Use meaningful, descriptive names for variables, functions, and structs; avoid meaningless abbreviations or short names.
- Design carefully when creating new commands, including command API and member function signatures (name, parameters, and return values).
- Keep functionality between commands orthogonal and clean.
- Avoid ad hoc helper functions; prioritize maintainable, well-structured code.
- Reuse existing structs (e.g.,
plugin.Plugin,plugin.UpdateOptions) for command flag bindings instead of declaring separate variables. Bind flags directly to struct fields.
- Framework: Go
testingpackage. - Place tests as
*_test.gonext to implementation files. - Prefer table-driven tests for parsing/matching logic.
- Run full suite before PR:
go test ./... -v(CI runs this plusgo vetand a build).
- This branch currently has no commit history; use Conventional Commit style for consistency:
feat: add self-update rollback checkfix(plugin): handle missing release assetdocs: update install notes
- Keep commits focused and logically scoped.
- PRs should include:
- purpose and behavior change summary,
- test evidence (command + result),
- linked issue/ticket when applicable,
- CLI output snippets for user-facing changes.
- Use
GITHUB_TOKENfor private repos or higher GitHub API limits. - Do not hardcode secrets; pass via environment variables.
- Validate downloaded release assets by exact binary name and OS/arch match.