CLI

CLI

Search and add items, run a linked session from a terminal, and publish a catalog.

Running it

Nothing to install. Every command runs on plain Node 20+ and already points at this registry.

npx ctlgs@latest --help

On most commands

--dir <path>
Which project directory to work in. Defaults to the current one.
--api <url>
Point at a different server. The default already reaches Catalogs, so you should not need it.

Find and add

add

Write an item's files into your project. Repeatable.

npx ctlgs@latest add <team>/<item>...
--force
Overwrite files that already exist.
--dest <path>
Put the files here, relative to --dir, keeping their layout. Skips the where-to prompt.
--target <id>
Request a delivery target, applied to every item in the command.
--draft
Install the team's draft version. Team members only.

It writes files and stops. Follow-up steps are printed, never run.

item-files

Print an item's files and integration plan as JSON. Writes nothing to disk.

npx ctlgs@latest item-files <team>/<item>...
--json
Accepted for stability in scripts. JSON is the only output.
--guides <id>
Also fetch conditional guides by id, from a previous result's guides.index. Repeatable or comma-separated.

Linked sessions

Everything getting started does, driven from a terminal. Any agent that can run a shell command can use these, MCP or no MCP: plain commands, JSON out, exit codes.

Publishing

For teams publishing their work. Catalog manifests describe the work; item files contain it. Nothing in this group ever deletes except remove.

init

Set up catalog manifests in this project. Uses published records by default, or saved draft changes with --draft.

npx ctlgs@latest init
--team <slug>
Select one of your account's teams.
--collections <slugs>
Set up manifests for these comma-separated collections.
--whole-catalog
Set up manifests for the team's entire catalog.
--draft
Read saved draft changes, including draft-only records.
--live
Explicitly select the published version (the default).
--force
Allow reinitializing an existing root manifest.

Initial live setup after claiming includes saved readmes and guides referenced by the selected manifests. Catalogs-hosted items also receive prepared item files; self-hosted items receive documentation only. Later setup, draft init, and every pull remain manifest-only. Manage documentation and source code through your project and version control after initial setup.

validate

Check the catalog locally: schema, path safety, references.

npx ctlgs@latest validate

status

Compare catalog manifests with the published version. Read-only.

npx ctlgs@latest status
--draft
Compare against saved draft changes.
--live
Explicitly compare against the published version (the default).

publish

Push listings and content up. Never deletes.

npx ctlgs@latest publish
--draft
Publish changed items as team-only drafts, without changing live.
--listings-only
Metadata records only. Leave content alone.
--content-only
Content only. Skip metadata.
--restore <type>/<slug>
Re-push a record the platform has deleted. Without it, deleted keys are refused. Repeatable.

promote-draft

Make an item's draft the live version.

npx ctlgs@latest promote-draft <team>/<item>

discard-draft

Drop an item's draft without changing live.

npx ctlgs@latest discard-draft <team>/<item>

pull

Update catalog manifests from the published version. Item files stay untouched.

npx ctlgs@latest pull [<type>/<slug>]
--draft
Pull saved draft manifest changes.
--live
Explicitly pull the published version (the default).
--collections <slugs>
Include missing manifest records in these collections.
--whole-catalog
Include all manifest records for the team.
--fields <a,b>
Take only these fields from the platform copy and keep the rest local. Needs a record address.
--dry-run
Print the plan without writing anything.

remove

Delete a record from the platform. The only command that deletes anything.

npx ctlgs@latest remove <type>/<slug>
--local
Also delete the local manifest record. Refused when it would leave the manifests invalid.
--dry-run
Print the plan without deleting anything.

preview replace

Replace an item's previews with these files, in display order. The first is the featured media.

npx ctlgs@latest preview replace <team>/<item> <files...>

png, jpeg, webp, gif, mp4, or webm. Originals accepted up to 20 MiB per image and 200 MiB per video; the platform fits and stores them smaller. No count limit.

preview clear

Remove all previews from an item.

npx ctlgs@latest preview clear <team>/<item>

preview optimize

Re-encode media on this machine to fit the upload caps. Runs your local ffmpeg.

npx ctlgs@latest preview optimize <files...>
--out <path>
Write here instead of alongside each source file.
--stage
Compose onto the 16:10 stage, for portrait or simulator recordings.

preview kit

Scaffold an editable capture kit an agent can drive.

npx ctlgs@latest preview kit <dir>
--force
Overwrite an existing, non-empty directory.

shadcn registries

For teams who already ship a shadcn registry and want to keep it.

shadcn convert

Bring a shadcn registry's components into your catalog as items. Files are referenced in place, never copied.

npx ctlgs@latest shadcn convert <registry.json>
--suffix <text>
Suffix every converted slug, so two parallel registries of the same components can share one catalog.
--split
Write new items as catalog/items/<slug>.item.yaml and add the matching glob.

Re-running syncs new registry changes and never touches what you enriched.

shadcn build

Generate a self-hostable shadcn registry back out of your catalog, using the same emit the hosted endpoint serves.

npx ctlgs@latest shadcn build
--out <path>
Output directory. Defaults to public/r.
--target <id>
Include only items declaring this delivery target. Repeatable. Items with no targets always ride along.
--homepage <url>
The homepage written into registry.json.

shadcn diff

Report field-level drift between the catalog and a registry file. Read-only, and exits nonzero on drift.

npx ctlgs@latest shadcn diff <registry.json>
--target <id>
Compare only items declaring this delivery target.

Account

login

Sign in through the browser.

npx ctlgs@latest login
--token <token>
Store an existing platform token instead.

Sessions are kept per registry, so signing into one never overwrites another.

logout

Forget the stored session for the active registry.

npx ctlgs@latest logout

whoami

Show who the platform thinks you are.

npx ctlgs@latest whoami

Editor and settings

mcp

Run the Catalogs MCP server over stdio, for a local or offline setup.

npx ctlgs@latest mcp

The hosted server on getting started needs none of this.

mcp init

Onboard detected user-level coding harnesses. Merges in place and is safe to re-run.

npx ctlgs@latest mcp init
--client <name>
Which MCP client(s) to configure, repeatable. User: claude, cursor, codex, claude-desktop. Project: claude, cursor, vscode.
--project
Use project scope instead of user-level scope.
--allow-permissions
Allow Catalogs MCP tools in Claude Code without per-call prompts.
--dry-run
Show user-level changes without writing them.

mcp remove

Remove user-level Catalogs MCP setup, or use --project to remove project config entries.

npx ctlgs@latest mcp remove
--project
Use project scope instead of user-level scope.
--dry-run
Show user-level changes without writing them.

config

Show where the CLI and editor tools point, and why.

npx ctlgs@latest config

config set

Store a setting. Keys: api-url, site-url, pick-flow.

npx ctlgs@latest config set <key> <value>

Rarely needed. The CLI already points at Catalogs, and setting api-url wrong sends you somewhere else.

config unset

Clear a setting and go back to the default.

npx ctlgs@latest config unset <key>

Connecting an agent to the hosted server instead is on getting started.