# CLI 설치

Tomba CLI(`tomba`)는 macOS, Linux, Windows용 단일 바이너리입니다. 설치한 후에는 [인증](/cli/authentication)에 설명된 대로 로그인합니다.

## 설치

릴리스 빌드는 macOS(amd64, arm64), Linux(386, amd64, armv6, arm64, ppc64), Windows(386, amd64, arm64)용으로 제공됩니다.

### 설치 스크립트(macOS 및 Linux)

```bash
curl -sSL https://releases.tomba.io/install.sh | sh
```

스크립트는 [GitHub Releases](https://github.com/tomba-io/tomba/releases)에서 사용 중인 플랫폼용 최신 릴리스를 다운로드하고, SHA-256 체크섬을 확인하고, `tomba`를 `/usr/local/bin`에 설치하고(해당 디렉터리에 쓸 수 없으면 `sudo` 사용), bash, zsh 또는 fish용 자동 완성을 설정합니다. 체크섬 파일을 다운로드하지 못하거나 `sha256sum` 또는 `shasum`을 찾지 못하면 경고를 출력하고 확인 없이 설치합니다. 아카이브를 직접 확인하려면 [다운로드 검증](#verify-the-download)을 참고합니다.

버전을 고정하거나 다른 디렉터리에 설치하려면 `--version` 또는 `--dir`을 전달합니다.

```bash
curl -sSL https://releases.tomba.io/install.sh | sh -s -- --version 1.2.3 --dir "$HOME/.local/bin"
```

### PowerShell(Windows)

```powershell
irm https://releases.tomba.io/install.ps1 | iex
```

스크립트는 SHA-256 체크섬을 확인하고, `tomba.exe`를 `%LOCALAPPDATA%\tomba`에 설치하고, 해당 폴더를 사용자 `PATH`에 추가하고, PowerShell 자동 완성을 프로필에 추가합니다.

### Homebrew

```bash
brew install --cask tomba-io/tap/tomba
```

### Scoop(Windows)

```powershell
scoop bucket add tomba https://github.com/tomba-io/scoop-bucket.git
scoop install tomba
```

### Snap(Linux)

```bash
sudo snap install tomba
```

### Linux 패키지

각 릴리스에는 `.deb`, `.rpm`, `.apk`, Arch Linux(`.pkg.tar.zst`) 패키지가 포함됩니다. 예를 들어 Debian 또는 Ubuntu에서는 다음과 같습니다.

```bash
curl -LO https://github.com/tomba-io/tomba/releases/latest/download/tomba_amd64.deb
sudo apt install --no-install-recommends ./tomba_amd64.deb
```

패키지는 `git`과 `systemd`에 종속되며 `golang`을 권장합니다. `--no-install-recommends`를 사용하면 Go 툴체인을 건너뜁니다. 패키지는 셸 자동 완성, man 페이지, 그리고 [`tomba serve`](/cli/http)를 `www-data`로 실행하고 부팅 시 활성화되는 systemd 유닛 `tomba.service`를 설치합니다. 로컬 서버를 사용하지 않는다면 다음과 같이 유닛을 비활성화합니다.

```bash
sudo systemctl disable --now tomba
```

### Go

Go 1.25 이상이 필요합니다.

```bash
go install github.com/tomba-io/tomba@latest
```

바이너리는 `$(go env GOPATH)/bin`에 설치되며, 이 경로는 `PATH`에 있어야 합니다. `go install`로 빌드한 바이너리는 버전을 `dev`로 표시합니다.

## 다운로드 검증

모든 릴리스는 각 아카이브와 패키지의 SHA-256 체크섬이 담긴 `tomba_checksums.txt`를 게시합니다. 아카이브에서 설치하면서 먼저 확인하려면:

```bash
VERSION=1.2.3
curl -LO "https://github.com/tomba-io/tomba/releases/download/v${VERSION}/tomba_linux_amd64.tar.gz"
curl -LO "https://github.com/tomba-io/tomba/releases/download/v${VERSION}/tomba_checksums.txt"
sha256sum --ignore-missing -c tomba_checksums.txt
tar -xzf tomba_linux_amd64.tar.gz tomba
sudo install -m 0755 tomba /usr/local/bin/tomba
```

macOS에서는 `shasum -a 256 --ignore-missing -c tomba_checksums.txt`와 `tomba_darwin_arm64` 또는 `tomba_darwin_amd64` 아카이브를 사용합니다. 확인에 성공하면 아카이브 이름 옆에 `OK`가 출력됩니다. 다른 결과는 파일이 릴리스와 일치하지 않는다는 뜻이므로 설치하지 마십시오.

## 설치 확인

```bash
tomba version
```

```text
tomba 1.2.3
  built:    2026-09-27T14:29:29Z
  commit:   0949b31
  go:       go1.27.1
  os/arch:  linux/amd64
```

`tomba --version`은 버전을 한 줄로 출력합니다(`tomba version 1.2.3`).

## 셸 자동 완성

설치 스크립트, Homebrew, Linux 패키지는 자동 완성을 자동으로 설정합니다. 현재 세션에 직접 로드하려면:

```bash
# bash (requires the bash-completion package)
source <(tomba completion bash)

# zsh
source <(tomba completion zsh)

# fish
tomba completion fish | source
```

```powershell
tomba completion powershell | Out-String | Invoke-Expression
```

새 세션마다 자동 완성을 로드하려면 `tomba completion <shell> --help`가 사용 중인 셸에 대해 출력하는 단계를 따릅니다.

## 업데이트

```bash
tomba update
```

`tomba update`(별칭 `upgrade`)는 GitHub에서 최신 릴리스를 찾아 사용 중인 플랫폼용 아카이브를 다운로드하고, 체크섬 파일이 있으면 SHA-256 체크섬을 확인한 다음, `tomba` 바이너리를 그 자리에서 교체합니다. 바이너리가 쓰기 권한이 없는 디렉터리에 있으면 명령어가 `Cannot rename current binary (may need sudo)`로 실패하므로, `sudo`로 실행합니다.

패키지 관리자로 설치했다면 버전을 계속 추적할 수 있도록 같은 도구로 업데이트합니다.

| 설치 방법 | 업데이트 방법                                      |
| -------------- | ------------------------------------------------ |
| Homebrew       | `brew upgrade --cask tomba`                      |
| Scoop          | `scoop update tomba`                             |
| Snap           | `sudo snap refresh tomba`                        |
| Linux 패키지  | 새 패키지를 다운로드해 위와 같이 설치 |
| Go             | `go install github.com/tomba-io/tomba@latest`    |

## 제거

| 설치 방법           | 제거 방법                                                                                                                             |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
| 설치 스크립트           | `sudo rm /usr/local/bin/tomba`, 또는 `--dir`에 전달한 디렉터리에서 `tomba` 제거                                              |
| PowerShell 스크립트        | `%LOCALAPPDATA%\tomba`를 삭제하고, 사용자 `PATH`에서 제거하고, PowerShell 프로필에서 `tomba.completion.ps1` 줄을 제거 |
| Homebrew                 | `brew uninstall --cask tomba`                                                                                                           |
| Scoop                    | `scoop uninstall tomba`                                                                                                                 |
| Snap                     | `sudo snap remove tomba`                                                                                                                |
| Debian 또는 Ubuntu 패키지 | `sudo apt remove tomba`                                                                                                                 |
| RPM 패키지              | `sudo dnf remove tomba`                                                                                                                 |
| Alpine 패키지           | `sudo apk del tomba`                                                                                                                    |
| Arch Linux 패키지       | `sudo pacman -R tomba`                                                                                                                  |
| Go                       | `rm "$(go env GOPATH)/bin/tomba"`                                                                                                       |

CLI는 저장된 자격 증명을 `~/.tomba.json`에, 사용자 지정 스킬을 `~/.tomba/skills/`에 보관합니다. 바이너리를 제거해도 이 파일들은 그대로 남으므로, 다음 명령어로 삭제합니다.

```bash
rm -rf ~/.tomba.json ~/.tomba
```
