Strapi CLI
$ strapi Official Med RiskStrapi CLI (strapi, bundled in @strapi/strapi) orchestrates local Strapi CMS development (develop), production admin builds (build), TypeScript schema generation (ts:generate-types), and data export/import/transfer. Built around project-local Node.js execution rather than stateless API queries.
npm install @strapi/strapi strapi compiles the local React admin bundle, watches local content-type schemas, and writes generated TypeScript definitions directly to ./types/.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Project-bound CLI focused on dev server, builds, and generators; lacks global --json output and uses interactive prompts on generate.
- No global
--jsonoutput mode acrossstrapisubcommands strapi generaterelies on interactive Inquirer prompts
Diagnostic and build commands are local, while import/transfer require explicit --force or token flags when overwriting databases.
- Local schema typegen and
routes:listdo not mutate remote state
Bundled with @strapi/strapi via npm/npx across macOS, Linux, and Windows, but requires a full Node.js project.
- Runs via
npx strapiinside@strapi/strapiprojects
Essential for Strapi builds, ts:generate-types, route inspection, and encrypted data export/transfer.
- Covers
develop,build,ts:generate-types, andexport/transfer
Official Strapi monorepo (strapi/strapi) with MIT Community Edition and commercial ee/ enterprise modules.
- Official Strapi repository
Documented in Strapi CLI reference, though exact flags vary between Strapi v4 and v5.
- Official docs at
docs.strapi.io/cms/cli
Security, Auth & Guardrails
Reads database and app secrets from project .env and config/ files; strapi transfer uses transfer tokens passed via --to-token / --from-token or prompts.
MIT open-source Community Edition; Enterprise features and Strapi Cloud are commercially licensed.
# Strapi CLI (strapi) Agent Rules - Run `npx strapi` inside a valid Strapi project root; avoid long-running `strapi develop` without a background task. - Never run `strapi import` or `strapi transfer` against a production database without explicit backup confirmation. - Pass explicit flags to `strapi admin:create-user` or `strapi export` to avoid interactive prompts.
Agent-Ready Command Recipes
Safe Read-Only Queries
npx strapi routes:list
Prints all REST API routes registered by content-types and plugins in the local Strapi project.
npx strapi ts:generate-types --debug
Writes TypeScript interfaces for local Strapi content-types and components into types/.
Controlled Writes & Previews
npx strapi build
Compiles the Strapi admin UI bundle into dist//build/ without starting a long-running server.
Strengths for Agents
- +
ts:generate-typesandroutes:listgive coding agents immediate visibility into local CMS schemas and endpoints. - + Built-in
export/import/transfercommands simplify moving content across environments.
Caveats & Pitfalls
- ! Not a standalone global SaaS API CLI; must be invoked inside a Strapi project directory.
- ! Lacks global
--jsonoutput, andstrapi generate/create-strapidefault to interactive prompts.