Skip to content
Kortix
Esc
↑↓navigate↵open⌘Jpreview
On this page

CLI

Install the kortix CLI, sign in, run the everyday loop, script it in CI or from a coding agent, and find any command.

kortix is the Kortix command line. It does from a terminal what the web app does: create and clone projects, run sessions, review change requests, and configure agents, connectors and secrets. Use it on your own machine, in CI, from a coding agent, and inside a session sandbox, where it is already installed and signed in.

curl -fsSL https://kortix.com/install | bash
kortix login
kortix --help

Install

The install script supports macOS and Linux on x86_64 and arm64. On Windows, run it inside WSL. It does these steps:

  1. Downloads the release binary for your system from GitHub Releases.
  2. Checks it against the release’s SHA256SUMS. A missing or wrong checksum stops the install.
  3. Puts the binary in ~/.kortix/kortix.
  4. Links kortix and kortixt (the TUI) into /usr/local/bin. If that directory is not writable, it uses ~/.local/bin when it exists, else sudo.
Variable Effect
KORTIX_VERSION=<x.y.z> Install that release instead of the latest.
KORTIX_CHANNEL=dev Install the dev channel build (dev-latest).
KORTIX_BIN_DIR=<dir> Link the commands into this directory instead of /usr/local/bin.
curl -fsSL https://kortix.com/install | KORTIX_VERSION=0.13.52 bash

Check the install with kortix version. To update or remove the CLI, see Maintain the CLI.

Sign in

kortix login

The CLI signs in to one Kortix instance at a time. An instance is a host. The order is always host › account › project › session: you sign in to a host, pick an account in it, pick a project in that account, and run sessions in the project.

kortix login does these steps:

  1. Opens your browser. You approve the CLI there, and the token comes back on a local callback.
  2. Selects your account. With one account it picks it. With several it asks. --account <slug> skips the question.
  3. Sets a default project for the host. --no-project skips this step.
Flag Effect
--token <token> Sign in with a token, with no browser. Use it on a headless machine.
--account <slug> Select this account without a prompt.
--no-project Do not set a default project.
--host <name> Sign in to this host instead of the active one.
--api <url> The API URL for the host.

To create a token for --token, see API keys and tokens.

Hosts

Every host keeps its own login. You use these two built-in hosts:

Host URL
cloud https://api.kortix.com. The default.
selfhost http://localhost:13738. kortix self-host start sets it to your instance’s URL.

kortix hosts ls also lists local-dev and kortix-internal-dev. Kortix uses them to develop Kortix. You do not need them.

Task Command
Add a host and sign in kortix hosts add <name> --url <api-url> --login
Switch the active host kortix hosts use <name>
Run one command on another host kortix <command> --host <name>
List hosts and their login state kortix hosts ls
Show one host or the active one kortix hosts info [<name>] (--json)
Show the signed-in user on a host kortix hosts whoami [<name>]
Remove a host you added kortix hosts rm <name>. A built-in host is reset, not removed.
Sign out of a host kortix logout, or kortix hosts logout <name>
Switch the active account kortix accounts use <slug>

The CLI changes a remote http:// URL to https://. A private address keeps http://: localhost, a LAN IP, a name that ends in .local, .lan, .internal or .home.arpa, and a name with no dot, such as a Docker Compose service.

The logins live in ~/.config/kortix/config.json, with file mode 0600. KORTIX_CONFIG_FILE sets another path.

Check who you are

Command Output
kortix whoami The host, the user, the active account, the default project and the token context. --json for scripts.
kortix token Only the token context: the token kind (user, project or session token), its project, session and agent, and its connector and permission grants. It never prints the token itself.

Which project a command uses

A project command runs against the first project it finds in this order:

  1. --project <id> on the command.
  2. .kortix/link.json in the current directory. The CLI does not look in parent directories.
  3. The KORTIX_PROJECT_ID environment variable.
  4. The host’s default project.
Task Command
Set the host’s default project kortix projects use [<project_id>]
Bind the current directory to a project kortix projects link [<project_id>]
Remove the binding kortix projects unlink
Clear the default project kortix projects unset

