> For the complete documentation index, see [llms.txt](https://govplane.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://govplane.gitbook.io/docs/documentation/cli/installation-and-quickstart.md).

# Installation and Quickstart

## Install

```bash
npm install --global @govplane/cli
```

```bash
govplane version
```

{% hint style="info" %}
**Requires Node.js 20 or later.** On an older runtime the CLI stops with a message rather than a stack trace:

```
Govplane CLI requires Node.js 20 or later. Current version: Node.js 18.19.0
```

{% endhint %}

Upgrade or remove:

```bash
npm update --global @govplane/cli
npm uninstall --global @govplane/cli
```

The CLI has **zero runtime dependencies** — Node.js built-ins only.

## Quick start — inspecting what you already have

If someone handed you a bundle, this is the whole workflow:

```bash
govplane validate ./policy-bundle.json
govplane inspect ./policy-bundle.json --policies
govplane inspect ./policy-bundle.json --signature --public-key ./keys/prod.pem
```

No account, no configuration, no network.

## Quick start — a project

{% stepper %}
{% step %}

## Keep governance artefacts out of your application source

```bash
mkdir -p governance
govplane working-folder init -w ./governance
```

{% endstep %}

{% step %}

## Point every later command at it

```bash
govplane working-folder set ./governance
```

{% endstep %}

{% step %}

## Validate whatever is there

```bash
govplane validate
```

{% endstep %}

{% step %}

## See what it contains

```bash
govplane inspect --policies
```

{% endstep %}
{% endstepper %}

`working-folder init` writes two files:

```
governance/
├── govplane.config.json
└── policy-drafts.json
```

{% hint style="info" %}
If you plan to run `govplane analyze`, run it **before** `init` — or pass `--merge`. `init` creates an empty `policy-drafts.json`, and `analyze` refuses to overwrite an existing draft, so it will stop and tell you to choose `--merge` or `--force`.
{% endhint %}

## The working folder

The directory the CLI reads and writes project files in. It defaults to your current terminal directory, resolved in this order:

1. `--working-folder <path>` / `-w <path>`
2. `GOVPLANE_WORKING_FOLDER`
3. Persisted configuration (`govplane working-folder set`)
4. The current directory

```bash
govplane working-folder             # show the resolved folder
govplane working-folder --verbose   # show it and where it came from
```

A recommended layout:

```
project-root/
├── src/
└── governance/
    ├── govplane.config.json
    ├── policy-drafts.json
    ├── policy-bundle.json
    └── .govplane/
        ├── cache/
        ├── logs/
        └── temp/
```

See [Configuring the CLI](/docs/documentation/cli/configuring-the-cli.md).

## Adding the toolkit

`analyze`, `build`, `sign`, `simulate` and `policies` need the free CLI Toolkit. Without it the CLI explains what to do and exits with code `7` — it never downloads or registers anything by itself:

```
The build command requires the Govplane CLI Toolkit.

The CLI Toolkit is free and runs locally.

Install it with:
  govplane --install-kit
```

See [Installing the Toolkit Extension](/docs/documentation/cli/installing-the-cli-toolkit-extension.md).

## Programmatic use

The CLI also ships its building blocks as a library, so other tooling can reuse them without shelling out:

```ts
import { validateDocument, computeChecksum, summariseBundle } from '@govplane/cli';

const result = validateDocument({ document: bundle, file: 'policy-bundle.json' });
if (!result.valid) console.error(result.errors);
```

## Next

* [Basic CLI Commands](/docs/documentation/cli/basic-cli-commands.md)
* [Configuring the CLI](/docs/documentation/cli/configuring-the-cli.md)
* [A Practical Example, Start to End](/docs/documentation/cli/practical-example-from-start-to-end.md)

## More detail

* [CLI README](https://github.com/Govplane/govplane-cli/blob/main/README.md)
* [Working folder reference](https://github.com/Govplane/govplane-cli/blob/main/docs/working-folder.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://govplane.gitbook.io/docs/documentation/cli/installation-and-quickstart.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
