> For the complete documentation index, see [llms.txt](https://docs.usepylon.com/pylon-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.usepylon.com/pylon-docs/developer/api/cli.md).

# CLI

Install and use the experimental Pylon CLI

Use the [Pylon CLI](https://github.com/pylon-labs/pylon-cli) to access the Pylon API from your terminal or scripts.

{% hint style="info" %}
The CLI is experimental. The current release is [v0.1.1](https://github.com/pylon-labs/pylon-cli/releases/tag/v0.1.1) and may change. The [SDKs](https://docs.usepylon.com/pylon-docs/developer/api/sdks.md) are versioned separately; upgrading an SDK does not upgrade the CLI.
{% endhint %}

## Install

With [Homebrew](https://brew.sh/) on macOS or Linux:

```bash
brew install pylon-labs/tap/pylon
pylon --version
```

For Windows or installation without Homebrew, download an installer or binary for your platform from [GitHub Releases](https://github.com/pylon-labs/pylon-cli/releases/latest).

## Authenticate

Create a Pylon API token as described in [Authentication](https://docs.usepylon.com/pylon-docs/developer/api/authentication.md), then run:

```bash
pylon auth login --with-token
```

Paste your token into the hidden prompt. The CLI saves it for future requests. On macOS, it uses Keychain when available. For automation, you can provide the token through the `PYLON_TOKEN` environment variable instead.

Confirm your connection:

```bash
pylon me get
```

Requests use the permissions associated with your API token.

### EU organizations

The CLI uses the US API by default. For an EU organization, add `--base-url` to your requests:

```bash
pylon me get --base-url https://api.eu.usepylon.com
```

You can also set `PYLON_BASE_URL=https://api.eu.usepylon.com` in your environment.

## Try a few read commands

List five accounts:

```bash
pylon accounts list --limit 5
```

Get an issue by its ID or number, replacing `1234` with your issue number:

```bash
pylon issues get --id 1234
```

Explore commands and their parameters:

```bash
pylon --help
pylon accounts list --help
pylon accounts list --schema
```

## Output and pagination

JSON is the default in terminals and pipes. It includes the full API response, including nested fields and pagination metadata. Use `--format table` for a human-readable table or `--query` to select fields:

```bash
pylon accounts list --limit 5 \
  --query 'data[].{name:name,id:id}' --format table
```

List commands fetch one page by default. Add `--page-all` to fetch every page. For example, export account responses as one JSON page per line:

```bash
pylon accounts list --page-all --no-pager --format jsonl > accounts.jsonl
```

Use `--page-limit N` to set a page cap. The CLI warns if more results remain. Failed requests return a nonzero exit code, even if earlier pages have already been printed.

## Upgrade

```bash
brew update
brew upgrade pylon-labs/tap/pylon
```

## Sign out

```bash
pylon auth logout
```

This removes the saved credential from the CLI. To revoke the token itself, manage it in Pylon’s API token settings.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.usepylon.com/pylon-docs/developer/api/cli.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
