# The studio

> Change a CLI with its project chat, its okibi.yml, the improvements its builds suggest, and custom requests.

The **studio** is where you change a CLI after it's built. It has four parts:

- **A project chat.** Its agent has the CLI's repository. Ask for a rename, hidden or regrouped commands, better help, or something bigger.
- **Config**, the CLI's `okibi.yml`, which you can edit and build.
- **Improvements**, the changes agent ready optimization suggests.
- **Custom requests**, for changes `okibi.yml` can't make, such as a new command or a missing endpoint.

Every change goes into a build, and your users get it only when you publish that build.

Owners, admins, and builders can use the studio. It opens once a build has saved the CLI's code. A CLI an older generator built has its generation chat instead; [migrate it](https://okibi.ai/docs/guides/migrate.md) to get the studio.

## Open it

**In the app**

Click **Open studio** on the project's **Overview**, **CLI**, or **MCP server** page. The chat is on the left. On the right are **Config**, **Improvements** (while suggestions wait), **Commands**, and **Hosting**.

**In the CLI**

```sh
okibi studio my-cli
```
It shows where everything stands: a build waiting for Publish, the newest request, the newest build's improvements, and `okibi.yml`. `okibi studio show my-cli` is the same. In the TUI, run `/studio my-cli`.

## Chat with the agent

Tell the agent what to change. It edits `okibi.yml`, and its change saves and builds after each of its turns. For a change `okibi.yml` can't make, it writes a custom request, which sends itself.

**In the app**

Type in the chat box and send. While the chat starts, it reads "Opening the chat…". If an earlier chat expired, a new one starts without its history.

**In the CLI**

```sh
okibi studio chat my-cli
okibi studio chat my-cli --text "Group the forecast commands"
okibi message --cli my-cli --text "Group the forecast commands"
```
With no `--text`, the chat opens in the terminal UI. With `--text`, or `--file -` for stdin, okibi sends one message, waits for the agent's answer (15 minutes at most, `--timeout` to change), prints it and what it ran, and exits. `okibi message --cli` does the same.

Your open chat is reused, so a chat you start in the terminal carries on in the app, and the other way around.

## Edit okibi.yml

`okibi.yml` sits at the root of the CLI's repository and defines its commands. Accepted suggestions live in its sections. Your own changes go in its `human` section, and always win.

```yaml title="okibi.yml"
sections:
  human:
    entries:
      - target: {operation: "GET /invoices"}
        group: billing
        name: ls
      - target: {operation: "DELETE /customers/{id}"}
        enabled: false
```

- Each command is keyed by its method and path, as in the spec.
- Rename, group, alias, hide, or add examples to a command. Set `enabled: false` to leave it out.
- Editing an accepted suggestion's entry makes it yours: Okibi keeps it and never rewrites it.

**In the app**

Open **Config**, edit the file, and click **Save & build**. Okibi checks the file, then starts a build: "Saved. Build #12 is starting." If you only changed comments or layout, nothing builds.

**In the CLI**

```sh
okibi studio config my-cli
okibi studio config edit my-cli
okibi studio config my-cli --json
okibi studio config edit my-cli --file okibi.yml --sha <sha>
```
`config edit` opens `$VISUAL` or `$EDITOR`, then saves and builds. With `--file`, pass the `sha` from `studio config --json` so the save is refused if the file changed since you read it.

If `okibi.yml` changed in the repository since you opened it, the app asks you to **Keep mine** or **Load the new one**. Keeping yours overwrites the change.

## Review improvements

After a build, agent ready optimization works on **Login**, **Command names**, **Help and examples**, and **Workflow commands**. **Workflow commands** waits for a research step, **How people use this API**, which makes no suggestions of its own. Each change it finds is a suggestion: an `okibi.yml` diff with a title and why. Nothing changes until you accept it.

**In the app**

Open **Improvements**. Suggestions are grouped by step. Use ✓ or ✕ on one suggestion, or on a whole step. **Explain** sends a step's suggestions to the chat and asks the agent about them. Once every suggestion is decided and built, the tab goes away.

**In the CLI**

```sh
okibi studio improvements my-cli
okibi studio improvements accept my-cli <id> <id>
okibi studio improvements accept my-cli --section help
okibi studio improvements reject my-cli <id>
okibi studio improvements explain my-cli help
```
`--section` takes the step's key, shown in brackets. `--files` also prints the files a workflow suggestion adds. In the TUI, run `/improvements my-cli`.

- An accepted suggestion builds at once. While a build runs, or a Regenerate waits for Publish, the next build carries it.
- You can take back an accept until a build carries it. After that, or once it shipped, it can't be rejected.
- A rejected suggestion isn't offered again.

Improvements run once the CLI is built, and Okibi emails you when they're ready to review. To stop them while they run, click **Cancel improvements**, or run `okibi runs cancel-improvements <run-id>`. Nothing they found is kept, and the build stays as it is.

## Make a custom request

A custom request is a change `okibi.yml` can't make, such as a new command, a fix, or a missing endpoint. Okibi makes it in the chat's sandbox, asks you a question, or says why it can't. A done request's change goes into the next build. One request runs at a time, and none can start while improvements run.

**In the app**

Ask the agent in the chat. It writes the request, and the request sends itself. The studio's header says where it stands, such as "Working on your request" or "Your request is done", with **Cancel** while it runs. If its change couldn't apply because another change edited the same thing, click **Send again**.

**In the CLI**

```sh
okibi studio requests new my-cli "Add a --city flag that geocodes the name"
okibi studio requests my-cli
okibi studio requests cancel my-cli
okibi studio requests again my-cli
```
`cancel` and `again` act on the newest request unless you pass its id. In the TUI, run `/requests my-cli`.

## Publish what you changed

Every studio change ships in a build that waits for **Publish**. The studio says "Build #12 is ready. Publish it". Nothing reaches your users until you do.

**In the app**

Click **Publish it** in the studio, then **Publish**.

**In the CLI**

```sh
okibi studio my-cli
okibi runs publish <run-id>
```

A newer build replaces one that is still waiting. See [Builds](https://okibi.ai/docs/guides/builds.md#publish-a-build).

- [Builds](https://okibi.ai/docs/guides/builds.md): Follow a build and publish it.
- [okibi studio](https://okibi.ai/docs/cli/reference/studio.md): Every studio command and flag.
