# Install Corpus

Install the Corpus CLI to add and search corpus locally.

## Install the CLI

Check for an existing installation with `command -v corpus` and `corpus --version`. Keep an existing installation. If Corpus is missing, run this in your terminal:

```sh
curl -fsSL https://runcorpus.com/install.sh | sh
```

Available for macOS (Apple Silicon and Intel) and Linux (x86_64).
Installs to `~/.corpus/bin` and sets up your shell path.
Verify the installation with `corpus --version`. If your current shell has not picked up the updated path, run `~/.corpus/bin/corpus --version`.

## Set up Corpus with your agent

If the user asks you to set up Corpus, run the installation and verification steps above in your terminal. Preserve existing local corpus data. Report the version output or the error that blocked setup.

If the user also asks to add or search corpus:

1. Read `corpus --help`, `corpus add --help`, and `corpus search --help` for the installed CLI's syntax.
2. Use the published corpus reference or URI the user provides. Ask which corpus to use if they have not specified one. Check `corpus list` before adding it.
3. Run a local search for the user's question. Report the corpus used and include source URLs when available.

## Resources

- [View releases](https://github.com/runcorpus/corpus/releases)
- [Read install script](https://runcorpus.com/install.sh)
- [Installation page](https://runcorpus.com/install)
