# `jadpo toolchain`

Manage Jadpo releases.

The jadpo you install runs the Jadpo release line a project's app.jadpo names (`jadpo: "0.1"`): its newest release, or the one jadpo.lock pins, fetched once into your cache folder and checked against its SHA-256 and GitHub artifact attestation before it runs. `jadpo toolchain` lists the releases kept and `remove` deletes one; both always run with the jadpo you installed. `pin` writes the release a project runs with into jadpo.lock, so every run and build of it uses that release, and `unpin` takes it out. Set JADPO_TOOLCHAIN=local to run every command with the jadpo you started.

```text
jadpo toolchain [action] [version]
```

## Arguments

- `action` (optional): What to do: remove, pin or unpin, or nothing to list them
- `version` (optional): The release to remove

## On every command

- `--json`: Print data for tools instead of text
- `--full`: Show everything a report shortens
- `--help`: Show every flag, with examples
- `--color <when>`: Choose when to use colour

`jadpo toolchain --json` writes one JSON document to standard output instead of text, with the same exit code. The document has `schemaVersion`, `command` (`"toolchain"`), `ok`, `data` (what the command produced, `null` when it failed) and `diagnostics` (each error with its `rule`, `reason`, `next` and `help`). A command that needs a terminal refuses `--json` and names the flags that do the same job.

## Examples

```text
# See the Jadpo releases kept for your projects
jadpo toolchain
# Pin the release this project runs with
jadpo toolchain pin
# Delete a release no project needs
jadpo toolchain remove 0.1.2
```

## Errors

- [`cli.toolchain_arguments`](/docs/errors/cli.toolchain_arguments.md): A `jadpo toolchain` command names an action it doesn't have, or a release that isn't kept
- [`toolchain.artifact_write_failed`](/docs/errors/toolchain.artifact_write_failed.md): A file Jadpo writes for you, such as a record, couldn't be written, usually because it or its folder is read-only
- [`toolchain.project_not_found`](/docs/errors/toolchain.project_not_found.md): You ran a command that works on a project in a folder with no `app.jadpo`, in it or in any folder above it
- [`toolchain.version_newer`](/docs/errors/toolchain.version_newer.md): The project is written for a later Jadpo release line than the `jadpo` checking it, and that `jadpo` can't run the later release instead
- [`toolchain.version_older`](/docs/errors/toolchain.version_older.md): The project is written for an earlier Jadpo release line than the `jadpo` checking it, and that `jadpo` can't run the earlier release instead
- [`record.edited`](/docs/errors/record.edited.md): Generated record was edited by hand
