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

# CLI

> Install and configure the UQPAY CLI to manage resources and test APIs from the command line.

The UQPAY CLI provides command-line access to Global Account, Card Issuance, and Payment APIs. It supports 100+ commands across all business domains.

<Card title="GitHub" icon="github" href="https://github.com/uqpay/uqpay-cli">
  Source code and issues
</Card>

<Info>
  The CLI is open source (MIT) and works on macOS, Linux, and Windows (amd64 and arm64).
</Info>

## Installation

### npm (recommended)

```bash theme={null}
npm install -g @uqpay/cli
```

### Build from source

Requires Go 1.21 or higher:

```bash theme={null}
git clone https://github.com/uqpay/uqpay-cli.git
cd uqpay-cli
make install
```

### Shell completion

```bash theme={null}
uqpay setup-completion
source ~/.zshrc  # or ~/.bashrc
```

## Configuration

Run these once to set your credentials:

```bash theme={null}
uqpay config set client-id YOUR_CLIENT_ID
uqpay config set api-key YOUR_API_KEY
uqpay config set env sandbox
```

You can also pass credentials inline per command:

```bash theme={null}
uqpay --env sandbox --client-id ID --api-key KEY banking balance list
```

Or use environment variables:

| Variable          | Description               |
| ----------------- | ------------------------- |
| `UQPAY_CLIENT_ID` | Client ID                 |
| `UQPAY_API_KEY`   | API key                   |
| `UQPAY_ENV`       | `sandbox` or `production` |
| `UQPAY_OUTPUT`    | Default output format     |

## Quick start

```bash theme={null}
# List balances
uqpay banking balance list

# List cards
uqpay issuing card list

# List payment intents
uqpay payment intent list
```

## Output formats

```bash theme={null}
uqpay banking balance list           # table (default)
uqpay banking balance list -o json   # JSON
uqpay banking balance list -o yaml   # YAML
```

## Sub-account operations

Execute commands on behalf of a connected account:

```bash theme={null}
uqpay --on-behalf-of <account-id> banking balance list
```

## Debugging

Use the `--debug` flag to display full HTTP request and response details:

```bash theme={null}
uqpay --debug banking balance list
```

## AI agent skills

The CLI ships with six structured skills in the `skills/` directory, enabling AI agents to operate UQPAY APIs without additional configuration:

| Skill            | Scope                                       |
| ---------------- | ------------------------------------------- |
| `uqpay-shared`   | Configuration, authentication, global flags |
| `uqpay-banking`  | Global Account operations                   |
| `uqpay-issuing`  | Card and cardholder management              |
| `uqpay-payment`  | Payment processing                          |
| `uqpay-connect`  | Connected account management                |
| `uqpay-simulate` | Sandbox simulation                          |

Install skills alongside the CLI:

```bash theme={null}
npx skills add uqpay/uqpay-cli -y -g
```
