Skip to content

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:

The following is a breakdown of the StudioCMS CLI and its components.

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

From within your StudioCMS Project root

Terminal window
npm run studiocms [command]
usage: studiocms add <plugins...>
Adds StudioCMS plugin(s) to your project.
Arguments:
plugins Plugin(s) to install
Options:
-h, --help display help for command
usage: studiocms crypto [command]
Crypto Utilities for Security
Options:
-h, --help display help for command
Commands:
gen-jwt Generate JWT token from a keyfile
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

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:

  1. 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
  2. The command includes automatic Turso CLI installation and authentication if needed when setting up a database.

For a full list of environment variables, see the Environment Variables documentation.
usage: studiocms users [options]
Utilities for Tweaking Users in StudioCMS
Options:
-h, --help display help for command
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.
Terminal window
npm create studiocms@latest

create-studiocms automatically runs in interactive mode, but you can also specify your project name and template with command line arguments.

Terminal window
npm create studiocms@latest -- --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.

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 through
the 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.

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

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.

Terminal window
npx @studiocms/upgrade

It is possible to pass a specific tag to resolve packages against. If not included, @studiocms/upgrade looks for the latest tag.

Terminal window
npx @studiocms/upgrade beta