﻿<head><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4357510538660394"
     crossorigin="anonymous"></script></head>> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qa.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Overview

> Run QA.tech tests, inspect results, expose local servers, and chat with the QA.tech agent from the terminal.

`qatech` is the official command-line tool for [QA.tech](https://qa.tech). It lets you run end-to-end tests, inspect results, expose local servers via tunnels, and chat with the QA.tech agent - all from the terminal.

The CLI is designed to be **agent-friendly**: every command supports `--json` output, `--help` with copy-pasteable examples, and exits non-zero on failure so AI coding agents can drive it reliably from your terminal.

## Install

```bash theme={null}
npm install -g qatech
```

Requires Node.js 18+.

## Quick start

**1. Get an API key**

Sign in at [app.qa.tech](https://app.qa.tech) → **Settings → Integrations → API**.

**2. Configure the CLI**

```bash theme={null}
qatech configure -k <your-api-key>
```

The key is saved to `.qatech/config.json` in the current directory by default.

**3. Discover your tests**

```bash theme={null}
qatech test-cases
```

**4. Run a test**

```bash theme={null}
qatech run -c <test-case-id> --wait
```

Streams progress to your terminal and exits with code `1` if any test fails.

## Commands

| Command | Description |
| - | - |
| [`configure`](https://docs.qa.tech/cli/commands/configure) | Set up API credentials |
| [`test-cases`](https://docs.qa.tech/cli/commands/test-cases) | List and search test cases |
| [`applications`](https://docs.qa.tech/cli/commands/applications) | List applications in the project |
| [`environments`](https://docs.qa.tech/cli/commands/environments) | List environments for an application |
| [`run`](https://docs.qa.tech/cli/commands/run) | Start a test run |
| [`status`](https://docs.qa.tech/cli/commands/status) | Check or wait for a run's results |
| [`chat`](https://docs.qa.tech/cli/commands/chat) | Chat with the QA.tech agent |
| [`tunnel`](https://docs.qa.tech/cli/commands/tunnel) | Expose local ports via tunnels |
| [`init`](https://docs.qa.tech/cli/commands/init) | Generate Claude Code subagent and skill files |

Run `qatech <command> --help` for detailed flags on any command.

## Configuration resolution

The CLI resolves credentials in this order - first match wins:

1. `--api-key` flag (per-command override)
2. `QATECH_API_KEY` environment variable
3. `.qatech/config.json` in the current directory (project-local)
4. `~/.qatech/config.json` (global fallback)

| Environment variable | Description |
| - | - |
| `QATECH_API_KEY` | API key |
| `QATECH_API_URL` | API base URL (default: `https://api.qa.tech`) |
| `QATECH_DEBUG` | Set to `1` for stack traces on errors |

## Output conventions

* **stdout** → data (JSON or human-readable results)
* **stderr** → progress messages, errors, hints
* With `--json`, stdout is always valid JSON - safe to pipe to `jq`
* Errors with `--json` are also JSON: `{ "error": true, "message": "...", "statusCode": 401 }`

This split lets you pipe results into `jq` cleanly:

```bash theme={null}
qatech run -t pln_abc123 --wait --json | jq '.runTestCases[] | select(.result == "FAILED")'
```

## Related documentation

* [API reference](https://docs.qa.tech/api-reference/introduction.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.