kortix projects use also switches the active account to the project’s account. kortix projects link writes .kortix/link.json and works only in a directory that has a .kortix/ directory or a kortix.yaml. kortix projects clone and the first kortix ship write the link for you.

The link also records the host. A command in a linked directory goes to that host, whatever host is active.

A session ID works across projects. If the session is not in the resolved project, and you did not pass --host or --project, the CLI searches your other accounts and logged-in hosts. The 8-character short ID from kortix sessions ls works anywhere a session ID goes.

The everyday loop

The loop runs on the project’s git repository. kortix ship pushes your branch, each session works on its own branch, and you merge its change request. The Git page covers the repository, cloning, pushing from any git client, session branches and change requests.

Get a project

Start a new project, or clone an existing one:

kortix init my-agent && cd my-agent      # new project from the starter
kortix projects clone <project_id> my-agent

kortix projects clone clones through Kortix with your Kortix login and installs a git credential helper, so plain git pull and git push work in the clone.

Push your changes

kortix ship

kortix ship validates kortix.yaml, commits every change (git add -A), asks for missing secrets, pushes the current branch to the branch with the same name, and asks you to connect declared connectors. The first run also creates the project. kortix deploy is the same command.

Start a session

kortix sessions new --prompt "Add a skill that drafts the weekly status report"

The agent works in its own sandbox, on its own branch.

Follow it

kortix chat <session_id>              # line chat, or -p "…" for one prompt
kortix connect <session_id>           # the OpenCode TUI in your terminal
kortix tui                            # the whole product as a terminal app
kortix sessions wait-for <session_id> # block until the agent is done

Review and merge

kortix cr ls
kortix cr diff 1
kortix cr merge 1
git pull

1 is the change request number from kortix cr ls. kortix cr request-changes 1 --message "…" sends the note to the session that opened it.

Work with sessions from a terminal

The commands below are kortix sessions <subcommand>. chat and connect also exist at the top level: kortix chat, kortix connect. Sessions explains the behavior behind each one.

Start and list

Command Effect
new --prompt "<text>" Start a session. --agent <name> and --model <id> override the project defaults. --wait blocks until the sandbox is ready. --json prints the session object.
new … --with-file <path> Upload a local file to /workspace/incoming/<name> before the prompt goes in. Repeatable.
new … --label <label>, --meta <key>=<value> Classify the session. Both are repeatable.
new … --connector <alias>=<connection-id> Bind a connection to the session. Repeatable. --no-connectors binds none.
ls List sessions with who started each. --mine, --shared, --automated, --search <q>, --label <label>, --children <session_id>. The list leaves out the sessions you archived and marks a pinned session (pinned). --pinned lists only your pinned sessions, --archived only your archived ones. --deleted lists the deleted sessions you can restore, with their full IDs and the date each one stays restorable.
pin <session_id>…, unpin <session_id>… Pin sessions in your own list, or unpin them. Only your list changes.
archive <session_id>…, unarchive <session_id>… Take sessions out of your own list, or put them back. Archiving unpins a session and does not stop it.
status One line per active session with what its agent is doing now. --all adds stopped sessions.
info <session_id> One session.

Talk

Command Effect
chat [<session_id>] A line chat with the agent. With no ID it picks your most recent running session. --new starts one.
chat <session_id> -p "<text>" Send one prompt, print the reply and exit. --json prints the reply as JSON.
chat <session_id> -p "<text>" --queue Store the prompt in the session’s inbox and return at once. It survives a sleeping or busy sandbox.
chat <session_id> -p "<text>" --steer Give the prompt to the running turn. The agent reads it at its next step. With no turn running, it starts one.
queue <session_id> The inbox: ls, rm <prompt-id>, now <prompt-id>, hold, release.

Watch

Command Effect
log [<session_id>] The recent messages, read-only. A stopped session is read from its saved transcript and is not woken. --limit <n> (default 10).
wait-for <session_id> Block until the agent is done. Exit 0 done, 3 blocked on a question or permission, 124 timed out. --timeout <seconds> (default 300).
connect [<session_id>] Attach the OpenCode TUI. With no ID it shows a picker. A pi session has no TUI to attach: the command exits 1. Details are on TUI.
digest A short review of recent sessions. --since 7d.

Unblock

