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

# Plannotator CLI reference

> Commands and flags for reviewing changes, annotating files and URLs, reopening sessions, and reading saved plan decisions.

The `plannotator` command opens a local review session in your browser. Run `plannotator <command> --help` for the help text shipped with your installed version.

## Review code changes

```bash theme={null}
plannotator review [--git | --gitbutler] [--local | --no-local] [PR_URL]
```

With no URL, Plannotator reviews changes in the current repository. It detects Git, GitButler, Jujutsu, or Perforce. Use `--git` or `--gitbutler` to override detection. GitButler support requires `but` 0.21.0 or later. Jujutsu is detected through the installed `jj` command and does not have a separate flag.

Pass a GitHub pull request or GitLab merge request URL to review it. Plannotator prepares a local checkout by default so it can show complete files. Use `--no-local` for a diff-only review.

```bash theme={null}
plannotator review
plannotator review --git
plannotator review https://github.com/owner/repo/pull/123
plannotator review --no-local https://gitlab.com/group/project/-/merge_requests/42
```

## Annotate a file, URL, or folder

```bash theme={null}
plannotator annotate <file.md | file.txt | file.html | https://... | folder/> \
  [--markdown] [--no-jina] [--gate] [--json] [--hook]
```

Markdown and text open as documents. Local HTML renders as HTML by default; `--markdown` converts it to Markdown. A folder opens the supported Markdown, text, and HTML files it contains.

URLs use Jina Reader by default. `--no-jina` uses a direct fetch followed by local HTML-to-Markdown conversion.

`--gate` adds an Approve action. `--json` writes a machine-readable decision to standard output. `--hook` implies `--gate` and writes the hook-native block/pass contract described in [Hooks](/open-source/reference/hooks).

## Annotate the last agent message

```bash theme={null}
plannotator annotate-last [--stdin] [--gate] [--json] [--hook]
plannotator last [--stdin] [--gate] [--json] [--hook]
```

The command reads the last assistant message from a supported agent session. Use `--stdin` to supply the text yourself:

```bash theme={null}
printf '%s' "$message" | plannotator annotate-last --stdin
```

`last` is an alias for `annotate-last`.

## Reopen a running session

```bash theme={null}
plannotator sessions
plannotator sessions --open
plannotator sessions --open 2
plannotator sessions --clean
```

`sessions` lists live local servers. `--open [N]` opens the numbered session, with session 1 as the default. `--clean` removes stale session records.

## Read saved plan decisions

```bash theme={null}
plannotator archive
```

This opens the read-only archive for decisions saved under `~/.plannotator/plans/`, or the equivalent directory under `PLANNOTATOR_DATA_DIR`.

## Goal setup commands

```bash theme={null}
plannotator setup-goal <interview|facts> <bundle.json | -> [--json]
```

This command belongs to the installed `/goal` workflow. `interview` opens goal questions; `facts` opens the facts acceptance view. Pass `-` to read the bundle JSON from standard input.

## Global options and hook-only commands

* `--browser <name>` selects a browser, application, or executable for this run. It can appear with any command.
* `--version` and `-v` print the installed version.
* `plannotator improve-context` is called by an installed agent hook. It reads a hook event from standard input and is not intended for direct use.

Running `plannotator` without arguments also belongs to hook integration and expects JSON on standard input. For an interactive session, choose `review`, `annotate`, `last`, `archive`, or `sessions` explicitly.

Last verified against Plannotator OSS v0.23.1 on July 18, 2026. Maintained by the Plannotator project.
