Zum Inhalt springen

Das CLI

Die StudioCMS CLIs sind Dienstprogramme, mit denen du schnell neue StudioCMS-Projekte einrichten und nützliche Dienstprogramme für StudioCMS bereitstellen kannst.

Es gibt mehrere verschiedene CLIs, die Teil des StudioCMS-Ökosystems sind:

Im Folgenden findest du eine Übersicht über die StudioCMS CLI und ihre Komponenten.

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

Von deinem StudioCMS-Projektstammverzeichnis aus:

Terminal-Fenster
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

Lädt die neueste Version von Turso herunter und installiert sie mit dem Skript aus Turso’s Dokumentation^.

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

Der init-Befehl bietet eine interaktive Einrichtungsmöglichkeit, die dir hilft:

  1. Richte deine Umgebungsdatei (.env) mit den folgenden Optionen ein:

    • eine Beispiel-.env-Vorlage zu verwenden
    • den interaktiven .env-Builder zu verwenden, mit dem du:
      • Eine neue Turso-Datenbank einrichten (wenn nicht unter Windows)
      • OAuth-Anbieter konfigurieren (GitHub, Discord, Google, Auth0)
      • Verschlüsselungsschlüssel und andere erforderliche Variablen setzen
    • Die Erstellung von Umgebungsdateien überspringen
  2. Der Befehl beinhaltet die automatische Turso CLI-Installation und die Authentifizierung, falls dies beim Einrichten einer Datenbank erforderlich ist.

Eine vollständige Liste der Umgebungsvariablen findest du in der Dokumentation Umgebungsvariablen.
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-Fenster
npm create studiocms@latest

create-studiocms läuft automatisch im interaktiven Modus, aber du kannst deinen Projektnamen und deine Vorlage auch mit Kommandozeilenargumenten angeben.

Terminal-Fenster
npm create studiocms@latest -- --template studiocms/basics --project-name my-studiocms-project

Eine vollständige Liste^ findest du auf GitHub.

Wenn du --template verwendest, durchsucht das CLI das Vorlagen-Repository nach allen Ordnern. Die Vorlage studiocms/basics verweist zum Beispiel auf das Projekt basics im Ordner studiocms im Stammverzeichnis des Repositorys.

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.

Lädt die neueste Version von Turso herunter und installiert sie mit dem Skript aus Turso’s Dokumentation^.

Usage: getTurso [options]
Turso CLI Installer
Options:
-h, --help display help for command

Ein Kommandozeilen-Tool zum Aktualisieren deiner StudioCMS-Installation und Abhängigkeiten

Du kannst diesen Befehl in deinem Terminal ausführen, um dein offizielles Astro Project, die Integrationen gleichzeitig mit StudioCMS zu aktualisieren.

Terminal-Fenster
npx @studiocms/upgrade

Es ist möglich, ein bestimmtes tag zu übergeben, nach dem Pakete aufgelöst werden. Wenn dies nicht der Fall ist, sucht @studiocms/upgrade nach dem latest Tag.

Terminal-Fenster
npx @studiocms/upgrade beta