The CLI
The StudioCMS CLIs are utilities that allow you to quickly scaffold new StudioCMS projects and expose useful utilities for StudioCMS.
There are multiple different CLIs that are part of the StudioCMS ecosystem:
studiocms
: The StudioCMS utility CLI.create-studiocms
: The StudioCMS project scaffolding CLI.@studiocms/upgrade
: Upgrade StudioCMS Projects and their Plugins.
The following is a breakdown of the StudioCMS CLI and its components.
studiocms
Section titled “studiocms”Full CLI Options and commands
Section titled “Full CLI Options and commands”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: add Add StudioCMS plugin(s) to your project crypto Crypto Utilities for Security get-turso Install the Turso CLI init Initialize the StudioCMS project after new installation. users Utilities for Tweaking Users in StudioCMS
Example Usage
Section titled “Example Usage”From within your StudioCMS Project root
npm run studiocms [command]
pnpm studiocms [command]
yarn studiocms [command]
Command Breakdown
Section titled “Command Breakdown”usage: studiocms add <plugins...>
Adds StudioCMS plugin(s) to your project.
Arguments: plugins Plugin(s) to install
Options: -h, --help display help for command
crypto
Section titled “crypto”usage: studiocms crypto [command]
Crypto Utilities for Security
Options: -h, --help display help for command
Commands: gen-jwt Generate JWT token from a keyfile
crypto gen-jwt
Section titled “crypto gen-jwt”usage: studiocms crypto gen-jwt [options] <key-file>
Generate a JWT token from a keyfile
Arguments: key-file a relative path (e.g., `../keys/libsql.pem`) from the current directory to your private key file (.pem)
Options: -c, --claim <claim...> claim in the form [key=value] -e, --exp <date-in-seconds> Expiry date in seconds (>=0) from issued at (iat) time -h, --help display help for command
get-turso
Section titled “get-turso”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.
usage: studiocms users [options]
Utilities for Tweaking Users in StudioCMS
Options: -h, --help display help for command
create-studiocms
Section titled “create-studiocms”Full CLI Options and commands
Section titled “Full CLI Options and commands”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.
Example Usage
Section titled “Example Usage”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.
Command Breakdown
Section titled “Command Breakdown”Interactive (Default command)
Section titled “Interactive (Default command)”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.
get-turso
Section titled “get-turso”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
@studiocms-upgrade
Section titled “@studiocms-upgrade”A command-line tool for upgrading your StudioCMS installation and dependencies.
You can run this command in your terminal to upgrade your official Astro Project, integrations at the same time as you upgrade StudioCMS.
Example Usage
Section titled “Example Usage”npx @studiocms/upgrade
pnpm dlx @studiocms/upgrade
yarn dlx @studiocms/upgrade
Options
Section titled “Options”tag (optional)
Section titled “tag (optional)”It is possible to pass a specific tag
to resolve packages against. If not included, @studiocms/upgrade
looks for the latest
tag.
npx @studiocms/upgrade beta
pnpm dlx @studiocms/upgrade beta
yarn dlx @studiocms/upgrade beta