Platform CLI
Learn
Developer docs User guide Quickstart CLI and AI agents Blog
Company
Services About Contact Links Get started

CLI command reference

Updated

This page lists every command group in the raytha CLI and what each subcommand does. Each group and subcommand has --help with the exact flags, and raytha guide <topic> has the longer explanation. Install and connect first: The Raytha CLI.

Global flags

FlagMeaning
--url <URL>Site root. Overrides RAYTHA_URL.
--api-key <KEY>Administrator API key. Overrides RAYTHA_API_KEY.
--prettyIndent the JSON output.
--timeout <SECONDS>Request timeout, default 60.
--yesRequired by delete and purge commands.
--dry-runOn theme push and schema import: report, write nothing.
--all, --page <N>, --page-size <N>On list commands: fetch every page, or one page of a given size (default 50).

Flags that take JSON accept inline JSON, @path to read a file, or - for standard input.

Diagnostics and docs

CommandWhat it does
raytha doctorChecks the URL, the key, the server version, and which command groups the key may use.
raytha guide [topic]Prints the built-in docs: overview, build-a-site, themes, liquid, widgets, content-types, site-pages, media, functions, errors.
raytha checkRequests every public route (home, published views, items, site pages, an unknown path) and exits 6 if any fail. --types, --max-items, --no-items, --no-pages, --all.
raytha spec [--summary] [--path text]Lists the site's live OpenAPI operations, for anything the curated commands do not cover.
raytha task get|wait <id>Background jobs started by theme duplicate, theme match-templates and content import.

Themes

CommandWhat it does
theme list, getList themes (isActive marks the live one) or get one by developer name.
theme create, edit, deleteCreate an empty theme, edit title or description, delete (the active theme cannot be deleted).
theme pull <theme> <dir>Download a theme into a directory of plain files: theme.json, web-templates/, widget-templates/, media/.
theme push <dir>Sync a directory up. Creates or updates; --dry-run, --activate, --prune, --theme other, --no-media, --replace-media.
theme activateMake a theme the one the public site renders with.
theme duplicate <src> <new> [--wait]Copy templates, widget templates, media and view bindings under a new name.
theme match-templates <theme>Tell Raytha which template of this theme replaces each template of the active theme.
theme usage <theme> [--template NAME | --unused]Which views, items, site pages and child templates use each web template.
theme media list|upload|deleteTheme media: images, CSS and JS referenced by templates.

Templates and widgets

CommandWhat it does
web-template list|get|create|edit|deleteLayouts and page templates in Liquid. edit keeps omitted values; --content-types and --allow-new-content-types control access.
web-template validate --file x.liquidCheck Liquid syntax on the server without saving. Errors carry line and column.
web-template preview <theme> <name> --view <id> | --content-item <id>Render a template on the server with real data and return the HTML, without publishing.
widget-template list|get|create|edit|deleteReusable blocks with a settings form. create takes a Liquid file and a field list.
widget-template field-typesThe field types a widget's settings form can use.

Site pages

CommandWhat it does
site-page list [--full], get <id>List pages (compact by default) or get one with its sections and widgets.
site-page create --title T --template X [--route-path p] [--sections JSON] [--home]Create a page, optionally with its route, widgets and home-page flag in one step.
site-page edit, settingsChange title or template; change the URL path.
site-page sections <id> --sections JSON [--replace] [--publish]Replace or add whole sections of widgets. Saved to the draft unless --publish.
site-page widgets save|edit|deleteReplace all widgets in one section, change one widget's settings, or remove one widget.
site-page publish, unpublish, discard-draft, set-home, deleteLifecycle.
site-page widget-definitionsWidget types usable in the active theme, with their settings fields.

Content model

CommandWhat it does
content-type list|get|create|edit|deleteContent types. create starts with title and content fields and a public list view.
content-type fields create|edit|delete|reorderFields: --type, --label, --required, --choices, --related-content-type, --sub-fields for repeaters. content-type get lists them.
content-type field-typesThe field types a content type field can use.
content-type views list|get|create|delete|set-homeViews: public filtered and sorted lists. list is compact; --full adds field definitions.
content-type views settings|filter|sort|sort-reordersettings sets publishing, URL path, template and page size; filter takes a JSON array of conditions ([] clears); sort sets a column's sort and visibility.
schema export [--out FILE] [--summary]Every content type with its fields, choices and views as one document.
schema import FILE [--dry-run]Create or update content types, fields, choices and views from an exported document.

Content

CommandWhat it does
content list <type>, get, get-by-pathItems of a content type, by id or by URL path.
content create <type> --data JSON [--template X] [--route-path p] [--draft]Create an item. @file:path values upload attachments.
content edit <type> <id> --data JSONEdit field values. Published unless --draft.
content import <type> --file rows.json|jsonlCreate many items in batches of 500; waits for the job and lists failed rows by index. Relationships resolve by id, route path or primary field value.
content publish, unpublish, discard-draft, settings, set-homeLifecycle, URL path and template, home page.
content assign-template <type> --template X [--all]Point items at one detail template of the active theme, after a theme switch.
content delete, delete-many, trash, restore, purgeTrash one or several items, list the trash, restore, or delete permanently.

Media, menus, functions, users

CommandWhat it does
media list|upload|get-url|deleteThe media library. upload returns the object key and URL.
menu list|get|create|edit|delete|set-mainNavigation menus. set-main chooses what get_main_menu() returns in Liquid.
menu items list|create|edit|delete|reorder <menu>Items: --label, --link, --parent for nesting, --new-tab, --disabled.
function list|get|create|edit|deleteRaytha Functions in JavaScript. create takes --trigger, --file and --route-path.
function revisions, revertEarlier versions of a function's code; restore one.
user list|get|create|edit|delete|password|set-activePublic users.
user-group list|get|create|edit|deletePublic user groups.

Next steps