Skip to main content
The MKA1 Code CLI runs the coding agent in your terminal. Its executable is mka1-code; the MKA1 API CLI uses mka1 to call API operations.

Install the CLI

On macOS, Linux, or WSL, run the install script in a terminal:
Bash
The script selects the build for your processor, verifies its checksum, and installs mka1-code in ~/.local/bin without sudo. It does not change your shell configuration. If that folder is not on your PATH, the script prints an export PATH line to add to your shell’s startup file, such as ~/.zshrc for Zsh or ~/.bashrc for Bash. Open a new terminal and confirm that the CLI runs:
CLI
To update the CLI, run the install script again. To install it in another folder, set MKA1_INSTALL_DIR:
Bash

Install a downloaded package

On Windows, or to install your organization’s distribution, download the CLI package and install it yourself. For an organization distribution, follow the organization download steps and choose the CLI package. Otherwise, download the package for your operating system and processor. These links point to MKA1 Code 1.57.4.
Open a terminal in the folder containing the downloaded executable. Replace <downloaded-file> with its exact filename, then copy it into a user-owned command directory:
CLI
The final command should display CLI help. The export applies to this terminal only. To use the CLI in new terminals, add the same export PATH line to your shell’s startup file, such as ~/.zshrc for Zsh or ~/.bashrc for Bash.

Sign in and start a session

After installing the executable, open a terminal in your project directory, sign in, and start an interactive session:
CLI
Check the individual results from doctor before starting work; it identifies account, model-catalog, runtime, and connector problems. Describe a task in the terminal, follow the agent’s progress, and respond to questions or approval requests. Use /model to select a model, @ to reference project files, /attach <path> to attach an image, and /sessions to find previous work. Use /help to see the available interactive commands. To resume work, find its identifier with /sessions and pass it to --resume:
CLI

The /help output lists commands for agents, account access, usage, plugins, and diagnostics.

Run a task from a script

For a single task, use run:
CLI
Add --output-format json when another program needs to consume the result. The CLI returns one result object after the run finishes:
CLI
A noninteractive run has no way to answer an approval request or clarifying question. The CLI refuses a request that needs that interaction instead of waiting indefinitely, so use an interactive session for work that needs your decisions. Scripts should inspect the result status and exit code before treating the task as successful.

Find models and previous sessions

Use these commands outside the interactive screen when you need to inspect setup or choose a saved session:
CLI
whoami identifies the active account. models --refresh reloads the gateway catalog. sessions lists recent sessions; add --all to include older ones or --json for structured output. Use the displayed session ID with --resume to continue the intended conversation. In an interactive session, /plan controls planning and /permissions selects the approval policy. /compact summarizes older history, while /usage shows usage. Use Ctrl + C to stop an active turn; when idle, the CLI asks whether you want to exit. /exit closes the interface.

Choose an output format

Diagnostic errors go to standard error. Keep those separate from structured standard output when integrating the CLI into a script. A final response alone is not proof that a test passed: inspect the task status and the reported command result. For a prompt stored in a file, use standard input:
CLI
Put the complete request in task.txt, including its project assumptions and expected output. Run the command from the intended project directory. Continue with Usage and troubleshooting.