# Knowledge CLI

Use `provon knowledge` to materialize active project Knowledge as local Markdown and find relevant
items deterministically. You can also manage Learning Goals, Knowledge Items, and Knowledge settings.

## Pull Project Knowledge

```bash
provon knowledge pull
```

The default output is `.provon/knowledge`. The command writes one managed Markdown snapshot for the
active project and records a manifest so local modifications can be detected.

Choose another directory or replace a modified snapshot:

```bash
provon knowledge pull --out ./project-knowledge
provon knowledge pull --out ./project-knowledge --force
```

## Find Knowledge

```bash
provon knowledge find "deployment region"
provon knowledge find "response format" --goal <goal-id> --limit 10
```

Matching is deterministic and requires every normalized search term to appear in the item title,
content, or Learning Goal name.

Select an output format:

```bash
provon knowledge find "deployment region" --format json
provon knowledge find "deployment region" --format md
provon knowledge find "deployment region" --format paths
```

`paths` returns the generated Markdown files associated with matching goals and is useful when
providing focused context to a coding agent.

## Inspect The Snapshot

```bash
provon knowledge status
provon knowledge status --out ./project-knowledge
```

Status verifies the managed manifest and reports whether the local snapshot is current and intact.

## Manage Learning Goals

List goals:

```bash
provon knowledge goals list
provon knowledge goals list --status active --limit 50
```

Goal statuses: `active`, `archived`.

Create a goal:

```bash
provon knowledge goals create "Deployment constraints" \
  "Extract all region and quota constraints mentioned in conversations." \
  --status active
```

Inspect and update a goal:

```bash
provon knowledge goals get <goal-id>
provon knowledge goals update <goal-id> --name "Updated name"
provon knowledge goals update <goal-id> --instruction "New instruction"
provon knowledge goals update <goal-id> --status archived
```

Archive a goal:

```bash
provon knowledge goals archive <goal-id>
```

Backfill a goal over historical conversations:

```bash
provon knowledge goals backfill <goal-id> \
  --start 1755216000000 \
  --end 1755302400000 \
  --max-conversations 1000
```

## Manage Knowledge Items

Inspect and update an item:

```bash
provon knowledge items get <item-id>
provon knowledge items update <item-id> --title "Updated title"
provon knowledge items update <item-id> --content "Updated content"
provon knowledge items update <item-id> --status active
```

Item statuses: `active`, `reviewing`, `archived`, `rejected`.

## Knowledge Settings

Show or update automatic knowledge extraction:

```bash
provon knowledge settings get
provon knowledge settings set-extraction true
provon knowledge settings set-extraction false
```

## Related Docs

- [Knowledge](../knowledge/index.md) for the complete workflow
- [Knowledge API](../api/knowledge.md)
