---
title: "Configuration"
description: "Configuration, scripting and debugging."
---

## Configuration

The CLI reads configuration in this order (first match wins):

1. Command-line flags (`--api-key`, `--project`)
2. Environment variables (`CODESPAR_API_KEY`, `CODESPAR_PROJECT`)
3. The config file at `~/.codespar/config.json`

### Project scoping

If you have multiple CodeSpar projects, pin the CLI to one:

```bash
codespar config set project proj_abc123
```

Or per-command:

```bash
codespar servers list --project proj_abc123
```

## Scripting

The CLI returns valid JSON on `stdout` and human-readable messages on `stderr`, so you can pipe output into `jq`:

```bash
# Servers that support Pix, as a newline-delimited list
codespar servers list --json | jq -r '.[] | select(.capabilities | contains(["pix"])) | .id'

```

Use `--json` on any command to force JSON output even in a TTY.

## Debugging

Add `--verbose` to any command to see the underlying HTTP requests:

```bash
codespar servers list --verbose
```

Reset the CLI (clears cached auth, config, and completions):

```bash
codespar reset
```

## Next steps

<NextStepsGrid items={[
  { label: "QUICKSTART", title: "Quickstart", description: "Install the SDK after you've explored the catalog via CLI.", href: "/docs/quickstart" },
  { label: "SERVERS", title: "Servers & Toolkits", description: "Browse the MCP server catalog.", href: "/docs/servers" },
  { label: "CONCEPT", title: "Authentication", description: "How API keys, service auth, and Connect Links fit together.", href: "/docs/concepts/authentication" },
  { label: "DEBUGGING", title: "Debugging", description: "Deep dive into tool-call logs and observability.", href: "/docs/debugging" },
]} />
