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

# pch

> The command-line tool for creators and their coding agents.

> [!WARNING]
>
> `pch` isn't released yet. This page describes what it will do; until then, use the [API](https://docs.patch.gg/api-reference/introduction.md).

`pch` is Patch's command-line tool. It covers the whole loop of making something for Patch, from writing `patch.json` to publishing a release, and it's built to work just as well for coding agents and CI as for people.

It will be open source and published on npm as `@patchgg/cli`:

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

`pch` only uses the public [API](https://docs.patch.gg/api-reference/introduction.md), so anything it does, your own tools can do too.

## Commands

| Command | Does |
| - | - |
| `pch login` | Shows a code and opens patch.gg so you can approve it |
| `pch whoami` | Shows who you're signed in as |
| `pch init` | Writes a [`patch.json`](https://docs.patch.gg/manifest), asking questions or taking flags |
| `pch validate` | Checks `patch.json` and your files locally, then checks the games it needs against Patch |
| `pch check` | Runs the automated checks that can run on your machine |
| `pch publish` | Hashes your files, uploads what Patch doesn't have yet and submits the release |
| `pch dev` | Installs your working copy into a dev profile in the desktop app and launches it |
| `pch token create --name ci --scope publish` | Creates an [API key](https://docs.patch.gg/api-reference/introduction.md#api-keys) for an agent or CI and prints it once |

## Agents and CI

* Set `PCH_TOKEN` to an API key and nothing else: no login, no prompts and no files written.
* Every command takes `--json` for machine-readable output.
* When its output isn't a terminal, `pch` never prompts and prints plain progress lines.

## MCP server

`pch mcp` runs an MCP server, so agents like Claude Code, Codex and Cursor can use Patch as tools: validating, checking and publishing releases, and running a dev build. It uses the same credentials as `pch`.


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