kotlin-agent is a Kotlin/JVM coding agent CLI that runs locally in your workspace, uses the OpenAI /responses API, and requires approval before mutating actions.
./gradlew installAgent
scripts/install-cli.sh
agentSet OPENAI_API_KEY before launching agent, or provide apiKey in config. If ~/.local/bin is not on your PATH, add export PATH="$HOME/.local/bin:$PATH".
- Runs in the current directory by default, or against an explicit workspace with
--workspace. - Auto-approves read-only tools and requires approval for mutating tools.
- Persists sessions, approvals, and artifacts in
.agent/. - Streams model responses through the OpenAI
/responsesAPI. - Ships with
list_files,read_file,search_files,run_shell, andapply_patch.
agentstarts the REPL in the current directory.agent --workspace /path/to/repostarts the REPL for an explicit workspace.agent resume <session-id>resumes a saved session and enters the REPL.agent status [session-id]prints recent sessions or one specific session.agent toolslists the available tools.agent versionprints the packaged version.
REPL mode requires an interactive terminal. In non-interactive environments, use commands such as agent status and agent tools.
The agent CLI reads configuration in this order:
- Environment variables:
OPENAI_API_KEY,OPENAI_BASE_URL,AGENT_MODEL - Workspace config:
.agent/config.properties - Global config:
~/.config/agent/config.properties
Default values:
baseUrl=https://api.openai.com/v1model=gpt-4.1-mini
Example config.properties:
baseUrl=https://api.openai.com/v1
model=gpt-4.1-mini
apiKey=your-api-keyagent-core: domain model, orchestration loop, approvals, session persistence, and SQLite-backed state.agent-provider-openai: OpenAI-compatible streaming provider adapter.agent-tools-local: local filesystem, search, shell, and patch tools.agent-cli: terminal UI, command parsing, config loading, and engine wiring.
- Requires JDK 17+ to build locally.
- Run
./gradlew test verifyAgentInstallDistto execute the test suite and verify the generated launcher. scripts/install-cli.shinstalls the distribution under~/.local/share/agent/<version>and symlinks~/.local/bin/agent.
Licensed under the MIT License.
