inkos README

The project's README from github.com/Narcooo/inkos. As one markdown file: README.md.

InkOS Logo InkOS

Story Creation AI Agent
面向长短篇小说、剧本剧作、互动影游、IP 内容与多语言翻译的创作智能体系统

npm version License: AGPL-3.0 GitHub stars npm downloads ClawHub Skill

English | 中文 | 日本語

InkOS 网页版上线! 立刻体验


InkOS 是一个面向故事创作与多语言翻译的 AI Agent 系统:长篇连载、独立短篇、剧本剧作、同人番外、仿写续写、互动影游、开放世界和长文翻译,都可以从同一个工作台开始。支持 Studio、TUI、CLI 交互形式,把创意、设定、角色、记忆、审稿、修订、封面、互动状态和跨语言交付交给智能体统一管理。

Kimi Open Source Friends
🎉🎉 InkOS 入选首批 KIMI 开源合作伙伴 🎉🎉

Kimi 赞助 InkOS

感谢 Kimi 赞助本项目!Kimi K3 是 Moonshot AI 迄今能力最强的模型,也是全球首个开源 3T 级模型,拥有原生视觉能力与 100 万 Token 上下文。搭配 InkOS,K3 可以参与长短篇小说、剧本、互动影游与多语言内容的规划、写作、审稿和修订;InkOS 则持续管理角色、设定、伏笔与故事状态,让长篇创作更连贯、更可控。

InkOS Studio 已支持 Moonshot(Kimi)。前往 Kimi 开放平台(中文站|Global)获取 API Key,即可开始创作。

火山方舟 Agent Plan 与 Coding Plan 赞助 InkOS

感谢 字节火山引擎 赞助本项目!火山方舟 Agent/Coding Plan 国模套餐首购 ¥9.9 起,支持 GLM-5.3、Kimi-K3、DeepSeek、MiniMax、Doubao 等模型;注册免费领取 2500 万 Token,统一 API,适配编码与智能体开发。立即前往 →

💡 写小说,先给 Agent 接一层专业数据 —— 写小说不只缺模型,更缺素材。推荐搭配 火花数据API(huohuaapi):按调用计费的小说 / 网文创作数据,让 Agent 动笔前先查小说正文、章节结构、人物设定、文风和创作方法等带来源素材,而不是只靠 Prompt 硬凑一份“剧情提纲”。

v1.8.0 - 统一 Pi Agent Harness 与专业创作内核

InkOS 1.8.0 把“Chat Agent 调工具”和“各类作品管线”收敛成一套围绕 pi-agent 的生产 harness。模型负责理解、提议和调用能力;InkOS 负责确认、上下文、状态、原子落盘和产物真实性。长篇、短篇、剧本、分镜、互动影游、Play 与翻译继续保留各自的专业方法,但共享同一套执行、检索、观测和恢复基础设施。

InkOS 互动影游剧情树实测截图 InkOS Play Studio 开放世界界面

主要创作形态

长篇小说 — 从创作简报建书,生成世界观、角色、卷纲、章节意图,按“写作 → 审稿 → 必要修订 → 状态结算”推进。上下文按 protected / compressible 分层组织,避免长书越写越乱。

剧情多线推演 — 在写下一章前,基于当前正史生成 2-5 条彼此隔离的未来分支,并在 Studio Chat 中横向比较章节节拍、人物决定、预计变化、风险和作者意图匹配度。采用分支只会保存 selected-branch-plan.md 候选计划,不会修改正文、大纲或正史状态;正史变化后旧推演会标记为过期。

InkOS Short — Studio Chat 和 CLI 可以直接产出独立短篇:完整正文、大纲记录、审稿记录、简介卖点、封面提示词,并在配置封面服务后生成封面图。

InkOS Play — 新增开放世界与分支互动。你可以用自然语言指定世界契约、时间推进方式、角色 agent、物品 / 证据 / 关系规则和视觉风格;系统维护世界状态、可点击选择、自由动作、HUD 和自动配图。

Studio Chat — 普通聊天、建书、短篇、封面、互动世界都走同一套 action surface。重动作先确认,生成物可预览,可通过聊天修改章节、封面提示词、世界状态和持久化文本产物。

Native English novel writing now supported! Set --lang en to write in English. See English README for details.

欢迎交流

当前更新相对频繁,后续会持续新增功能与优化写作效果。 欢迎加群反馈问题、提出需求,也欢迎关注项目动态 — 我们的目标是做最强的基于小说的内容生态创作 AI Agent。

微信交流群

快速开始

安装

需要 Node.js 22 或更高版本。

npm i -g @actalk/inkos

通过 OpenClaw 使用 🦞

InkOS 已发布为 OpenClaw Skill,可被任何兼容 Agent(Claude Code、OpenClaw 等)直接调用:

clawhub install inkos          # 从 ClawHub 安装 InkOS Skill

通过 npm 安装或克隆本项目时,skills/SKILL.md 已包含在内,🦞 可直接读取——无需额外从 ClawHub 安装。

安装后,Claw 应优先通过共享交互入口调用 InkOS:

inkos interact --json --message "继续当前书,但把节奏再收紧一点"

