Open source · Kimi K2.7 · Cloudflare Workers AI

A terminal coding agent on your Cloudflare account.

Open-source, powered by Kimi K2.7 on Cloudflare Workers AI — with AI Gateway observability.

Install View source
kimiflare - kimi k2.7 cli code editor on cloudflare ai gateway | Product Hunt
zsh
kimiflare Ready when you are.
  › Explain this codebase
  › Find and fix a bug
  › Refactor a file
Type a message or /help for commands · ctrl-c to exit · shift+tab to cycle modes
add a /health endpoint
────────────────────────────────────────
thinking… I'll need to read the server file first, then add the endpoint.
read(src/server.ts)
read(src/server.ts)
edit src/server.ts
Permission requested
tool: edit
action: edit src/server.ts
@@ -42,6 +42,10 @@
  app.get('/', …)
+  app.get('/health', (_, res) => res.json({ ok: true }))
  …
Allow once   Allow for this session   Deny
edit src/server.ts
Done — added /health that returns { ok: true }.
────────────────────────────────────────
■ Update landing page terminal (12s · ↑ 2.3k tokens)
Read current UI components
Update terminal simulation
Create PR
[edit] k2.7 · medium · thinking…
in 2,847 (1,203 cached) · out 412 · ctx 12% · 0.00321

Recently shipped

  • Turn supervisor architecture with graceful preemption
  • Web search, GitHub read-only, and headless browser tools
  • Tiered skill routing with TUI visibility
  • Extensible JSON themes with WCAG contrast validation
  • KIMI.md drift detection with memory-based staleness
  • Fuzzy @ file picker with inline filtering
  • AI Gateway as the default backend with per-request logs, caching, and cost reconciliation
  • Per-turn latency and per-feature cost breakdown in /cost
  • Context-window guardrails

Coming next

  • Session tree for branching conversations
  • Cost attribution dashboard
  • More MCP server integrations
See full changelog →

What it does

01

Plan / Edit / Auto modes

Plan mode blocks all mutating tools for safe research. Edit mode prompts per call. Auto mode approves everything for trusted tasks.

02

Live task panel

For multi-step work, the agent publishes a task list with progress icons, elapsed time, and token deltas. Multi-step work feels managed.

03

Image understanding

Drop image paths (PNG, JPG, WebP, GIF, BMP up to 5 MB) into any prompt. The model sees them inline — perfect for UI reviews, diagrams, and screenshots.

04

Extensible JSON themes

Fully customizable color palettes with WCAG contrast validation. Pick from built-in presets or define your own. Live preview with Ctrl+T.

05

Web search, GitHub, and headless browser

Research the web, read GitHub repos, and fetch JavaScript-rendered pages — all without leaving your terminal.

06

LSP semantic code intelligence

Hover, go-to-definition, references, and diagnostics via Language Server Protocol. Auto-configured per project with an interactive wizard.

07

Turn supervisor with tiered skills

The agent picks the right skill depth for the task — from quick edits to deep research — with graceful preemption and visible TUI indicators.

08

Streaming reasoning

Toggle the model's chain-of-thought with /reasoning or Ctrl-R. See how it thinks in real time.

09

Session persistence

Every turn is auto-saved. /resume lists past sessions with message counts in a paginated picker. Never lose your place.

10

Smart permissions

Bash session-allow is keyed by the first token (allow all git commands). Write/edit show a unified diff before you approve.

11

262K context window

Read entire modules, large configs, and full stack traces without the model losing track. All on your Cloudflare account.

12

MCP server integration

Plug in external tools via the Model Context Protocol — local stdio servers or remote SSE endpoints. GitHub, Sentry, docs search, databases, and more.

13

AI Gateway — observability by default

Every request flows through your own Cloudflare AI Gateway. Per-request logs, response caching with configurable TTL, authoritative per-turn cost from the logs API, and a per-feature breakdown in /cost. The status bar shows the gateway-confirmed cost and latency for the last turn.

14

Explicit cross-session memory

The agent never surveils your conversation. Memories are stored only when you ask — via remember, recall, and forget tools — with SQLite + embeddings for durable, privacy-respecting retrieval across sessions.

kimiflare Node.js TUI
user msg → agent loop → runKimi()
POST SSE via your AI Gateway
gateway.ai.cloudflare.com logs · cache · cost

Workers AI @cf/moonshotai/kimi-k2.7-code
tool result ← tool executor ← tool_calls
permission modal for write / edit / bash

Three ways to work

01

Plan

Read-only research. Mutating tools are hard-blocked. Ask "plan a refactor" and the agent investigates without touching your filesystem. Review, then exit plan mode to execute.

02

Edit

Default mode. The agent calls tools freely for read-only work; mutating tools pause for your approval with a unified diff preview.

03

Auto

Autonomous execution. Every tool call is auto-approved. Use for trusted, well-scoped tasks. The agent still warns before irreversible actions.

How we compare

Capability kimiflare Claude Code Aider Gemini CLI Codex CLI
Open source Yes (MIT) No Yes Yes Yes
Runs on your own cloud Yes — your Cloudflare account No — Anthropic API BYO API key No — Google API No — OpenAI API
Default model Kimi K2.7 (Workers AI) Claude Model-agnostic Gemini GPT / Codex
Context window 262K tokens 200K+ Varies by model 1M Varies by model
Authoritative per-turn cost Yes — AI Gateway logs Estimated Estimated Estimated Estimated
Image understanding Yes Yes Partial Yes Yes
MCP extensibility Yes Yes No Yes Yes
LSP code intelligence Yes Partial No No No

Comparison reflects publicly documented capabilities at time of writing and may change. See the detailed write-ups: Claude Code alternative · vs Claude Code · vs Aider · vs Gemini CLI · vs Codex CLI.

Get started

bash
# Install
npm install -g kimiflare

# Run — onboarding sets up your Cloudflare account
kimiflare

Or run without installing: npx kimiflare

bash
# Interactive TUI
kimiflare

# One-shot mode
kimiflare -p "summarize PLAN.md"

# Auto-approve for scripts
kimiflare -p "..." --dangerously-allow-all

# Override model
kimiflare --model @cf/moonshotai/kimi-k2.7-code

# Stream reasoning to stderr
kimiflare --reasoning

# Image understanding — reference images inline
kimiflare
kimiflare -p "explain this diagram.png"

Frequently asked questions

What is kimiflare?

kimiflare is an open-source, terminal-based AI coding agent — a self-hosted alternative to Claude Code — that runs on your own Cloudflare account. It is powered by the Kimi K2.7 model on Cloudflare Workers AI, with every request routed through your own Cloudflare AI Gateway for per-request logs, response caching, and authoritative cost.

Is kimiflare a Claude Code alternative?

Yes. kimiflare is an open-source Claude Code alternative. It offers the same terminal-first agentic workflow — reading and editing files, running commands, web research, and image understanding — but runs on Cloudflare Workers AI using Kimi K2.7 on your own account, and is MIT-licensed. See the Claude Code alternative page for a full breakdown.

How do I run an AI coding agent on my own Cloudflare account?

Install kimiflare with npm install -g kimiflare (or run npx kimiflare), then run kimiflare. The onboarding flow connects your Cloudflare account and AI Gateway. All inference runs on Cloudflare Workers AI under your own credentials — no third-party API keys are required.

What model does kimiflare use?

kimiflare uses Kimi K2.7 (@cf/moonshotai/kimi-k2.7-code) on Cloudflare Workers AI, with a 262K-token context window. You can override the model with the --model flag.

What is an AI coding harness?

An AI coding harness is the program that wraps a large language model with tools, permissions, context management, and a user interface so it can act as an autonomous coding agent — reading and editing files, running commands, and researching the web. kimiflare is a Cloudflare-native, open-source coding harness for the terminal. Read more in What is an AI coding harness?

How much does kimiflare cost?

kimiflare itself is free and open source (MIT). You pay only Cloudflare's usage for Workers AI inference on your own account. Because every request flows through your Cloudflare AI Gateway, kimiflare shows authoritative per-turn cost from the gateway logs in the /cost command.