# Releases and install

> Pick the official release, roll back, choose hosting, and give customers the install command.

A successful build, a version, and the official release are three separate states. Finishing a build doesn't change what your customers install. You choose the **official release**, who can install it, and where its source code lives.

## Builds, versions, and the official release

| Term | What it is |
| --- | --- |
| **Successful build** | One generation that finished. Owners, admins, and builders can install it. |
| **Version** | One entry in the CLI's release history. The official and testing releases keep their exact build. Repairing a build can rebuild any other version under the same number. |
| **Official release** | The one version the stable install link serves. A CLI can have none. |

New builds and **Publish commits** (`okibi clis publish`) add versions but leave the official release alone. Skill and endpoint updates add a version and make it official right away.

Check each one before you share the CLI:

```sh
okibi runs --cli my-cli
okibi clis releases my-cli
okibi clis hosting status my-cli
```

`okibi runs` lists the builds, `clis releases` lists the versions, and `clis hosting status` shows the official release and its install command.

## Choose the official release or roll back

Owners and admins choose it. To roll back, pick an older version. If its build was cleaned up, Okibi rebuilds it first.

**In the app**

1. Open the project and click **CLI**.
2. Under **Versions**, pick a version.
3. Click **Make official**. To take the official release down, pick it and click **Stop making it official**.
4. To pick who can install it, open **Settings** > **Who gets it**. Next to **Access**, click **Make public** (Pro) or **Make private**.

The **Which version** card shows what everyone gets and what testers get.

**In the CLI**

```sh
okibi clis releases my-cli
okibi clis release set my-cli --release <release-id>
okibi clis hosting visibility my-cli public
```
The `SELECTOR` column of `okibi clis releases` shows the flag to pass. `okibi clis release clear my-cli` takes the release down.

A public audience needs the Pro plan. With a workspace audience, each member gets a personal install command that expires in about an hour.

## The command your customers run

With a public audience, share this. It always installs the current official release:

```sh
curl -fsSL https://okibi.ai/i/acme/my-cli | sh
```

- **Windows:** `irm 'https://okibi.ai/i/acme/my-cli.ps1' | iex`
- **What it installs:** `my-cli` (in `~/.local/bin` on macOS and Linux), plus the CLI's skill for the coding agents it finds.
- **Upgrade:** run the same command again.
- **Find it later:** `okibi clis hosting status my-cli` prints the current command.

> **Warning** Personal commands carry a signed token (`?t=…`). Anyone who has one can install until it expires, so share it only with the person it was made for.

## Install one exact build

You can install a single build without moving the official release. In the app, open the **CLI** page, pick the version under **Versions**, and copy the line under **Install this version** (or click **Prepare install** if its install files were cleared). In the terminal, run `okibi clis install my-cli --run 42`, with the build's run ID or number. Both give you a personal command.

## Choose where the source code lives

Every successful build pushes the CLI's code to a private repository: an **Okibi-hosted private repo** (no setup, your GitHub account gets read access) or **Your GitHub** (needs the Okibi publisher app and the Pro plan).

**In the app**

In **Settings** > **Where it lives**, click **Move to GitHub** (or **Change**) next to **Code**, and pick a target. For GitHub, click **Connect GitHub**, then pick the account and repository name. The change applies on the next successful build.

**In the CLI**

```sh
okibi auth publisher
okibi clis hosting target my-cli github --account acme --repo my-cli
okibi clis hosting publish my-cli
```
`hosting publish` pushes the current source now. `okibi clis hosting target my-cli hosted` switches back.

Connecting an organization needs an org owner. Okibi only reuses a repository that is empty or already an Okibi CLI, so it never overwrites your other code.

## Use your own install domain

Serve the public installer from a hostname you own, such as `install.example.com`. It needs the Pro plan and a public official release.

**In the app**

1. In **Settings** > **Where it lives**, click **Add domain** next to **Install domain**. Enter the **Hostname** and click **Add domain**.
2. Add the **DNS record** it shows, and any **Ownership verification** record, at your DNS provider.
3. Click **Verify DNS**. Okibi also keeps checking in the background.

**In the CLI**

```sh
okibi clis domain add my-cli install.example.com
okibi clis domain status my-cli
okibi clis domain verify my-cli
```

When its status is Ready, the public command becomes `curl -fsSL https://install.example.com | sh` (Windows: `irm 'https://install.example.com/install.ps1' | iex`). Behind a DNS proxy such as Cloudflare, keep the record DNS-only until HTTPS is ready.

## Change the API endpoint

The generated CLI calls one API base URL. In **Settings** > **Basics**, click **Change** next to **API endpoint**, enter the new URL, and click **Save**. Or run `okibi clis endpoint set my-cli https://api.example.com`.

This builds a new official version without running the generation agent. You need an official release first.

If the CLI uses [Okibi Identity](https://okibi.ai/docs/guides/identity.md) and the new endpoint has no Identity manifest, Okibi asks first. In the CLI, add `--allow-missing-identity` to go ahead.

- [npm and Homebrew](https://okibi.ai/docs/guides/package-managers.md): Publish every official release to npm and Homebrew under your own names.
- [Testers](https://okibi.ai/docs/guides/testers.md): Let testers try a version before it becomes official.
- [okibi clis reference](https://okibi.ai/docs/cli/reference/clis.md): Every flag for releases, hosting, domains, and endpoints.
