# Kun

> Local-first agent workbench with a desktop GUI and a terminal TUI on one runtime

- Category: Agents & Automation / Assistants & Chatbots
- Language: TypeScript
- Licence: PolyForm Noncommercial 1.0.0
- Repository: https://github.com/KunAgent/Kun
- Website: https://www.kun-agent.com
- Canonical page: https://ai-tldr.dev/tools/kun/

## In short

Kun is a local-first workbench built around finishing work rather than answering questions. It organises tasks under two primary modes: Code, for software delivery, with a Design canvas available inside the same task; and Work, for writing, research, document analysis and presentation output. It sits in the Assistants & Chatbots category of the Agents & Automation tools and is open-source, written in TypeScript and licensed PolyForm Noncommercial 1.0.0.

## Overview

Kun is a local-first workbench built around finishing work rather than answering questions. It organises tasks under two primary modes: Code, for software delivery, with a Design canvas available inside the same task; and Work, for writing, research, document analysis and presentation output. In either mode the agent reads workspace context, drafts a plan, calls tools, edits files, runs verification and leaves the evidence attached to the task.

The desktop GUI and the terminal TUI are two front ends over a single local `kun serve` runtime, so threads, goals, plans, approvals and background tasks are shared rather than duplicated across two disconnected sessions. The GUI suits watching, reviewing and controlling a run; the TUI suits keyboard-focused work. Requirements and plans can be saved inside the project by default, which puts them under version control and code review alongside the code they describe.

Sessions, preferences, logs and runtime data stay on the machine; when you pick a cloud model, prompts, attachments and task context go to that provider, and tool permissions, sensitive operations and extension permissions are surfaced in the UI for you to authorise. Kun is not tied to one model — provider presets cover ChatGPT/Codex, Claude, Gemini, Cursor, Ollama, DeepSeek, Kimi, GLM, Qwen, MiniMax and Xiaomi MiMo, configured through the Provider settings. The code is published under the PolyForm Noncommercial License 1.0.0: free for study, research and non-commercial use, with commercial use, SaaS hosting, resale or integration into a commercial product requiring a separate written licence.

## What it does

- One local kun serve runtime shared by the desktop GUI and the terminal TUI — same threads, plans, approvals and background tasks
- Code mode with project context, file editing, terminal, Git and worktrees, diffs, tests and review
- Design canvas inside the same Code task for prototypes, design systems and design-to-code context
- Work mode for Markdown drafting, PDF/Office preview, citation and analysis, spreadsheet analysis and outline-to-deck generation (Office files stay read-only)
- Automation surface: scheduled tasks, loops, hooks, MCP servers, skills and installable extensions
- Plans, todos, tool calls, file changes, browser/terminal results and approvals all attached to the task as evidence
- Local-first storage for sessions, preferences, logs and runtime data, with explicit permission prompts for tools and extensions
- Provider presets across subscriptions, plans, APIs, OpenAI/Anthropic-compatible services and self-hosted models

## Getting started

Kun ships installers for macOS (.dmg / .zip, Apple Silicon and Intel), Windows (.exe, x64) and Linux (.AppImage / .deb, x64) on its GitHub releases page. Since 0.3.8 the TUI is no longer distributed separately — it is the terminal command bundled with the desktop app.

1. Install and configure a model

   Download the current release for your platform, launch it, choose a language, then configure one model subscription, plan, API or custom provider in Provider settings.

2. Open a workspace and send a task

   Open a local project or create a workspace, then send one goal that is clearly scoped and verifiable. The agent fills in scope, risks and acceptance criteria from the project contents before it starts.

3. Use the TUI on the same runtime

   From a project directory, start the terminal client. It connects to the same local runtime as the desktop app, so a task started in one is visible in the other.

```bash
kun
```

4. Run from source

   Requires Node.js 22.19 or newer, npm, and at least one working model connection.

```bash
git clone https://github.com/KunAgent/Kun.git
cd Kun
npm ci
npm run dev        # build the runtime and start the Electron dev environment
npm run dev:tui    # build the runtime and start the terminal TUI
```

5. Build installers

   Production builds and per-platform packages are npm scripts.

```bash
npm run typecheck
npm run test
npm run build
npm run dist:mac    # or dist:win / dist:linux
```

## When to use it

- Reach for it when you want one agent runtime driving both a desktop UI and a terminal client without two separate session histories
- Reach for it when plans, approvals and verification evidence need to live next to the task and inside the repository
- Reach for it to mix software delivery and document work — code, design canvas, Markdown, spreadsheets and decks — in one workspace
- Reach for it when the agent's data should stay on your machine and every tool permission should be granted explicitly
