The CLI
Introduction
'Read the “', Introduction, '” section'The StudioCMS CLIs are utilities that allow you to quickly scaffold new StudioCMS projects and expose useful utilities for StudioCMS.
There is two different CLIs that are part of the StudioCMS ecosystem:
create-studiocms
: The StudioCMS project scaffolding CLI.studiocms
: The StudioCMS utility CLI.
The following is a breakdown of the StudioCMS CLI and its components.
create-studiocms
'Read the “', create-studiocms, '” section'Installation
'Read the “', Installation, '” section'npm create studiocms@latest
pnpm create studiocms
yarn create studiocms
create-studiocms
automatically runs in interactive mode, but you can also specify your project name and template with command line arguments.
npm create studiocms@latest -- --template studiocms/basics --project-name my-studiocms-project
pnpm create studiocms --template studiocms/basics --project-name my-studiocms-project
yarn create studiocms --template studiocms/basics --project-name my-studiocms-project
Check out the full list^ of templates, available on GitHub.
When using --template
, the CLI searches the templates repository for all folders. For example, the studiocms/basics
template points to the basics
project within the studiocms
folder at the root of the repository.
Full CLI Options and commands
'Read the “', Full CLI Options and commands, '” section'Main Entrypoint
'Read the “', Main Entrypoint, '” section'Usage: create-studiocms [options] [command]
Options: -V, --version Output the current version of the CLI Toolkit. -h, --help display help for command --color force color output --no-color disable color output
Commands: get-turso Get the latest version of Turso. help Show help for command interactive* Start the interactive CLI.
* Indicates the default command that is run when calling this CLI.
get-turso
'Read the “', get-turso, '” section'You can download and install the latest version of Turso using the script from Turso’s documentation^.
Usage: getTurso [options]
Turso CLI Installer
Options: -h, --help display help for command
Interactive (Default command)
'Read the “', Interactive (Default command), '” section'Usage: create-studiocms interactive [options]
Start the interactive CLI. Powered by [clack](https://clack.cc).
This command will open an interactive CLI prompt to guide you throughthe process of creating a new StudioCMS(or StudioCMS Ecosystem package)project using one of the available templates.
Options: -t, --template <template> The template to use. -r, --template-ref <template-ref> The template reference to use. -p, --project-name <project-name> The name of the project. -i, --install Install dependencies. -g, --git Initialize a git repository. -y, --yes Skip all prompts and use default values. -n, --no Skip all prompts and use default values. -q, --skip-banners Skip all banners and messages. -d, --dry-run Do not perform any actions. -h, --help display help for command --do-not-install Do not install dependencies. --do-not-init-git Do not initializing a git repository.
studiocms
'Read the “', studiocms, '” section'Full CLI Options and commands
'Read the “', Full CLI Options and commands, '” section'Main Entrypoint
'Read the “', Main Entrypoint, '” section'Usage: studiocms [options] [command]
Options: -V, --version Output the current version of the CLI Toolkit. -h, --help display help for command --color force color output --no-color disable color output
Commands: get-turso Get the latest version of Turso. help Show help for command init Initialization Tools.
get-turso
'Read the “', get-turso, '” section'Downloads and installs the latest version of Turso using the script from Turso’s documentation^
Usage: getTurso [options]
Turso CLI Installer
Options: -h, --help display help for command
Usage: studiocms init [options]
Initialize the StudioCMS project after new installation.
Options: -d, --dry-run Dry run mode --skip-banners Skip all banners --debug Enable debug mode -h, --help Display help for command
The init command provides an interactive setup experience that helps you:
-
Set up your environment file (.env) with options to:
- Use an example
.env
template - Use the interactive
.env
builder which can:- Set up a new Turso database (if not on Windows)
- Configure OAuth providers (GitHub, Discord, Google, Auth0)
- Set encryption keys and other required variables
- Skip environment file creation
- Use an example
-
The command includes automatic Turso CLI installation and authentication if needed when setting up a database.
Environment Variables
'Read the “', Environment Variables, '” section'StudioCMS requires several environment variables to be configured. Here are the key variables:
# Database ConfigurationASTRO_DB_REMOTE_URL=libsql://your-database.turso.ioASTRO_DB_APP_TOKEN=your-token
# Auth ConfigurationCMS_ENCRYPTION_KEY="..." # Generated with openssl rand --base64 16
You can set up these variables using the studiocms init
command’s interactive environment builder.