这条入口直接走和项目 TUI 相同的交互执行内核,因此 OpenClaw、TUI、Studio 共用同一套控制脑。当前 JSON 输出包含 assistant 文本回复和 interaction session 信息;真正的执行结果以工具结果和落盘文件为准,不从模型口头声明推断完成。

plan chapter / compose chapter / draft / audit / revise / write next 这些原子命令仍然保留,但更适合作为底层工具,而不是 OpenClaw 的首选入口。也可以在 ClawHub 搜索 inkos 在线查看。

Agent Skills

InkOS 直接使用标准 SKILL.md 作为专业能力扩展,不再维护一套 InkOS 私有 Skill 协议。Skill 只向 Chat Agent 提供专业说明和静态参考资料,不会增加执行权限;创建、写入、编辑和生成图片仍然由 InkOS 工具与确认闸门控制。

可用方式:

提示词配置不是 Skill。Studio 的 项目设置 → 提示词 单独管理 prompt packs,项目级覆盖文件写入 prompt/<pack>/<prompt>.md,例如 prompt/play/renderer.md、prompt/longform/writer.md。

最小 SKILL.md 示例:

---
name: Detective Play
description: Detective evidence and suspect-board play.
---
Use evidence chains; do not turn clues into generic atmosphere.

配置

当前 InkOS 将 LLM 配置分成两条清晰路径:Studio 用可视化服务配置,CLI / daemon / 部署环境支持 env 覆盖。两者不会互相污染。

方式一:Studio 服务配置(推荐)

适合本地写作、Web 工作台和可视化管理。

inkos init my-novel
cd my-novel
inkos

打开 Studio 后进入「模型配置」:

  1. 选择服务商,例如 Google Gemini、Moonshot、MiniMax、智谱、百炼或自定义端点。
  2. 粘贴 API Key,点击「测试连接」。
  3. 选择可用模型,保存配置。
  4. 回到书籍页面开始写作。

Studio 运行时只使用:

provider bank 默认值
→ inkos.json 里的 services / 当前 service / defaultModel
→ .inkos/secrets.json 里的 service API Key

即使检测到 ~/.inkos/.env 或项目 .env,Studio 也只会展示提示,不会用 env 覆盖 service、model、baseUrl 或 API Key。API Key 存在项目内的 .inkos/secrets.json,不会写进 inkos.json。

方式二:CLI / daemon / 部署环境的 env 配置

适合终端批处理、服务器部署、CI、Docker、守护进程和一次性切模型。

全局 env:

inkos config set-global \
  --provider <openai|anthropic|custom> \
  --base-url <API 地址> \
  --api-key <你的 API Key> \
  --model <模型名>

也可以手动写 ~/.inkos/.env 或项目 .env:

INKOS_LLM_PROVIDER=custom
INKOS_LLM_BASE_URL=https://api.moonshot.cn/v1
INKOS_LLM_API_KEY=sk-...
INKOS_LLM_MODEL=kimi-k2.5

# 可选
INKOS_LLM_SERVICE=moonshot                         # 推荐写;不写时会尽量从 baseUrl 自动识别
INKOS_LLM_TEMPERATURE=0.7
INKOS_LLM_THINKING_BUDGET=0
INKOS_DEFAULT_LANGUAGE=zh
INKOS_LLM_EXTRA_top_p=0.9

CLI 合成顺序:

Studio/project service 配置
→ .inkos/secrets.json service key
→ global ~/.inkos/.env
→ project .env
→ 当前进程环境变量
→ CLI 参数

也就是说,CLI 默认可以复用 Studio 配好的服务和密钥;如果 env 里声明了 INKOS_LLM_SERVICE、INKOS_LLM_MODEL、INKOS_LLM_BASE_URL 或 INKOS_LLM_API_KEY,则作为覆盖层生效。旧 env 只写 baseUrl + model + apiKey 也能继续用,InkOS 会尽量从 baseUrl 反推 service。

一次性指定服务或模型:

inkos write next --service google --model gemini-2.5-flash
inkos write next --service moonshot --model kimi-k2.5 --no-stream
inkos agent "继续写下一章" --api-key-env MOONSHOT_API_KEY
inkos doctor --service minimaxCodingPlan --model MiniMax-M2.7

--service 会从 provider bank 自动推导 baseUrl、协议和兼容策略;--model 必须属于最终 service,否则会直接报错,避免把 Kimi 模型发到 Gemini 这类错配问题。

方式三:多模型路由(可选)

给不同 Agent 分配不同模型,按需平衡质量与成本:

# 给不同 agent 配不同模型/提供商
inkos config set-model writer <model> --provider <provider> --base-url <url> --api-key-env <ENV_VAR>
inkos config set-model auditor <model> --provider <provider>
inkos config show-models        # 查看当前路由

未单独配置的 Agent 自动使用全局模型。

配置排查

inkos doctor

doctor 会显示当前 effective config mode、service/model/API Key 来源,并尝试 API 连通性。常见模式:

