Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 215 additions & 0 deletions src/content/docs/ko/how-it-works/cli.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
---
i18nReady: true
title: "CLI"
description: "StudioCMS CLI와 사용법에 대해 알아보세요."
sidebar:
order: 2
---

import { Tabs, TabItem } from '@astrojs/starlight/components';
import ReadMore from '~/components/ReadMore.astro';

# 소개

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

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

- **`create-studiocms`**: StudioCMS 프로젝트 스캐폴딩 CLI
- **`studiocms`**: StudioCMS 유틸리티 CLI

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

## `create-studiocms`

### 설치

<Tabs syncKey='pkgs'>
<TabItem label="npm" icon="seti:npm">
```sh
npm create studiocms@latest
```
</TabItem>
<TabItem label="pnpm" icon="pnpm">
```sh
pnpm create studiocms
```
</TabItem>
<TabItem label="yarn" icon="seti:yarn">
```sh
yarn create studiocms
```
</TabItem>
</Tabs>

`create-studiocms`는 기본적으로 _대화형_ 모드로 실행되지만, 명령줄 인수를 사용하여 프로젝트 이름과 템플릿을 지정할 수도 있습니다.

<Tabs syncKey='pkgs'>
<TabItem label="npm" icon="seti:npm">
```sh
npm create studiocms@latest -- --template studiocms/basics --project-name my-studiocms-project
```
</TabItem>
<TabItem label="pnpm" icon="pnpm">
```sh
pnpm create studiocms --template studiocms/basics --project-name my-studiocms-project
```
</TabItem>
<TabItem label="yarn" icon="seti:yarn">
```sh
yarn create studiocms --template studiocms/basics --project-name my-studiocms-project
```
</TabItem>
</Tabs>

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

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

### 전체 CLI 옵션 및 명령

#### 기본 진입점

```log
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`

Turso의 [문서](https://docs.turso.tech/cli/installation)에 있는 스크립트를 사용하여 Turso의 최신 버전을 다운로드하고 설치할 수 있습니다.

:::note
Turso에 따르면 Windows에서는 WSL을 사용해야 합니다.
:::

```log
Usage: getTurso [options]

Turso CLI Installer

Options:
-h, --help display help for command
```

#### 대화형 (기본 명령)

```log
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.
```

## `studiocms`

### 전체 CLI 옵션 및 명령

#### 기본 진입점

```log
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`

Turso [문서](https://docs.turso.tech/cli/installation)의 스크립트를 사용하여 Turso의 최신 버전을 다운로드하고 설치합니다.

:::note
Turso에 따르면 Windows에서는 WSL을 사용해야 합니다.
:::

```log
Usage: getTurso [options]

Turso CLI Installer

Options:
-h, --help display help for command
```

#### `init`

```log
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 자동 설치 및 인증을 포함합니다.

## 환경 변수

StudioCMS는 여러 환경 변수를 구성해야 합니다. 주요 변수는 다음과 같습니다.

```dotenv
# 데이터베이스 구성
ASTRO_DB_REMOTE_URL=libsql://your-database.turso.io
ASTRO_DB_APP_TOKEN=your-token

# 인증 구성
CMS_ENCRYPTION_KEY="..." # openssl rand --base64 16 명령으로 생성
```

<ReadMore>전체 환경 변수 목록은 [환경 변수 문서][environment-variables]를 참조하세요.</ReadMore>

`studiocms init` 명령의 대화형 환경 빌더를 사용하여 이러한 변수를 설정할 수 있습니다.

[templates]: https://github.com/withstudiocms/templates
[environment-variables]: /ko/start-here/environment-variables/
Loading