Skip to content

Commands

Use with AI

This page

Ask ClaudeAsk ChatGPT

All of CaraCMS Docs

Connect once, and it answers your questions from this help.

Connect to ClaudeConnect to ChatGPT

Run these from the site’s root with npx caracms, or pnpm caracms in a pnpm site.

Command

What it does

caracms init

Adds CaraCMS to an Astro site, or brings a set-up site’s skills and schemas up to date. Without --write it prints what it would change and changes nothing.

caracms validate

Checks the content against the config. Exits with an error when there are problems.

caracms schemas

Writes schemas/ from the config.

caracms audit

Renders every page and lists what an editor can’t reach: words no field holds, and fields nothing on the page shows.

caracms media import

Puts local images into the site’s media.

caracms media push

Copies a standalone site’s images into CaraCMS Cloud.

caracms start

Serves the built site.

init

Terminal window
npx caracms init
npx caracms init --cloud --write
npx caracms init --self-hosted --railway --write

Flag

What it does

--write

Applies the change. It needs a clean git tree.

--cloud or --self-hosted

Says where the site runs, and writes it into the config. In a terminal, init asks if you leave it out. A flag that disagrees with the config starts a move between the two.

--railway

Also writes a Railway setup, when the site has none.

Run init again after every upgrade. It refreshes the skills and asks nothing.

validate

Terminal window
npx caracms validate
npx caracms validate --fix
npx caracms validate --json

With --fix it runs schemas first, then lays each content file out the way the editor saves it. Only whitespace changes.

media import

Terminal window
npx caracms media import photos/team.jpg photos/office.jpg

It uploads each file and prints its key and size, ready to use in a content file. On CaraCMS Cloud it needs the site’s key; standalone, the media bucket’s variables.

start

Terminal window
npx caracms start

This is the site’s start script. It serves the built site and works out each visitor’s IP for the limits on signing in, forms and downloads. A site started any other way refuses those routes.