Skip to content
⌘K

Build and change

Create a CLI

Choose a source, name the CLI, and pick where its code goes, in the app or with okibi generate.

A new CLI needs a source, a name, and a place for its code. This page covers each choice and its limits. For the shortest path, see the Quickstart.

Choose a source

Every CLI builds from an OpenAPI spec. Give Okibi the spec, or something an agent can write it from.

SourceIn the appIn the CLI
An OpenAPI documentOpenAPI spec: paste its link or drop the file--spec ./openapi.yaml or an https:// link
Public API docsDocs or code: paste the docs link--docs https://docs.example.com/api
A GitHub repositoryDocs or code: paste the repo link--repo github.com/OWNER/REPO
Another git hostNot available--repo with any https:// git link
A local codebaseNot availableokibi generate ./path
Okibi's exampleTry our example--example
  • Use one source per CLI.
  • From a spec, the first version builds in about a minute.
  • A repository that already has an accurate OpenAPI spec can start from it: --repo github.com/OWNER/REPO --spec ./openapi.yaml (or a link). The first version builds straight from that spec, in about a minute. The CLI's source is still the repository: once its code changes, Regenerate (or a push to a watched branch) has the agent rewrite the spec from the code, starting from yours. The app's form doesn't offer this yet.
  • From docs, a repository, or a codebase, an agent writes the OpenAPI spec first. That takes about 7 minutes for docs. For a repository it depends on its size, up to about 30 minutes. The create form says how long, and okibi repos estimate github.com/OWNER/REPO does too.
  • A private GitHub repository works when the GitHub account linked to your Okibi login can read it. If it can't, the build stops with "This repo is private or doesn't exist." and offers Connect GitHub.
  • Links start with https:// or http://, with no username or password in them.
  • OpenAPI files are JSON or YAML (.json, .yaml, .yml), up to 50 MiB.
  • A local directory is uploaded as one archive, up to 200 MiB compressed. In a git repository, okibi follows your .gitignore. It always skips .git, node_modules, dist, build, target, vendor, .venv, .next, __pycache__, symlinks, and .env files (except ones ending in .example).
  • A repository builds from its default branch.

Create it in the app

  1. Click New CLI on the workspace Overview or the Projects page.
  2. If you can build in more than one workspace, pick the Workspace.
  3. Enter a Name: the command your users type.
  4. Under Start from, pick OpenAPI spec or Docs or code, and give it the source.
  5. Under Where the code goes, pick an Okibi-hosted private repo, or My GitHub to keep it in a private repo you own. My GitHub is part of Pro.
  6. Click Create CLI.

The build view follows it: Create, Build, Ready. You can leave the page: Okibi emails you when it's ready, or if the build stops.

Create it in the CLI

Terminal
okibi generate --spec ./openapi.yaml --name my-cli --workspace acme
FlagWhat it does
--nameRequired. The command your users type. --example defaults to petstore.
--spec, --docs, --repo, --example, or a directoryThe source. Use one. --spec can go with --repo as its starting spec.
--destinationhosted (the default) or github for your own GitHub (Pro).
--github-accountWith --destination github: the connected account the code goes to.
--workspaceWorkspace slug. Falls back to OKIBI_WORKSPACE, then this machine's default workspace. Ignored for workspace-locked keys.
--outWhere to unpack the finished CLI. Defaults to ./<name>.
--no-pullSkip the download.
--no-waitStart the build and return its run id.
--jsonPrint the build as JSON once it settles.
--rebuildGive a CLI whose first build never shipped a new source.

Before it uploads anything, okibi checks your plan has room for another CLI, and for My GitHub (--rebuild skips this). Then it prints the run id and follows each step. Ctrl-C only stops watching: the build keeps going, and okibi status --cli my-cli finds it again. In the TUI, /new asks for the same things. See Builds and okibi generate.

Name rules

  • 1 to 64 lowercase letters, numbers, or hyphens.
  • Starts with a letter. Ends with a letter or a number.
  • okibi is reserved.
  • One name per workspace. If my-cli already exists, rebuild it with Regenerate or okibi regenerate my-cli.

If a CLI's first build never shipped, you can give it a new source. In the app, the failed build offers Use another source (or Use other docs), Upload a new spec for a spec, or Rebuild. Each opens the form as Rebuild my-cli, where you can change the source. From the terminal, run okibi generate --rebuild --name my-cli with the new source.

Rename it

Open Settings > Basics. Click Rename next to Command to rename the CLI everywhere, its hosted repository included. Click Rename next to Project name to change only the name the app shows.

You can't rename a CLI while it builds or publishes.

What happens next

  1. v1 builds. It runs the steps Spec, Codegen, Lint, Build, and Test. On Spec, it reads your spec, or an agent writes it first.
  2. You can use it. v1 is ready to install while agents improve it. The first build publishes on its own.
  3. Agent ready optimization suggests improvements to login, command names, help and examples, and workflow commands. Nothing changes until you accept them in the studio.

The API base URL comes from the spec. To change it later, see Change the API endpoint.

Next steps