Command Effect
pending <session_id> The questions and tool permissions the agent waits on.
approve <session_id> [<request-id>] Answer a permission. --always, --reject, --message "<why>".
answer <session_id> [<request-id>] Answer a question. --option <value>, --text "<answer>", --reject.
approvals <session_id> Connector calls a policy holds for a person: ls, approve <execution-id>, deny <execution-id>.

Files and ports

Command Effect
cp <src> <dst> Copy between your machine and a sandbox, or between two sandboxes. A sandbox path is <session_id>:<path>. -r for directories.
files <session_id> <sub> The live /workspace: ls, status, find, write, touch, mkdir, mv, rm.
attachments <session_id> Uploads and files the agent showed. Works while the session is stopped. --download <id>, --all, --out <dir>.
preview <session_id> [port] Print a preview URL for a sandbox port. The default port is 3000.
forward <session_id> --port <sandbox>[:<local>] Forward a sandbox port to localhost, HTTP and WebSocket. Runs until Ctrl+C.
shell [<session_id>] A raw terminal in the sandbox, with no agent. --new opens a fresh one.

Lifecycle

Command Effect
stop <session_id> Stop the sandbox. The disk is kept.
start <session_id> Wake the session. --wait blocks until it is ready.
restart <session_id> Stop and start the sandbox in place. The disk is kept. When the sandbox is gone, boot a new one from the session’s branch.
reload <session_id> Pull the repository and load the base branch’s agent config into the running sandbox. It refuses during a turn unless you pass --force. --status only reports whether the session is behind.
model <session_id> <model-id> Change the model. A running sandbox restarts its agent runtime, which ends the current turn.
compact <session_id> Summarize the conversation and continue from the summary.
rename <session_id> <name> Set the name. "" restores the automatic title.
update [<session_id>] Add or remove labels and metadata.
rm <session_id>… Stop and delete sessions. Each one is restorable for 30 days, and its branch is kept. Prints the restore command for each session. --json adds restore_until and project_id.
restore <session_id> Restore a deleted session within 30 days. Pass the full session ID (ls --deleted lists it), and --project when the session is not in the linked project.

Access

Command Effect
share <session_id> --mode private|project|members Set who in Kortix can open the session. --member <id|email>, --group <id>.
scope <session_id> Read or replace the session’s secrets and connections. The change applies to the next prompt.
links <session_id> Public links to one preview port or one file: ls, create, revoke <share-id>.
open <session_id> Open the session in the web app.

Run in CI and scripts

Give the job a token in the environment. The CLI then needs no kortix login:

Variable Value
KORTIX_TOKEN A personal access key (kortix_pat_).
KORTIX_PROJECT_ID The project to act on, when the job runs outside a linked directory.
KORTIX_API_URL The host’s API URL. Leave it unset for Kortix Cloud.

KORTIX_TOKEN outranks any stored login, and the CLI never writes it to disk. Create a key that can reach only one project:

kortix tokens new ci-nightly --project <project_id> --expires 90d

The key prints once. Store it in your CI secret store. --expires takes an ISO-8601 date or a span such as 30d, 12h, 6w or 1y.

# .github/workflows/nightly-report.yml
name: Nightly report
on:
  schedule:
    - cron: "0 6 * * *"
jobs:
  report:
    runs-on: ubuntu-latest
    env:
      KORTIX_TOKEN: ${{ secrets.KORTIX_TOKEN }}
      KORTIX_PROJECT_ID: ${{ vars.KORTIX_PROJECT_ID }}
    steps:
      - run: curl -fsSL https://kortix.com/install | bash
      - run: |
          id=$(kortix sessions new --prompt "Write the nightly report" --wait --json | jq -r .session_id)
          kortix sessions wait-for "$id" --timeout 1800
          kortix sessions log "$id" --limit 1

Pipe --json output into jq. Update checks are off when CI is set or stdout is not a terminal. To start sessions on a schedule inside Kortix itself, use Triggers & reminders.

Use Kortix from your coding agent

A coding agent such as Claude Code, Codex, Cursor or pi needs only the binary, a login and the platform manual.

Install and sign in

Install the CLI and run kortix login, or set KORTIX_TOKEN in the agent’s environment.

Check the setup

kortix doctor

