genmedia-cli
AGENTS.md82 starsChanged 6 months agoMITView on GitHub
These instructions apply to the repository root unless a deeper AGENTS.md overrides them. The web/ app has its own guidance in web/AGENTS.md. Releases are driven by version tags (vX.Y.Z). Pushing a matching tag triggers .github/workflows/release.yml, which builds cross-platform binaries and publishes a GitHub Release with checksums. The workflow verifies package.json version matches the tag and fails the build on mismatch.
- Commits and pushes
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 32,671 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository4 other files it gives its agents.
- web/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- web/CLAUDE.mdCLAUDE.md
- genmediaSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
19 rules. About 0 are common, 11 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Keep changes small and focused.
- Distinctive: line 19
Prefer updating shared helpers over duplicating logic across commands.
- Very specific: line 20
Use bun for repo scripts and local execution.
- Distinctive: line 21
Follow Biome formatting conventions already present in the codebase.
- Very specific: line 27
Put shared request or parsing logic in src/lib/ when it is used by more than one command.
- Distinctive: line 28
Prefer descriptive argument names that match the public CLI surface.
- Very specific: line 34
Prefer output(), outputRawJson(), error(), isJsonOutput(), and related helpers from src/lib/output.ts instead of ad hoc console.log …
- Distinctive: line 35
Only write custom pretty-mode terminal output when the command needs a richer TTY presentation.
- Distinctive: line 36
Avoid adding interactive prompts to non-interactive commands.
- Distinctive: line 41
Keep environment-variable behavior documented and consistent with help text and README examples.
- Very specific: line 42
When changing command behavior, update the JSON help schema in src/index.ts if the public interface changes.
- Very specific: line 46
All update logic lives in src/lib/updater.ts.
- Very specific: line 51
Treat each directory in skills/ as a published bundle.
- Very specific: line 52
If you add or modify bundled skills, regenerate or verify skills/index.json with bun run skills:index or bun run skills:index:check.
- Very specific: line 53
Keep skill names, descriptions, and directory names in sync with SKILL.md frontmatter.
- Distinctive: line 57
Prefer the smallest useful validation first.
- Distinctive: line 63
Run broader build validation when changing packaging, generated artifacts, or command registration.
- Distinctive: line 67
Update README.md when adding commands, flags, environment variables, install behavior, or agent workflow changes.
- Distinctive: line 68
Keep examples aligned with the actual CLI output and command names.
≈ “Common” is an estimate: at least 1 in 5 of the 41,581 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
genmedia CLI agent guide
Scope
These instructions apply to the repository root unless a deeper AGENTS.md overrides them. The web/ app has its own guidance in web/AGENTS.md.
Repository shape
src/index.tsis the CLI entrypoint and lazy-loads subcommands.src/commands/contains one file per command or command group.src/lib/contains shared runtime helpers for config, API access, output, and UI.skills/contains bundled skills.skills/index.jsonis generated from those directories.scripts/contains build and maintenance scripts.web/is a separate app with additional rules.
Working conventions
- Keep changes small and focused. Match the existing TypeScript + ESM style.
- Prefer updating shared helpers over duplicating logic across commands.
- Use
bunfor repo scripts and local execution. Do not introducenpmorpnpmworkflows here unless the repo already requires them. - Follow Biome formatting conventions already present in the codebase.
CLI command conventions
- Define commands with
defineCommandfromcitty. - Register new top-level commands in
src/index.tsusing the existing lazy-import pattern. - Put shared request or parsing logic in
src/lib/when it is used by more than one command. - Prefer descriptive argument names that match the public CLI surface.
- Preserve existing aliases and compatibility behavior unless the task explicitly changes them.
Output and UX
- This CLI is agent-first: preserve structured JSON output for
--jsonand non-TTY usage. - Prefer
output(),outputRawJson(),error(),isJsonOutput(), and related helpers fromsrc/lib/output.tsinstead of ad hocconsole.loghandling. - Only write custom pretty-mode terminal output when the command needs a richer TTY presentation.
- Avoid adding interactive prompts to non-interactive commands.
API and config
- Reuse helpers from
src/lib/api.ts,src/lib/config.ts, andsrc/lib/env.tsinstead of reimplementing headers, auth, or config loading. - Keep environment-variable behavior documented and consistent with help text and README examples.
- When changing command behavior, update the JSON help schema in
src/index.tsif the public interface changes.
Self-update
- All update logic lives in
src/lib/updater.ts. Theupdatecommand and the background check insrc/index.tsboth go through it — don't reimplement download/checksum/swap logic elsewhere. - Startup in
src/index.tsrunspreSwapPendingUpdate()first (atomic swap of a staged.newbinary) and may firemaybeTriggerBackgroundUpdate()(detached subprocess, rate-limited to once per hour, TTY-only). RespectGENMEDIA_NO_UPDATE=1andconfig.autoUpdatein any update-related code.
Skills
- Treat each directory in
skills/as a published bundle. - If you add or modify bundled skills, regenerate or verify
skills/index.jsonwithbun run skills:indexorbun run skills:index:check. - Keep skill names, descriptions, and directory names in sync with
SKILL.mdfrontmatter.
Validation
- Prefer the smallest useful validation first.
- Common checks:
bun run typecheckbun run checkbun run buildbun run skills:index:checkwhen touchingskills/
- Run broader build validation when changing packaging, generated artifacts, or command registration.
Documentation
- Update
README.mdwhen adding commands, flags, environment variables, install behavior, or agent workflow changes. - Keep examples aligned with the actual CLI output and command names.
Releasing
Releases are driven by version tags (vX.Y.Z). Pushing a matching tag triggers .github/workflows/release.yml, which builds cross-platform binaries and publishes a GitHub Release with checksums. The workflow verifies package.json version matches the tag and fails the build on mismatch.
Steps:
- Bump
versioninpackage.jsonto the newX.Y.Z. - Commit with
chore: X.Y.Z release. - Push
main:git push origin main. - Tag and push:
git tag vX.Y.Z && git push origin vX.Y.Z.
Pre-release versions (e.g. 0.4.0-alpha.0) are auto-detected from the version string and marked as pre-release on GitHub.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

