Skip to content

Add 'templates' command to list bundled templates (discoverability for apply-template) #11

@renezander030

Description

@renezander030

Summary

capcut-cli ships several bundled templates (templates/*.jsoncaption-pop, lower-third, hook-question, gold-title, end-card, subscribe-cta) and supports apply-template / save-template. But there's no way to list the available templates from the CLI — a user has to read the repo to discover what they can apply. A capcut templates command would close that loop.

What to do

Add a templates command that lists template slugs the CLI can resolve, so apply-template is discoverable:

$ capcut templates
caption-pop    word-highlight pop captions
lower-third    name/title lower third
hook-question  opening hook question card
gold-title     gold title card
end-card       end / outro card
subscribe-cta  subscribe call-to-action
  • List the bundled templates (resolve the shipped templates/ dir relative to cliDir, the same way apply-template locates them).
  • Honor the global --json default convention used by the other inspect commands (machine-readable JSON unless -H/--human) so agents can enumerate templates programmatically.
  • A one-line description per template is a nice-to-have (can be derived from the slug if no metadata exists).

Acceptance

  • capcut templates lists every template apply-template can resolve.
  • capcut templates -H prints a human table; default output is JSON (consistent with info/tracks/etc.).
  • Add a test under test/ (*.test.mjs).
  • Documented in README.md / docs/.

Pointers (verified against master)

  • Single entry point src/index.ts; commands like enums/doctor are handled with early if (cmd === "…") checks — follow that pattern.
  • Bundled templates live in templates/ at the package root; apply-template already resolves them via cliDir.
  • Zero runtime dependencies (Node >= 18).

Good first issue — mirrors the existing enums command, self-contained, immediately useful.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions