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

# CLI Quickstart

> Install, authenticate, and run your first PromptLoop command in minutes

## Install the CLI

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

Or run without a global install:

```bash theme={null}
npx @promptloop/cli --help
```

## Authenticate

Use browser login (recommended):

```bash theme={null}
promptloop auth login --browser
```

Or authenticate directly with an API key:

```bash theme={null}
promptloop auth login --api-key YOUR_API_KEY
```

Verify auth status:

```bash theme={null}
promptloop auth whoami
```

<Note>
  Create API keys from your PromptLoop settings page:
  [promptloop.com/account/settings](https://promptloop.com/account/settings)
</Note>

## Run your first task

List tasks:

```bash theme={null}
promptloop tasks list
```

Run one task with inputs:

```bash theme={null}
promptloop tasks run YOUR_TASK_ID --inputs "https://promptloop.com"
```

## Run a batch job

Create a batch from a CSV or JSON file:

```bash theme={null}
promptloop batches create --task-id YOUR_TASK_ID --file ./input.csv
```

Watch status:

```bash theme={null}
promptloop batches status YOUR_BATCH_ID --watch
```

Fetch results:

```bash theme={null}
promptloop batches results YOUR_BATCH_ID --wait
```

## Optional: point CLI to a local API

```bash theme={null}
promptloop config set api_url http://localhost:8080
promptloop config list
```

To switch back to production:

```bash theme={null}
promptloop config set api_url https://api.promptloop.com
```