kortix doctor checks the login and the project, starts a throwaway session, sends ping, waits up to 180 seconds for a reply and deletes the session. It exits 0 when every check passes and 1 when one fails. --no-session stops after the login and project checks.

Load the manual

kortix system-skills get kortix-system

The host serves the Kortix system skills live, so they match the version you talk to. Tell your agent to run this command first.

Wire the project into local tools

In a cloned project, run:

kortix init --force

It asks which local coding tools to wire. --primary <tool> and --agents <list> answer without a prompt: opencode, claude, codex, pi, cursor. It links the project’s skills where each tool looks for them, and adds a root AGENTS.md pointer for Codex, pi and Cursor. It does not change how sessions run in the cloud.

Delegate work

id=$(kortix sessions new --prompt "Fix the failing export test" --wait --json | jq -r .session_id)
kortix sessions wait-for "$id" --timeout 900
case $? in
  0) kortix sessions log "$id" ;;
  3) kortix sessions pending "$id" ;;
esac

Exit 3 means the agent waits on a question or a permission. Answer it with kortix sessions answer or kortix sessions approve, then wait again.

An MCP client can use Kortix without the CLI. See Kortix MCP server.

Inside a session sandbox

Every sandbox has the CLI installed and signed in. The platform sets KORTIX_TOKEN, KORTIX_API_URL and KORTIX_PROJECT_ID, so the agent runs commands with no login and no link. The token is a session token: kortix token shows its session, its agent and its grants. It acts only on the session’s own project.

Commands an agent uses:

Command Purpose
kortix connectors call <slug> <action> [json] Call a connector action. See Connectors.
kortix secrets request <NAME> Mint a link, valid for 7 days, for a person to enter a secret value.
kortix secrets sync Pull this session’s secrets and grants now.
kortix cr open --title "<text>" Open a change request from the session branch. Inside a session it fills --head itself.
kortix review submit --kind <kind> --title "<text>" Submit an output, a decision or a batch for review.
kortix remind "<prompt>" --in 24h Prompt this session again later. Reminders are a project flag, on by default; kortix projects features disable reminders turns them off.
kortix sessions update --label <label> Label the session the agent runs in.

What an agent may do is set by its kortix_permissions in kortix.yaml. When the API refuses a command, the CLI prints the token kind, the agent and its grant. See Agents & permissions. These commands are refused for an agent session’s token, whatever the grant:

  • kortix projects cli-tokens new and rm
  • kortix gateway keys (ls, new, rm)
  • kortix sandboxes provider <name> and --clear

kortix update is refused in a sandbox. The platform manages the binary: restart the session to get the current CLI.

A .kortix/link.json for another project needs a stored login for that project’s host. Run kortix login in the sandbox first.

Check and validate

Command Effect
kortix validate Check kortix.yaml against the schema, lint each sandbox.templates Dockerfile, and warn about large files in git. Exit 0 valid, 1 errors, 2 file not found. --file <path>, --json, --no-dockerfile-lint. kortix ship runs the same checks.
kortix schema Print the kortix.yaml JSON Schema. --version 1|2|3 picks one version. --url prints the schema’s URL instead, such as https://kortix.com/schema/kortix.v3.schema.json for version 3.
kortix doctor Check the login and project, then start a throwaway session, send ping and wait for a reply. --no-session, --keep-session, --prompt "<text>", --timeout <seconds> (default 180). Exit 0 pass, 1 fail.
kortix system-skills list List the Kortix system skills. kortix skills is the same command.
kortix system-skills get <name> Print one skill and the paths of its reference files. --full adds every reference file.
kortix system-skills file <name> <path> Print one reference file.
kortix system-skills path [<name>] Print the skill’s directory on disk.

The schema fields are on kortix.yaml reference.

Command map

Every group prints its subcommands and flags with kortix <group> --help. The linked page explains the feature.

Sign in, sessions and the CLI

Group Purpose Page
login, logout, whoami, token, hosts Sign in and pick a host. Sign in
sessions, chat, connect Start, talk to and manage sessions. Work with sessions from a terminal
tui The terminal app. TUI
validate, schema, doctor, system-skills Check the project and the setup. Check and validate
version, update, uninstall, feedback Manage the CLI itself. Maintain the CLI

