Skip to content

Getting Started

Five minutes from zero to your first AI-assisted code change. This guide covers the essentials: install, configure, and start using KosmoKrator in your project. For detailed installation options, see the Installation page.

You need a terminal and an API key from at least one LLM provider (Anthropic, OpenAI, Google, Mistral, local endpoints, or any configured OpenAI-compatible provider). That’s it.

If you use the static binary, no PHP installation is required — the runtime is bundled. If you prefer the PHAR or source install, check your PHP version:

Terminal window
php -v

You need PHP 8.4 or newer for the PHAR and source methods. The static binary has no PHP requirement at all.

Pick your preferred method below. For detailed instructions, platform-specific notes, and troubleshooting, see Installation.

Static Binary PHAR From Source Termux

Auto-detects your OS and architecture. No PHP required.

Terminal window
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

Or download manually — see Installation for all platform binaries.

Requires PHP 8.4+. Download the PHAR and place it on your $PATH.

Terminal window
sudo curl -fSL https://github.com/OpenCompanyApp/kosmokrator/releases/latest/download/kosmokrator.phar \
-o /usr/local/bin/kosmo \
&& sudo chmod +x /usr/local/bin/kosmo

Requires PHP 8.4+ and Composer. Clone the repository and install dependencies.

Terminal window
git clone https://github.com/OpenCompanyApp/kosmokrator.git
cd kosmokrator
composer install

Then run with bin/kosmo.

Android via Termux. Use the PHAR path when you want the smallest install, or clone from source when you want a development checkout.

Terminal window
pkg update
pkg install php composer git curl
curl -fSL https://github.com/OpenCompanyApp/kosmokrator/releases/latest/download/kosmokrator.phar \
-o $PREFIX/bin/kosmo \
&& chmod +x $PREFIX/bin/kosmo

See Termux for renderer, storage, and Android battery-management notes.

Verify: Run kosmo --version to confirm the install succeeded.

Launch the setup wizard to configure your LLM provider:

Terminal window
kosmo setup

The wizard walks you through three steps:

  1. Pick a provider — Choose from the configured provider catalog, including Anthropic, OpenAI, Google, Mistral, local endpoints, and custom OpenAI-compatible providers.
  2. Authenticate — Most providers accept an API key entered directly. OAuth-based providers (like Codex) use a browser or device flow instead — the wizard opens a link for you to authorize. Credentials are stored locally at ~/.kosmo/config.yaml and never sent anywhere except the provider’s own API.
  3. Pick a model — Select a default model. You can override this per-session or change it in the config later.

Once setup is complete, start KosmoKrator in your project directory:

Terminal window
cd your-project
kosmo

Reconfigure anytime: Run kosmo setup again or use the /settings command inside a session to update providers and models on the fly.

KosmoKrator can also run as a Telegram bot surface backed by the same session and agent runtime. This is optional, but useful when you want to continue a session from your phone or use KosmoKrator outside the terminal.

  1. Open KosmoKrator locally and go to /settingsGateway.
  2. Enable Telegram, store the bot token, and set an allowlist for your Telegram user ID or username.
  3. Choose a session mode such as chat_user for isolated personal chats.
  4. Start the gateway from your shell:
Terminal window
kosmo gateway:telegram

Then DM the bot and start with:

Terminal window
/status

The gateway supports streaming replies, typing indicators, queued follow-up messages, inline approval buttons, and a bridge for the main Kosmo slash commands like /edit, /plan, /ask, /compact, and /models.

Once KosmoKrator is running, you’ll see the interactive prompt. Here are three ways to put it to work immediately:

Type a natural-language question about your codebase. KosmoKrator will read relevant files and explain what’s going on.

Terminal window
You > Explain how the routing works in this project

The agent searches your project, reads the relevant files, and responds with a clear explanation — no file edits, just understanding.

Describe what you want done in plain language. The agent plans the change, reads the files it needs, and writes the code.

Terminal window
You > Add a /health endpoint to the API controller

Depending on your permission mode, file writes may ask for your approval before they land. In Prometheus mode they go through automatically; in Guardian mode you review each one.

Power commands (prefixed with :) activate specialized agent behaviors with a single instruction.

Terminal window
You > :review src/Controller/UserController.php

This launches a focused code review of the specified file. The agent reads the file, analyzes it for bugs, style issues, and improvements, and presents its findings.

More power commands: Try :release to generate a conventional commit, or :trace to investigate a failing test. See the full list on the Commands page.

Use the $ prefix to dispatch a named skill directly:

Terminal window
You > $phpstan src/Controller/UserController.php

This invokes the phpstan skill on the specified file. Skills are specialized, reusable workflows you can define in your project config. See Commands for details.

KosmoKrator operates in one of three modes that control what the agent can do. Switch modes at any time with a slash command:

CommandModeDescription
/editEditFull access — read, write, search, and execute. The agent can modify files and run commands.
/planPlanRead-only access — the agent reads files and produces a plan but cannot write or execute anything.
/askAskQuestion-only — the agent reads files to answer questions but cannot suggest edits or run commands.

For the complete list of slash commands, power commands, and keyboard shortcuts, see the Commands reference.

Agent modes vs. permission modes: The table above shows agent modes, which control what capabilities the agent has (read, write, execute). Separately, permission modes control how aggressively those capabilities are auto-approved. Switch permission modes with /guardian (auto-approve safe operations), /argus (review governed tool calls), or /prometheus (auto-approve governed prompts while hard denies still apply). See Permissions for details.

Beyond the interactive session, KosmoKrator ships with several subcommands:

CommandDescription
kosmo setupRun the setup wizard (providers, models, keys).
kosmo configView and manage configuration values.
kosmo authManage provider authentication (API keys, OAuth tokens).
OptionDescription
--no-animationDisable all terminal animations. Useful in CI or screen readers.
--renderer <type>Choose the output renderer (e.g. stream, batch).
--resumeResume the most recent session.
--session <id>Resume a specific session by ID.

Global config lives at ~/.kosmo/config.yaml. For per-project settings, create .kosmo/config.yaml in your project root. Project config overrides global values — perfect for team-shared defaults, model preferences, or custom skills. See Configuration for the full reference.

You’re set up and productive. Dive deeper into the topics below to get the most out of KosmoKrator.