> For the complete documentation index, see [llms.txt](https://docs.pandastack.io/v1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pandastack.io/v1/getting-started/cli.md).

# CLI

The `panda` CLI lets you deploy projects, manage databases, trigger cronjobs, and query your infrastructure — all from your terminal.

## Installation

```bash
npm install -g @pandastack/cli
```

**Requirements:** Node.js >= 18

### Alternative: pre-built binaries

Download a standalone binary (no Node.js required):

| Platform      | Download                                                               |
| ------------- | ---------------------------------------------------------------------- |
| macOS (x64)   | [panda-macos](https://github.com/pandastack/pandastack-cli/releases)   |
| Linux (x64)   | [panda-linux](https://github.com/pandastack/pandastack-cli/releases)   |
| Windows (x64) | [panda-win.exe](https://github.com/pandastack/pandastack-cli/releases) |

## Quickstart

```bash
# 1. Get an API token from https://dashboard.pandastack.io/settings → API Tokens
panda login

# 2. Check your resources
panda status

# 3. Deploy a project
panda projects deploy my-app

# 4. Ask the AI assistant
panda ask "why did my last deploy fail?"
```

## Authentication

The CLI uses API tokens for authentication. Tokens start with `psk_` and are scoped to your account.

**Get a token:** Dashboard → Settings → API Tokens → Generate

```bash
panda login     # Prompts for token, then lets you pick an org
panda logout    # Clears stored credentials
```

After login, your credentials are saved at `~/.panda/config.json`.

## Configuration

Config is stored at `~/.panda/config.json`:

```json
{
  "token": "psk_...",
  "org_id": 123,
  "org_name": "my-org",
  "api_url": "https://api.pandastack.io"
}
```

| Field      | Description                           |
| ---------- | ------------------------------------- |
| `token`    | Your API token                        |
| `org_id`   | Active organization ID                |
| `org_name` | Active organization name              |
| `api_url`  | API base URL (change for self-hosted) |

### Switching organizations

```bash
panda org list      # See all orgs your token can access
panda org use       # Interactive org switcher
panda org use acme  # Switch to org named "acme"
```

## Global flags

| Flag        | Description                                  |
| ----------- | -------------------------------------------- |
| `--json`    | Output raw JSON (available on most commands) |
| `--help`    | Show help for any command                    |
| `--version` | Show CLI version                             |

## Next steps

* [Full command reference](/v1/getting-started/cli/reference.md)
* [Projects guide](/v1/getting-started/platform.md)
* [Databases guide](/v1/getting-started/databases.md)
* [PandaEdge functions](/v1/getting-started/pandaedge.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.pandastack.io/v1/getting-started/cli.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