Projects and git

Group Purpose Page
projects List, clone, link, use, rename, delete; feature flags (features); project CLI tokens (cli-tokens). Projects
init Create a project directory from the starter. Projects
ship Validate, commit and push. The first run creates the project. Git
files Read the committed repository: ls, cat, search, history, branches, commits, show, diff, download. Git
cr Change requests: ls, show, diff, open, merge, merge-preview, request-changes, close, reopen, version-diff. Git
review The review inbox: change requests, held connector calls and submitted outputs. Git
marketplace Search, show and install marketplace items. Projects

Configure

Group Purpose Page
agents The default agent, model pins, scope and agent config. Agents & permissions
tools List the project’s tools; eject a Kortix tool to change it. Tools
models The models the project offers and its default model. Models
providers Connect model providers with an API key or OAuth. Models
gateway LLM gateway routing, budgets, keys, usage, logs and tests. Models
secrets Project secrets, their exposure and who can use them. Secrets
env Pull secret names into a .env file, or push a .env file as secrets. Secrets
sandboxes Sandbox templates, builds, health and the provider pin. Sandboxes & previews
connectors Add, connect, call and govern connectors. moves and move move Pipedream and Composio connectors to Kortix. Connectors
channels Slack, Microsoft Teams and email, and their bindings. Slack, Teams & email
triggers List, add, fire, pause and resume triggers. Triggers & reminders
reminders, remind Prompt one session later or on repeat. Triggers & reminders
apps Deploy and manage Apps. Apps

Administer

Group Purpose Page
accounts List and switch accounts. Accounts & access
members Invite and remove people, and change their roles. Accounts & access
groups Groups of people that share a role. Accounts & access
access Grant, list and revoke role assignments. Accounts & access
roles, permissions System and custom roles, and the permission catalog. Accounts & access
grants Assign agents to members or groups. Accounts & access
audit Read the account audit log. Accounts & access
tokens Personal access keys, service accounts and connected apps. Sign-in, SSO & API keys
billing Read the plan, credits, transactions and costs. Plans & credits

Self-host

Group Purpose Page
self-host Set up, start, update and stop your own Kortix instance from Docker images. Self-hosting

Conventions

  • kortix, kortix help and kortix --help print the same screen: your host, account and project, then every command group.
  • --host <name> sends one command to another host. --project <id> sends it to another project.
  • --json, on a command that supports it, prints JSON. On any command it turns off the host and update notices, also on stderr.
  • A mistyped command exits 2 and, when a command name is within two edits, prints it as a suggestion. It never scaffolds a project directory. Only kortix init does that.
Exit code Meaning
0 Success.
1 The command failed. The reason is on stderr.
2 Usage error: an unknown command or subcommand, a bad flag or a missing argument. kortix validate also returns 2 when the file is not found.
3 kortix sessions wait-for only: the agent is blocked on a question or a permission.
124 kortix sessions wait-for only: the timeout passed.
Alias Command
deploy ship
attach connect
session sessions
skills system-skills
perms permissions
remind reminders add
t, kortixt tui
sessions pause / wake sessions stop / start
sessions wait sessions wait-for
sessions messages, sessions history sessions log
sessions overview, sessions ps sessions status
sessions terminal, sessions ssh sessions shell
sessions copy sessions cp

Maintain the CLI

Command Effect
kortix version Print the version. kortix --version and -v do the same.
kortix update Run the install script again and replace the binary.
kortix uninstall Remove the binary, the kortix and kortixt links, and ~/.kortix, and sign out of the active host.
kortix feedback "<message>" Send product feedback to the Kortix team.

The bare kortix command checks for a new release at most every 6 hours and offers to install it. Other commands show a one-line notice from the cached check. Turn the check off with KORTIX_NO_UPDATE_CHECK=1. Keep the notice but skip the question with KORTIX_NO_UPDATE_PROMPT=1.

kortix uninstall asks before it removes anything:

Flag Effect
-y, --yes Skip the question.
--keep-auth Keep the stored login for the active host.
--keep-home Keep ~/.kortix. Only the binary and the links go.

kortix feedback takes --kind bug|idea|friction (default idea). Inside a session it tags the report with the session and project IDs.

Was this page helpful?