模式 含义
studio-project Studio 运行时:只使用 Studio/project 配置和 secrets
cli-project CLI 运行时:以 Studio 配置为基础,再叠加 env 和 CLI 参数
legacy-env 旧 env 模式:兼容老项目的纯 .env 配置

如果服务测试失败,优先检查服务商、模型和协议是否匹配。Google Gemini 的 AI Studio API Key 可用于 Gemini OpenAI-compatible endpoint;InkOS 会自动禁用 Google 不支持的 OpenAI store 参数。MiniMax 默认走官方 OpenAI-compatible /v1/chat/completions,并优先使用可工作的非流式 transport,避免流式返回 usage 但无正文的问题;MiniMax-M3* 会默认关闭 thinking 返回,M2.x thinking 由上游限制无法关闭。

LLM 配置更新

当前交互入口

Studio Chat + CLI + TUI 共用同一套执行面

写第一本书

inkos book create --title "吞天魔帝" --genre xuanhuan  # 创建新书
inkos write next 吞天魔帝      # 写下一章(草稿 → 审计 → 按配置修订)
inkos status                   # 查看状态
inkos review list 吞天魔帝     # 审阅草稿
inkos review approve-all 吞天魔帝  # 批量通过
inkos export 吞天魔帝          # 导出全书
inkos export 吞天魔帝 --format epub  # 导出 EPUB(手机/Kindle 阅读)

写完整短篇

想直接生成一篇完整短篇,可以在 Studio 对话里说:

写一篇 12 章短篇,方向是:都市婚姻反转,女主拿到账本证据后反杀。

也可以走 CLI:

inkos short run \
  --direction "都市短篇 婚姻反转 女主证据反杀" \
  --chapters 12 \
  --chars 1000

生成物会落在 shorts/<故事名>/final/,包含 full.md、sales-package.md、cover-prompt.md,配置封面服务后还会生成 cover.png。

单独制作封面

如果只想给已有标题或简介做封面,不需要重跑短篇正文,在 Studio 对话里直接说:

给《她签下离婚协议那天,他悔疯了》生成一张短篇封面,偏现代都市、强反转。

封面工具会独立生成 covers/<标题>/cover-prompt.md 和 covers/<标题>/cover.png。如果还没有配置封面服务,先在 Studio 的模型配置里设置封面服务和 API Key。

生成后也可以继续通过 chat 改封面提示词,例如“把人物拉近一点、标题字更大、表情更冷笑”。系统会用新的 coverPrompt 重写 cover-prompt.md 并重生成封面,不需要重新写短篇。

启动开放世界 / 分支互动

在 Studio Chat 里选择「开放世界」或「分支互动」�

inkos (Narcooo/inkos)

local-llm
Searching Database…

10.4K ·GitHub
What is this?InkOS is an open-source story-creation AI agent system: it plans, writes, reviews and revises long serialized novels, short stories, screenplays, storyboards, interactive film-games and translations, all from one workbench.
Do I run it in a browser, on my desktop, or in the terminal?All three share one core: Studio (a web workbench), a full-screen TUI, and a CLI. Studio Chat, the TUI and inkos interact all go through the same pi-agent execution loop, so it behaves the same everywhere.
How do I get it running and start my first book?Install Node.js 22 or newer, add InkOS via npm or by cloning the repo, then open Studio's model config: pick a provider, paste your API key, hit Test Connection, choose a model and start writing.
Which AI models can I plug into it?A built-in provider bank covers Google Gemini, Moonshot (Kimi), MiniMax, Zhipu, DeepSeek, SiliconFlow, Volcano, Tencent Hunyuan, iFlytek, OpenRouter, kkaiapi, Ollama, LM Studio and CodingPlan, plus any custom OpenAI-compatible endpoint. Different agents can even be routed to different models to balance quality and cost.
Is it built for Chinese web novels, or can I write in English?It grew out of Chinese web-novel creation, but native English novel writing is now supported — just set --lang en. It also handles long-text translation between languages.
How does it keep a long novel from falling apart halfway through?It tracks characters, settings, foreshadowing and story state, retrieved through a local SQLite FTS5/BM25 index, with context layered as protected vs compressible. Chapters move through a write-review-revise loop inside a safe workspace with atomic commits, so a failure can't leave the state advanced while the text was never saved.
What is InkOS Play?An open-world and branching-interactive mode: you describe the world contract, time progression, character agents, item/evidence/relationship rules and visual style in natural language, and InkOS maintains world state with clickable choices, free actions, a HUD and auto-generated illustrations.
Can it generate cover art for my stories?Yes — after configuring a cover service and key in Studio, it produces covers/ /cover-prompt.md plus cover.png, either standalone or as part of a short-story package. You can then refine the prompt by chat (e.g. 'move the character closer, larger title, colder expression') and it regenerates without rewriting the story.
Can coding agents like Claude Code or OpenClaw drive InkOS?Yes. InkOS ships as an OpenClaw Skill — skills/SKILL.md comes bundled with the npm install or clone, no ClawHub download needed — and any compatible agent can call it via inkos interact --json --message, sharing the same execution kernel as Studio and the TUI.
Creator
Narcooo
Size
30 MB
Stars
10.4K
Age
7mo
Commits · 90 Days