Skip to content

remeh/mok

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

113 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mok

mok is a terminal-based coding agent harness with multi-agent flow orchestration for complex executions.

Developed in Go, uses Bubble Tea for the TUI.

Talks to OpenAI-compatible LLM endpoints with SSE streaming. Handles tool calls (read, write, edit, bash), thinking and loops. Strong focus on running perfectly with non-frontier models.

Features

  • Interactive TUI with markdown rendering and scrollable message history.
  • Big focus on local models quirk handling (Gemma, Qwen XML tool calls, empty responses, JSON repair).
  • Multi-agent flow orchestration, chain agents with isolated context and handoff summaries.
  • Non-interactive prompt mode (-p) for one-shot queries and scripting.
  • Streaming text and reasoning/thinking tokens.
  • Built-in tools: file read, write, edit (unified diff), bash (timeout, truncation).
  • Configurable allowlist or blocklist for bash command execution.
  • Automatic context compaction with LLM-driven summarization and hard cut fallback.
  • Session save/restore (-session).
  • Slash commands: model switching, debug toggle, compaction, flow selection, YOLO mode.

Screenshot Screenshot 2

Multi-Agent Orchestration

You define agents, each with its own prompt, model, and config overrides. Then you chain them into flows that run sequentially, with a handoff summary passed between each step. Each agent runs in its own isolated context.

Run a flow from the TUI with /flow <name>. The status bar shows progress like flow: implementation [2/5] coder.

See mok.example.yaml for several examples (feature implementation, security audit, ...).

Configuration

Copy the example config to your config directory and customise it:

$ mkdir -p ~/.config/mok
$ cp mok.example.yaml ~/.config/mok/config.yaml

config.yaml can be stored in these locations:

  • ./mok.yaml (current directory)
  • ~/.config/mok/config.yaml (user config)

See mok.example.yaml for all supported options: global settings, bash confirm policies, multi-agent definitions, and flows...

Build

$ go build -o mok cmd/mok/main.go

Quick Start

$ ./mok -t 120 -p "Write a Python function to sort a list" \
    -endpoint http://localhost:8000/v1 -model gemma4-e4b

Or run the TUI:

$ ./mok

Tests

$ go test ./...

Copyright (c) 2025 Remy Mathieu

About

mok is terminal-based coding agent harness with multi-agent flow orchestration for complex executions.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages