# CLI — Ghosty from your terminal

> Install the official Ghosty Studio CLI, sign in with your account, and configure, test and chat with your agents from the terminal.

URL: https://www.ghosty.studio/en/docs/cli

`ghosty` is the official Ghosty Studio CLI. It does what the dashboard does (configure, test and chat with your agents) from the terminal, and it is built so **your coding agent** (Claude Code, Codex, Cursor) can use it too.

## Install

:::tabs
```bash tab=npx
npx -y @ghostystudio/cli --help
```
```bash tab=Global
npm i -g @ghostystudio/cli
ghosty --help
```
:::

Requires Node 22 or newer.

## Sign in

```bash
ghosty login
```

Your browser opens, you sign in with your Ghosty account (Google, Apple or email) and the terminal is signed in. If you already have a session on ghosty.studio, opening the link is all it takes.

- If the browser doesn't open, the terminal prints the link so you can copy it.
- The session renews itself; it lasts 90 days without use before asking you to sign in again.
- Run any command without a session and the login starts on its own.
- Over SSH or on another machine? `ghosty login --device` gives you a link and a code to authorize from your phone (over SSH it does this by itself).
- `ghosty whoami` shows which account you are using; `ghosty logout` signs out and revokes the session.

### Let your coding agent do it

Ask Claude Code to "sign in to Ghosty with the CLI". It runs `ghosty login`, hands you the link in the chat, you open it, and it carries on. Details in [CLI for coding agents](/en/docs/cli/coding-agents).

## First steps

```bash
ghosty agents ls                        # your agents
ghosty try <agent-id> "hi, who are you?"  # one test turn
ghosty chat <agent-id>                  # live conversation
```

Every command, with examples, in the [command reference](/en/docs/cli/commands).

## Where the session lives

In `~/.config/ghosty/config.json`, readable only by your user. To point at another server, set `GHOSTY_URL`.
