# `alta repo`

> alta repo: where this machine installs charts from: its folders and the repositories you add; update fetches their indexes (the only network use, with pull).

Where this machine installs charts from: its folders and the repositories you add; update fetches their indexes (the only network use, with pull).

## Usage

```text
alta repo list | add <name> <url> [--key <file>] [--insecure-unsigned] | remove <name> | update [<name>] | index <folder> [--out <file>] [--archives <url>] [--checkouts <dir>] [--commit <sha>] [--previous <file>] | sign <index.json> --key <private key file> [--out <file>] | search [<words>] [--json]
```

## Arguments

| Name | | Description |
|---|---|---|
| `list|add|remove|update|index|sign|search` | **required** | list: the local folders and the repositories added, with the date of their last update. add: record a repository (fetches nothing). remove: forget it (its cache goes to the archive). update: fetch the index of one repository or all, and check its signature with the key given to add. index: build the index of a charts repository folder (for its maintainers). sign: write index.json.sig with the repository's private key (for its maintainers). search: the same as alta search. |
| `name` | *optional* | add, remove, update: the repository's name, lower-case letters, digits and dashes. |
| `url` | *optional* | add: the https address of its index.json (no user name or password in it). |

## Options

| Name | Type | Default | Description |
|---|---|---|---|
| `--key` | *string* |  | add: a file holding the repository's Ed25519 public key; every index is checked against it. sign: the file of the private key (or ALTA_SIGNING_KEY_FILE), readable by its owner only. |
| `--insecure-unsigned` | *flag* |  | add: accept its index without a signature; a warning is printed at every use. |
| `--out` | *string* | *Default: `<folder>/index.json`* | index: where to write the index. sign: where to write the signature (default `<index.json>`.sig). |
| `--archives` | *string* |  | index: the https address the archives will be served from; writes them next to the index. |
| `--checkouts` | *string* |  | index: a folder holding, per chart of sources/, its content at the pointed commit. |
| `--commit` | *string* |  | index: the full commit of the repository, for the charts kept in it. |
| `--previous` | *string* |  | index: an earlier index whose older versions are kept. |
| `--locality` | *string* |  | search: local, local-first or cloud. |
| `--kind` | *string* |  | search: one kind of chart. |
| `--tier` | *string* |  | search: official, verified or community. |
| `--free` | *flag* |  | search: free charts only. |
| `--fits` | *flag* |  | search: charts that support this machine only. |
| `--repo` | *string* |  | search: one repository only. |
| `--json` | *flag* |  | Print the result as JSON. |

## Exit codes

| Name | Description |
|---|---|
| `0` | ok |
| `1` | problems found |
| `2` | bad usage |
| `3` | not in this version |

## Examples

*Where charts come from*

```sh [Terminal]
alta repo list
```

```text [Output]
modules         12 charts  this repository: modules/
agents           1 charts  this repository: agents/
engine           1 charts  this repository: engine/
```

*Add a repository, with its public key*

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

*Reaches the repository's address (the only commands that use the network): it prints what it fetched and checked.*

*Fetch its index*

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

*Reaches the repository's address (the only commands that use the network): it prints what it fetched and checked.*

*Find a chart*

```sh [Terminal]
alta repo search brief
```

```text [Output]
CHART                    VERSION    KIND        LOCALITY        REPO           SUMMARY
briefing                 0.2.0      module      cloud           modules        Morning and bedtime A5 briefs and the morning podcast, delivered to the tablet, annotations watched.
people-digest            0.1.0      module      local           modules        Daily private people digest from read-only WhatsApp history and an optional social cache, for the brief.
sunrise                  0.1.0      module      local           modules        Sunrise and sunset for the next wake-up at the owner's current place (bedtime brief, wake-up planning).
```

## See also

- [Add a repository](https://docs.os.altasystem.ai/marketplace/add-a-repository)
- [Run a charts repository](https://docs.os.altasystem.ai/marketplace/run-a-repository)
- [alta search](https://docs.os.altasystem.ai/reference/cli/search)
- [alta pull](https://docs.os.altasystem.ai/reference/cli/pull)
