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

# CLI Reference

> All parmana CLI commands

## Install

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

Or use without installing:

```bash theme={null}
npx @parmanasystems/verifier-cli <command>
```

***

## parmana workspace init

Scaffold a new policy workspace with a sample policy.

```bash theme={null}
npx parmana workspace init <name>
```

Creates:

```
<name>/
  policies/
    payment-approval/
      1.0.0/
        policy.json     ← edit this
  examples/
    approve.json
    reject.json
```

***

## parmana workspace explain

Show all policies in the current workspace with their signal schemas and rule counts.

```bash theme={null}
npx parmana workspace explain
```

Output:

```
- payment-approval v1.0.0  (3 rules)
  Signals: amount (integer), verified (boolean)
```

***

## parmana workspace upgrade

Create the next patch version of a policy, copying its current rules.

```bash theme={null}
npx parmana workspace upgrade <policyId>
```

Example:

```bash theme={null}
npx parmana workspace upgrade payment-approval
# Creates policies/payment-approval/1.0.1/ from 1.0.0/
```

***

## parmana policy compile

Validate a policy through all 8 compilation phases. Must pass before building.

```bash theme={null}
npx parmana policy compile <path>
```

Example:

```bash theme={null}
npx parmana policy compile ./policies/loan-approval/1.0.0
```

Output:

```
✅ Phase 1 - File exists
✅ Phase 2 - Valid JSON
✅ Phase 3 - Required fields
✅ Phase 4 - Directory name matches policyId
✅ Phase 5 - Schema version supported
✅ Phase 6 - Signals schema valid
✅ Phase 7 - Rules valid
✅ Phase 8 - Catch-all present

✅ Policy is valid
```

Errors block signing. See [Error Codes](/reference/error-codes) for the full `POL-*` list.

***

## parmana policy build

Compile and sign a policy, generating the content-addressed bundle.

```bash theme={null}
npx parmana policy build <path>
```

Example:

```bash theme={null}
npx parmana policy build ./policies/loan-approval/1.0.0
```

Creates in the policy directory:

* `bundle.manifest.json` - content hash and policy metadata
* `bundle.sig` - Ed25519 signature over the manifest

The bundle hash is deterministic - the same policy content always produces the same hash.

***

## parmana verify bundle

Verify a policy bundle's content integrity and signature.

```bash theme={null}
npx parmana verify bundle <path>
```

Example:

```bash theme={null}
npx parmana verify bundle ./policies/loan-approval/1.0.0
```

Checks that the policy files match the `bundle.manifest.json` hash, and that `bundle.sig` is a valid signature over the manifest.

***

## parmana verify artifact

Verify a governance attestation file.

```bash theme={null}
npx parmana verify artifact <path>
```

Example:

```bash theme={null}
npx parmana verify artifact ./attestation.json
```

Checks:

* Ed25519 signature validity
* Runtime manifest hash
* Bundle manifest hash
* All attestation invariants

***

## Typical workflow

```bash theme={null}
# 1. Create workspace
npx parmana workspace init my-app
cd my-app

# 2. Edit policy
#    policies/payment-approval/1.0.0/policy.json

# 3. Validate
npx parmana policy compile ./policies/payment-approval/1.0.0

# 4. Build and sign
npx parmana policy build ./policies/payment-approval/1.0.0

# 5. Verify
npx parmana verify bundle ./policies/payment-approval/1.0.0
```
