Long / 龙
Open source · TypeScript · MIT

An AI coding agent.
Your project. Your model.

Long runs on your machine, with terminal, web and desktop clients. Connect an OpenAI-compatible model and follow file edits and Bash commands as they happen.

No hosted account required by Long. Your model provider may require an account and charge for API usage.

A small, hackable coding workflow

Three clients

Work in the terminal, open the local web UI, or build an Electron desktop client for Windows or macOS.

Bring your model

Use a tool-capable provider supporting OpenAI Chat Completions. Model adapters are separate from the agent loop.

Follow the work

Inspect file reads, edits and command output. Add instructions during a run or request cancellation.

Resume locally

Keep session history on your machine and continue across projects. Older context can be summarized by your model.

Project instructions

Load workspace-root AGENTS.md instructions, with CLAUDE.md as a fallback when AGENTS.md is absent.

Make it yours

Explore separate TypeScript packages for model interfaces, the agent loop, runtime coordination and coding tools.

From source to your first task

Install Git, Node.js 22.18+ and npm. Command execution requires Bash; on Windows, install Git for Windows.

git clone https://github.com/yululiangcmr222-del/long.git
cd long
npm ci
npm run chat
  1. Open http://127.0.0.1:3210 in your browser.
  2. In Model settings, add your API base URL, model ID and API key or key environment variable. Select the default model.
  3. Open a trusted project. Try: “Where is the test runner configured?”

Prefer a terminal? Run npm run cli from the repository root.

Configuration reference · Build desktop and portable clients

Local-first does not mean offline inference. Conversations, tool results and images may be sent to your configured provider. Long is for trusted projects, not an OS sandbox. Tools run without per-call approval; do not expose the local service publicly.

Long:本地优先的开源 AI 编程助手

在终端、浏览器或桌面客户端中使用 AI 读代码、修改文件、运行命令。支持兼容 OpenAI Chat Completions 的工具调用模型,会话记录保存在本机,核心使用 TypeScript 构建。

先用上面的命令启动,再在「模型设置」中配置服务。建议从“解释这个项目的目录结构”这样的只读任务开始。本地优先不代表模型离线运行;请仅打开可信项目,不要公开本地服务或提交密钥。

阅读中文上手指南

Try it. Tell us what needs work.

Reproducible bug reports, model compatibility feedback, documentation improvements and pull requests are welcome. Remove API keys and sensitive project content before sharing logs.

Report an issue · Contributing guide