컨텐츠로 건너뛰기

CLI

StudioCMS CLI는 새로운 StudioCMS 프로젝트를 빠르게 구성하고 StudioCMS에 유용한 유틸리티를 제공하는 도구입니다.

StudioCMS 생태계에는 서로 다른 여러 CLI가 있습니다.

다음은 StudioCMS CLI와 그 구성 요소에 대한 세부 정보입니다.

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

StudioCMS 프로젝트 루트에서 다음을 실행합니다.

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

Turso의 문서^에 있는 스크립트를 사용하여 최신 버전의 Turso를 다운로드하고 설치합니다.

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

init 명령어는 다음을 도와주는 대화형 설정 경험을 제공합니다.

  1. 다음 옵션을 통해 환경 파일 (.env)을 설정합니다.

    • .env 템플릿 예시 사용
    • 대화형 .env 빌더 사용 (다음 기능 포함):
      • 새로운 Turso 데이터베이스 설정 (Windows가 아닌 경우)
      • OAuth 제공자 구성 (GitHub, Discord, Google, Auth0)
      • 암호화 키 및 기타 필수 변수 설정
    • 환경 파일 생성 건너뛰기
  2. 데이터베이스 설정 시 필요한 경우 Turso CLI 자동 설치 및 인증을 포함합니다.

전체 환경 변수 목록은 환경 변수 문서를 참조하세요.
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는 기본적으로 대화형 모드로 실행되지만, 명령줄 인수를 사용하여 프로젝트 이름과 템플릿을 지정할 수도 있습니다.

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

GitHub에서 제공되는 템플릿의 전체 목록^을 확인해 보세요.

--template을 사용할 때 CLI는 템플릿 리포지토리의 모든 폴더를 검색합니다. 예를 들어, studiocms/basics 템플릿은 리포지토리 루트의 studiocms 폴더에 있는 basics 프로젝트를 가리킵니다.

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.

Turso의 문서^에 있는 스크립트를 사용하여 최신 버전의 Turso를 다운로드하고 설치합니다.

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

StudioCMS 설치 및 의존성을 업그레이드하기 위한 명령줄 도구입니다.

터미널에서 이 명령을 실행하여 StudioCMS를 업그레이드하는 동시에 공식 Astro 프로젝트와 통합을 함께 업그레이드할 수 있습니다.

Terminal window
npx @studiocms/upgrade

특정 tag를 전달하여 패키지를 해석할 수도 있습니다. 포함하지 않으면 @studiocms/upgradelatest 태그를 찾습니다.

Terminal window
npx @studiocms/upgrade beta