> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tiro.ooo/llms.txt
> Use this file to discover all available pages before exploring further.

# 설치와 인증

> Tiro CLI 설치, OAuth 로그인, 헤드리스·CI 인증 설정.

CLI는 npm에 `@theplato/tiro-cli`로 배포돼요. macOS, Linux, Windows를 지원해요. 보안을 위해 Node.js 22.23.4 이상(22.x), 24.22.1 이상(24.x), 26.12.1 이상(26.x)을 권장해요.

## 1. 설치

> [!NOTE]
>
> **보안상 권장하는 Node.js**는 22.23.4 이상(22.x), 24.22.1 이상(24.x), 26.12.1 이상(26.x)이에요. 이 권장 버전은 현재 npm 패키지의 설치 조건과 별개예요.
>
> 설치 전에 현재 Node.js 버전과 npm에 배포된 CLI의 Node.js 설치 조건을 확인하세요.
>
> ```bash theme={"system"}
> node --version
> npm view @theplato/tiro-cli engines
> ```
>
> 현재 Node.js가 보안 권장 범위 밖이거나 조회한 설치 조건을 충족하지 않으면, 두 조건을 모두 충족하는 Node.js로 업데이트한 뒤 CLI를 설치하세요.

```bash npm theme={"system"}
npm install -g @theplato/tiro-cli
```

```bash pnpm theme={"system"}
pnpm add -g @theplato/tiro-cli
```

```bash yarn theme={"system"}
yarn global add @theplato/tiro-cli
```

```bash bun theme={"system"}
bun add -g @theplato/tiro-cli
```

설치를 확인하세요:

```bash theme={"system"}
tiro --version
# → 0.6.4 (or later) — OAuth 로그인은 0.6.4 이상이 필요해요
```

## 2. 로그인

```bash theme={"system"}
tiro auth login
```

이 명령은 기본 브라우저에서 OAuth Authorization Code + PKCE 로그인을 시작해요. CLI는 redirect를 받으려고 `http://127.0.0.1:<random-port>/callback`에서 일회용 로컬 서버를 열어요. 로그인한 뒤 JWT는 운영체제의 자격 증명 저장소에 보관돼요.

* **macOS** — Keychain
* **Linux** — Secret Service (`gnome-keyring` 또는 `kwallet` 필요)
* **Windows** — Credential Manager

확인하세요:

```bash theme={"system"}
tiro auth status
# ✓ Signed in
#   source:     keychain
#   hostname:   https://api.tiro.ooo
#   user:       <userId>
#   expires at: <ISO datetime>
#   token:      tk__...***
```

화면에는 토큰 앞부분만 표시돼요. 전체 Bearer 토큰은 keychain 밖으로 노출되지 않아요.

> [!NOTE]
>
> **CLI는 로그인한 사용자로 동작해요.** 그래서 조회 범위가 앱에서 보는 노트와 같고, 본인의 개인 폴더 노트도 다룰 수 있어요. 시스템 API Key는 이와 달라서 전체 구성원에게 공유된 폴더의 노트만 조회해요([시스템 API Key가 조회하는 노트 범위](https://docs.tiro.ooo/ko/developers/fundamentals/system-key-note-scope.md)). 자동화가 개인 폴더 노트까지 다뤄야 한다면 CLI나 계정 API Key를 쓰세요.

## 3. 로그아웃

```bash theme={"system"}
tiro auth logout
```

keychain 항목을 지워요. 다음 `tiro auth login`은 고정된 Tiro public client로 새 OAuth 세션을 시작해요.

## 4. 에이전트에 Tiro MCP 연결하기 (선택)

Claude Code(또는 MCP 호환 클라이언트)를 쓴다면, CLI는 `https://mcp.tiro.ooo/mcp`에 호스팅된 Tiro MCP를 위한 한 줄짜리 installer를 제공해요:

```bash theme={"system"}
tiro mcp install
# → claude mcp add --transport http tiro https://mcp.tiro.ooo/mcp
```

출력을 셸로 바로 파이핑하거나, 명령을 MCP 클라이언트의 config에 복사하세요. 구조화된 뷰(transport, URL, docs link)를 보려면 `tiro mcp info --json`을 실행하세요. CLI는 읽기 위주 플로(브라우징, 디스크 저장)를 다루고, MCP는 에이전트 루프 안의 인터랙티브한 tool 호출을 다뤄요. 전체 에이전트 계약은 패키지에 동봉된 [`AGENTS.md`](https://github.com/plato-corp/tiro-cli/blob/main/AGENTS.md)를 참고하세요.

## Headless, CI, 에이전트 환경

일부 환경은 브라우저를 열 수 없어요(CI, SSH, sandbox 에이전트, Docker). 그런 경우엔 `TIRO_TOKEN`을 직접 설정하세요. 여기 들어가는 값은 keychain을 override해요.

```bash theme={"system"}
export TIRO_TOKEN="$(security find-generic-password -s 'io.tiro.cli' -a default -w 2>/dev/null \
  | jq -r '.accessToken')"
tiro notes list --json
```

GitHub Actions에서:

```yaml theme={"system"}
- name: Run tiro
  env:
    TIRO_TOKEN: ${{ secrets.TIRO_TOKEN }}
  run: |
    tiro notes search "release notes" --since 1d --json > recent.jsonl
```

> [!WARNING]
>
> 전체 bearer token을 CI secret에 넣는 것은 180일짜리 Personal Access Token과 같아요. 신뢰할 수 있는 머신에서 `tiro auth logout && tiro auth login`을 실행하고 새 토큰을 secret 저장소에 복사해 rotate하세요.

## 설정 override

| Variable | 용도 |
| - | - |
| `TIRO_TOKEN` | Bearer token — keychain을 override |
| `TIRO_HOSTNAME` | API base URL (기본값 `https://api.tiro.ooo`) |
| `NO_COLOR` | ANSI 색상 비활성화 ([no-color.org](https://no-color.org)) |

호출별 override:

```bash theme={"system"}
tiro --hostname https://api.tiro-ooo.dev notes list      # dev environment
tiro notes get <guid> --json --no-color                  # script-friendly
```

## CLI 업데이트

```bash npm theme={"system"}
npm update -g @theplato/tiro-cli
```

```bash pnpm theme={"system"}
pnpm update -g @theplato/tiro-cli
```

```bash yarn theme={"system"}
yarn global upgrade @theplato/tiro-cli
```

```bash bun theme={"system"}
bun update -g @theplato/tiro-cli
```

→ 직접 해보는 예제를 보려면 [Quickstart](https://docs.tiro.ooo/ko/developers/cli/quickstart.md)로 이어가세요.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.