# Find and install a chart

> Add a charts repository, search it offline, pull a chart with its digest checked, and read its install plan before you say yes.

You add a charts repository to your machine, find a chart in it, download it with its digest checked, and read what installing it would do. Nothing is installed until you run the install again with `--yes`.

**Before you begin (5 minutes)**

- The `alta` command: [install the CLI](https://docs.os.altasystem.ai/start/install).
- The address of a charts repository's `index.json`. Here: `https://charts.example.org/index.json`, an example repository with three charts.
- For the last step, a machine running Alta OS (its server answers `alta install`).

### Add the repository

First save the repository's public key: its maintainers publish it next to the index (here `https://charts.example.org/repo-key.pub`) or on the repository's page. Keep it as `community.pub` in the folder you run the commands from.

`alta repo add` gives the repository a name on this machine and remembers its address and its key. It downloads nothing.

```sh [Terminal]
alta repo add community https://charts.example.org/index.json --key community.pub
```

```text [Output]
added community (https://charts.example.org/index.json); nothing was downloaded
next: alta repo update community
```

### Fetch its index

`alta repo update` downloads the index and the signature the repository serves next to it, and checks the signature with the key you gave. This and `alta pull` are the only two commands that use the network.

```sh [Terminal]
alta repo update community
```

```text [Output]
community: 3 charts (signature verified with the key of community)
```

A bad signature, a signature made with another key, or none at all: the index is refused and the one fetched before is kept.

### Search

`alta search` reads the indexes you fetched, offline. Words match the id, the title, the summary and the keywords.

```sh [Terminal]
alta search notes
```

```text [Output]
CHART                    VERSION    KIND        LOCALITY        REPO           SUMMARY
sky-notes                0.1.0      agent       cloud           community      An agent that keeps short notes of what you ask it to remember.
```

**LOCALITY** says how much the chart needs the network once installed: `local` works with the network off, `local-first` uses it only for extras, `cloud` needs the services it lists. To see only what works offline:

```sh [Terminal]
alta search --locality local
```

```text [Output]
CHART                    VERSION    KIND        LOCALITY        REPO           SUMMARY
night-reading            1.0.0      quest-pack  local           community      One quest a night: read ten pages before sleep.
```

Other filters: `--kind agent`, `--tier verified`, `--free`, `--fits` (charts that support this machine), `--repo community`. Add `--json` for a script: it also gives the publisher's tier and why a version is not installable. See [Locality and online services](https://docs.os.altasystem.ai/charts/concepts/locality).

### Pull the chart

`alta pull` downloads the chart's archive, checks its sha256 and the digest of its files against the index, runs the same checks as `alta lint`, and keeps the folder for `alta install`. If any check fails, nothing is kept.

```sh [Terminal]
alta pull sky-notes
```

```text [Output]
pulled sky-notes 0.1.0 from community into ~/.local/share/alta/charts/community/sky-notes
  archive sha256 and tree digest match the index; alta lint passes
next: alta install sky-notes (through the machine's server, with your yes)
```

A version whose review is not finished cannot be pulled. Pulling `tea-timer` from the same repository prints:

```text [Output]
tea-timer 0.1.0 is not installable: its review is not finished: nothing is installable while a review is pending
```

### Read the plan, then install

`alta install` asks your machine's server for the plan: the values, the sign-ins, each change with how it is undone, and the proofs. Without `--yes` it changes nothing.

```sh [Terminal]
alta install sky-notes
```

```text [Output]
sky-notes 0.1.0 (agent) on http://127.0.0.1:8790: installable
needs:
  Sky notes will think with your Claude subscription · change
risk:
  Risk: medium. Read why below before you agree.
  - It installs programs on your machine.
  - It needs you to sign in (Claude).
  - An agent may reach the network where it chooses (message).
  - It talks to online services while it runs (Claude).
network:
  Needs online services to work.
  - Claude: It thinks with your Claude subscription: what you ask goes to Claude. A paid account is needed. What leaves your machine: what you ask.
sign-ins:
  need-claude          signin.cli
parts:
  agent                agent.create {"agent":"helper","chart":"sky-notes"}   undo: agent.archive
proofs:
  agent helper
repairs (none allowed until you say so):
  need-claude-again    signin.again       (always asked)

Nothing changed. Run it again with --yes to install: each part runs as planned above, nothing else.
```

When the plan is what you expect, run it again with `--yes`. In the game, the same plan is a quest: its first step says what the chart needs online, and you agree to it.

## What you did

- Added a repository, and fetched its index once.
- Found a chart offline, by words and by what it needs online.
- Downloaded exactly the files that were reviewed, checked on your machine.

**Next:**

- [Add a repository](https://docs.os.altasystem.ai/marketplace/add-a-repository)
- [Badges](https://docs.os.altasystem.ai/marketplace/badges)
- [alta install](https://docs.os.altasystem.ai/reference/cli/install)
