Skip to content

feat(template): support agk template remove by name#19

Open
kunalkushwaha wants to merge 1 commit into
mainfrom
feat/template-remove-by-name
Open

feat(template): support agk template remove by name#19
kunalkushwaha wants to merge 1 commit into
mainfrom
feat/template-remove-by-name

Conversation

@kunalkushwaha

Copy link
Copy Markdown
Member

What

agk template remove previously only accepted the full source path; passing a manifest name like rag-agent failed. This was a documented TODO in cmd/template.go. Now you can remove a cached template by its name.

This is feature A3 from the FEATURES.md roadmap.

Changes

  • CacheManager.FindByName(ref) / RemoveByName(ref) — match cached templates by manifest name or source, removing all cached versions and reporting how many were removed.
  • template remove <ref> tries the name/source lookup first, then falls back to source-path removal, with a clear template "<ref>" not found in cache error.

Before / After

$ agk template remove rag-agent
# before: error (only the full source path worked)
# after:  Removed template: rag-agent (1 cached version(s))

Testing

  • go build, go vet, go test ./..., gofmt all green.
  • Adds the registry package's first unit tests (FindByName by name and by source, multi-version RemoveByName, not-found).
  • Verified end-to-end with an isolated HOME: list → remove by name → empty, plus the not-found error path.

Independent branch off main; does not touch README (so it won't conflict with the other open PRs).

🤖 Generated with Claude Code

Previously `template remove` only accepted the full source path; passing a
manifest name (e.g. "rag-agent") failed. This was a documented TODO.

- Add CacheManager.FindByName / RemoveByName: match cached templates by
  manifest name or source, removing all cached versions.
- `template remove <ref>` now tries name/source lookup first, then falls back
  to source-path removal, with a clear "not found" error.
- Adds the registry package's first unit tests (find/remove/not-found).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant