maki README

项目的 README,来自 github.com/tontinton/maki。合并为一个 markdown 文件:README.md。

An AI coding agent optimized for minimal use of context tokens, while providing a great user experience.

I got frustrated with existing coding agents and hitting hourly/weekly token limits, so I built maki. It's a single Rust binary with a TUI, a bunch of tricks to keep junk out of the context window, and a Neovim style Lua plugin system.

curl -fsSL https://maki.sh/install.sh | sh

Other platforms and ways to install are below. Docs · Plugins · Discord

Benchmarks

Maki 0.5.5 at 70% pass rate and $2.06 per pass, against the FrontierHarness Eval baselines

FrontierHarness Eval benchmark result, click here to download report.zip

Features

Context efficiency

The whole conversation is re-sent to the model on every turn, so anything that lands in context is paid for again and again until the session ends. Most of maki is about keeping stuff out of there. The long version is in Token Economy.

User experience

Safety

Lua plugins

Outside the TUI

Supported providers

Provider How to auth
Anthropic ANTHROPIC_API_KEY only (using OAuth is against TOS). Bedrock supported via CLAUDE_CODE_USE_BEDROCK=1.
OpenAI OPENAI_API_KEY, or OAuth via maki auth login openai
xAI XAI_API_KEY, or OAuth via maki auth login xai
Google GEMINI_API_KEY
Copilot GH_COPILOT_TOKEN, an existing GitHub Copilot sign-in at ~/.config/github-copilot/, or maki auth login copilot to import one
Ollama OLLAMA_HOST for local (e.g. http://localhost:11434), or OLLAMA_API_KEY for cloud
llama.cpp LLAMA_CPP_HOST (e.g. http://localhost:8080), optionally LLAMA_CPP_API_KEY
Mistral MISTRAL_API_KEY
Z.AI ZHIPU_API_KEY
DeepSeek DEEPSEEK_API_KEY
OpenRouter OPENROUTER_API_KEY
Requesty REQUESTY_API_KEY. Set REQUESTY_BASE_URL=https://router.eu.requesty.ai/v1 for the EU region.
Synthetic SYNTHETIC_API_KEY
Regolo REGOLO_API_KEY. EU-hosted open-weight models.
TensorX TENSORX_API_KEY
OpenCode Zen OPENCODE_API_KEY, or the free public key for zero-cost models. Models from the models.dev catalog.
OpenCode Go OPENCODE_API_KEY. Models from the models.dev catalog.
Aperture APERTURE_HOST (e.g. https://your-host.tailnet.ts.net). No API key needed, Tailscale handles auth.

Anything else that speaks the OpenAI or Anthropic API can be added as a custom provider in config.

Plugin providers - a Lua plugin can register a provider with maki.provider.register, and its models behave like any built-in provider's. Handy for a company gateway behind SSO. See docs for details.

Installation

# Linux / macOS / Git Bash on Windows
curl -fsSL https://maki.sh/install.sh | sh

# Windows (PowerShell)
irm https://maki.sh/install.ps1 | iex

# Homebrew
brew install maki

# Nix
nix run github:tontinton/maki

# Living on the edge (main branch)
cargo install --locked --git https://github.com/tontinton/maki.git maki

Don't blindly trust shell scripts, download it first (curl -fsSL https://maki.sh/install.sh -o install.sh, or irm https://maki.sh/install.ps1 -OutFile install.ps1), read it, then run it.

The scripts install to ~/.local/bin, or %LOCALAPPDATA%\maki on Windows (added to your user PATH). Override with MAKI_INSTALL_DIR / $env:MAKI_INSTALL_DIR.

Or download a pre-built binary from GitHub Releases.

Then set an API key for one of the providers and run maki in your project. Config lives in ~/.config/maki/init.lua, the Quick Start goes through the rest.

Packaging maki? Build with MAKI_DISABLE_UPDATE=1 to turn off self-update, see maki update.

ACP

Run maki acp or configure your ACP supporting editor to use maki, e.g. in Zed's settings.json:

"agent_servers": {
  "Maki": {
    "default_config_options": {
      "model": "deepseek/deepseek-flash"
    },
    "type": "custom",
    "command": "maki",
    "args": ["acp"],
    "env": {}
  }
}

Example config

tontinton/makiconf - includes a semble tool (Lua code) for semantic code search, and an ast-grep MCP server for AST-based search and replace.

Community

Discord

maki (tontinton/maki)

正在搜索数据库…

1.4K ·GitHub
这是什么?Maki 是一个用 Rust 编写的终端 AI 编程助手,设计目标是尽量少消耗上下文 token,并支持用类似 neovim 的 Lua 插件来扩展功能。
它是终端应用、代码库,还是 IDE 插件?它是一个用 Rust 和 ratatui 写的完整交互式终端界面——不用 JavaScript,60 帧刷新,启动快、内存占用低。它也可以通过 --print --output-format stream-json 在无界面的模式下运行。
我要自己准备 API 密钥吗?支持哪些服务商?是的,需要自带密钥:支持约 20 家服务商,包括 Anthropic、OpenAI、xAI、Google、GitHub Copilot、Mistral、DeepSeek、OpenRouter,还有本地的 Ollama 和 llama.cpp。把一个脚本放进 ~/.config/maki/providers/ 就能添加自定义服务商或代理。
有什么目前做不到的地方需要提前知道?有几点:Anthropic 只能用 API 密钥,因为 OAuth 违反了它的服务条款;Escape-Escape 可以回退聊天记录,但还不能回退代码;以 Lua 插件形式提供的服务商支持也仍在开发中。
它在 Windows 上也能运行吗,还是只有 macOS 和 Linux?Windows 有 PowerShell 和 Git Bash 安装器,Linux 和 macOS 各有一行式安装脚本。此外还支持 Nix,GitHub Releases 上也有预编译的二进制文件。
它是怎么省下这么多上下文 token 的?索引工具用 tree-sitter 解析代码,生成带精确行号范围的文件骨架(比如某个函数在第 150-165 行),这样读取的内容就很精简;一个沙箱化的代码执行工具会在工具之间对数据做过滤或摘要,数据根本不会进入上下文窗口;任务委派还可以用更弱的模型档位。作者实测仅索引工具每轮就能省下 165 个 token。
我能像 neovim 那样用插件扩展它吗?可以——扩展方式是 Lua 插件,体验类似 neovim,配有 Lua API 文档、内置插件和用户作品展示。示例配置仓库 tontinton/makiconf 提供了语义代码搜索,以及一个基于 AST 做搜索替换的 ast-grep MCP 服务器。
权限系统是怎么处理危险命令的?Maki 在询问之前会用 tree-sitter 解析 bash 命令,所以 git diff && rm -rf / 会被理解为两个独立的权限请求——git 和 rm——而不是一整行看不懂的东西。加 --yolo 参数可以完全关闭这些询问。
我可以不用 TUI,把它接到我的编辑器里吗?可以。maki acp 通过 Agent Client Protocol 把它暴露给 Zed 这类编辑器;要自动化的话,可以用 --print --output-format stream-json 以无界面模式运行,输出与 Claude Code 兼容,所以现有配置照常能用。
子代理实际上是怎么用的?task 工具会把工作委派给子代理,并让模型从你所用服务商的模型里选弱、中、强三档——就好比 haiku、sonnet、opus 的区别。每个子代理有自己的聊天窗口,可以用 /tasks(Ctrl-X)在它们之间切换。
作者为什么要做这个?是因为对现有代理的两个不满:上下文臃肿和内部机制不透明。Maki 秉持不隐藏任何东西的理念——连读取了多少行这样的细节都会显示出来——同时兼顾 token 效率。值得一提的是,maki 自己超过 90% 的代码是在人类指导下由 maki 写的。
有哪些类似的项目?aichat, claurst, magpie, dim, oh-my-pi, octomind, Raven, jcode
作者
tontinton
大小
27.2 MB
星标
1.4K
时长
9个月
提交 · 90 天