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

# CLI Overview

> Command-line interface for Pragmatiks

The Pragma CLI provides declarative resource management for data infrastructure.

## Command Groups

| Command            | Description          |
| ------------------ | -------------------- |
| `pragma resources` | Manage resources     |
| `pragma auth`      | Authentication       |
| `pragma config`    | Configuration        |
| `pragma providers` | Provider development |
| `pragma store`     | Provider Store       |
| `pragma ops`       | Operations           |

## Global Options

These options can be used with any command.

### Context and Authentication

| Option             | Environment Variable | Description                                    |
| ------------------ | -------------------- | ---------------------------------------------- |
| `--context` / `-c` | `PRAGMA_CONTEXT`     | Use a specific configuration context           |
| `--token` / `-t`   | -                    | Override authentication token for this command |

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
# Use production context for this command
pragma resources list --context production

# Or set via environment
PRAGMA_CONTEXT=production pragma resources list
```

See [Authentication](/cli/authentication) for more on contexts.

### Output Format

Many commands support the `--output` / `-o` flag for structured output:

| Format  | Description                       |
| ------- | --------------------------------- |
| `table` | Human-readable table (default)    |
| `json`  | JSON for scripting and automation |
| `yaml`  | YAML format                       |

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
# List resources as JSON
pragma resources list --output json

# Get resource details as YAML
pragma resources get gcp/storage my-bucket -o yaml
```

This is useful for scripting and piping output to other tools like `jq`:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources list -o json | jq '.[] | select(.status == "ready")'
```

## Getting Started

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
# Install
pip install pragmatiks-cli

# Authenticate
pragma auth login

# Apply a resource
pragma resources apply myresource.yaml

# List resources
pragma resources list
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/cli/installation">
    Install and configure the CLI.
  </Card>

  <Card title="Authentication" icon="key" href="/cli/authentication">
    Authenticate with the platform.
  </Card>

  <Card title="Resources" icon="cube" href="/cli/resources">
    Manage resources.
  </Card>

  <Card title="Providers" icon="plug" href="/cli/providers">
    Build providers.
  </Card>

  <Card title="Store" icon="store" href="/cli/store">
    Browse and install providers.
  </Card>
</CardGroup>
