kage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesekage - Autonomous AI Project Agent
kage - 自主AI项目代理
kagekageCore Features
核心特性
- Autonomous Workflow: Decomposes tasks into Markdown checklists and tracks progress via Memory.
- Execution Modes: (default),
continuous(run once and deactivate),once(stop when AI signals completion).autostop - Hybrid Task Types: AI-driven prompts (Markdown body) or direct shell commands (front matter).
command - Concurrency Control: ,
allow(skip if running),forbid(kill old and restart).replace - Time Windows: or
allowed_hours: "9-17".denied_hours: "12" - State Persistence: .
.kage/memory/{task}/{date}.json - Connectors: Integrate with Discord/Slack/Telegram for task notifications (always on) and optional bi-directional chat ().
poll = true - Layered Config: >
.kage/config.local.toml>.kage/config.toml> defaults.~/.kage/config.toml
- 自主工作流:将任务拆解为Markdown清单,并通过Memory跟踪进度。
- 执行模式:(默认)、
continuous(运行一次后停用)、once(当AI表示任务完成时停止)。autostop - 混合任务类型:AI驱动的提示词(Markdown正文)或直接Shell命令(前置元数据)。
command - 并发控制:、
allow(若任务正在运行则跳过)、forbid(终止旧任务并重启)。replace - 时间窗口:或
allowed_hours: "9-17"。denied_hours: "12" - 状态持久化:存储于 。
.kage/memory/{task}/{date}.json - 连接器:与Discord/Slack/Telegram集成,实现任务通知(始终启用)和可选的双向聊天()。
poll = true - 分层配置:>
.kage/config.local.toml>.kage/config.toml> 默认配置。~/.kage/config.toml
CLI
CLI 命令
- — Setup global directories and
kage onboard.kage cron - — Initialize in current directory.
kage init - — Execute a specific task immediately.
kage run <task> - — Compile a prompt task into a sibling
kage compile <task>override..lock.sh - — Execute the scheduler loop once (used by cron/launchd).
kage cron run - — List execution runs in a relative-time table; add
kage runsfor detailed timestamps.--absolute-time - — Inspect run metadata and log paths.
kage runs show <exec_id> - — Stop a running execution.
kage runs stop <exec_id> - — Open raw logs for the latest run of a task, or merge all task logs when omitted.
kage logs [<task>] - — Open raw logs for a specific run.
kage logs --run <exec_id> - — List tasks with short project names, effective type, and provider/command.
kage task list - — Detailed task configuration, including the current prompt hash.
kage task show <name> - — List all configured connectors.
kage connector list - — Show setup guide for a connector (discord, slack, telegram).
kage connector setup <type> - — Manually trigger polling for all connectors.
kage connector poll - — Diagnose config and environment.
kage doctor - — Run pending install-time migrations manually.
kage migrate install - — Open web dashboard.
kage ui - — Open the Textual terminal dashboard with logs, tasks, connectors, and settings tabs.
kage tui
Shell completion covers positional task/run arguments as well, so , , , , , , and can all suggest concrete values after . reports whether those completion scripts are installed.
kage run <task>kage compile <task>kage logs [<task>]kage task run <name>kage task show <name>kage runs show <exec_id>kage stop <exec_id>kage completion install bash|zshkage doctorIf a prompt task has a sibling compiled lock like , kage executes that lock instead of the Markdown prompt body only while the stored still matches the current prompt body. If the prompt body changes, the lock becomes stale and must be regenerated with . , , and the UI all surface whether the lock is fresh, stale, or missing, and prints the current prompt hash.
.kage/tasks/nightly.lock.shprompt_hashkage compile <task>kage doctorkage task listkage task show <name>In , prompt tasks render as or , stale compiled locks are highlighted, the project column uses only the leaf directory name, and inherited providers show up explicitly as values like . The built-in command template runs by default.
kage task listPromptPrompt (Compiled)gemini (Inherited)codexcodex exec --yolo ...Connector poll replies are recorded as normal runs. Use to find them and to inspect raw AI CLI output.
kage runs --source connector_pollkage logs --run <exec_id>Install-time migrations are discovered automatically from . New migration modules added there are picked up by both and .
src/kage/migrations/install/kage migrate installinstall.shkage tui- — 设置全局目录和
kage onboard。kage cron - — 在当前目录初始化kage。
kage init - — 立即执行指定任务。
kage run <task> - — 将提示词任务编译为同级的
kage compile <task>覆盖文件。.lock.sh - — 执行一次调度器循环(供cron/launchd调用)。
kage cron run - — 以相对时间表格形式列出执行记录;添加
kage runs参数可查看详细时间戳。--absolute-time - — 查看运行元数据和日志路径。
kage runs show <exec_id> - — 停止正在运行的任务执行。
kage runs stop <exec_id> - — 打开指定任务最新运行的原始日志;若省略任务名则合并所有任务日志。
kage logs [<task>] - — 打开指定运行记录的原始日志。
kage logs --run <exec_id> - — 列出所有任务,显示简短项目名、有效类型、提供商/命令。
kage task list - — 查看任务的详细配置,包括当前提示词哈希值。
kage task show <name> - — 列出所有已配置的连接器。
kage connector list - — 显示指定类型连接器的设置指南(discord、slack、telegram)。
kage connector setup <type> - — 手动触发所有连接器的轮询操作。
kage connector poll - — 诊断配置和环境状态。
kage doctor - — 手动运行待处理的安装时迁移脚本。
kage migrate install - — 打开Web控制面板。
kage ui - — 打开基于Textual的终端控制面板,包含日志、任务、连接器和设置标签页。
kage tui
Shell补全支持位置参数(任务/运行记录),因此执行 后,、、、、、 和 等命令都能自动补全具体值。 会报告这些补全脚本是否已安装。
kage completion install bash|zshkage run <task>kage compile <task>kage logs [<task>]kage task run <name>kage task show <name>kage runs show <exec_id>kage stop <exec_id>kage doctor如果提示词任务存在同级的编译锁定文件(如 ),只有当存储的 与当前提示词正文匹配时,kage才会执行该锁定文件而非Markdown提示词正文。若提示词正文发生变化,锁定文件会失效,需通过 重新生成。、 和控制面板都会显示锁定文件是新鲜、失效还是缺失状态, 会打印当前提示词的哈希值。
.kage/tasks/nightly.lock.shprompt_hashkage compile <task>kage doctorkage task listkage task show <name>在 中,提示词任务会显示为 或 ,失效的编译锁定文件会高亮显示,项目列仅使用叶子目录名称,继承的提供商会明确显示为 这类值。内置的 命令模板默认执行 。
kage task listPromptPrompt (Compiled)gemini (Inherited)codexcodex exec --yolo ...连接器轮询的回复会被记录为普通运行记录。使用 可找到这些记录,通过 可查看原始AI CLI输出。
kage runs --source connector_pollkage logs --run <exec_id>安装时迁移脚本会自动从 目录发现。添加到该目录的新迁移模块会被 和 自动识别。
src/kage/migrations/install/kage migrate installinstall.shkage tuiTask File Template (.kage/tasks/*.md
)
.kage/tasks/*.md任务文件模板(.kage/tasks/*.md
)
.kage/tasks/*.mdmarkdown
---
name: <Task Name>
cron: "<cron expression>"
provider: <provider name> # e.g. codex, claude, gemini, opencode, copilot, aider
mode: continuous # continuous | once | autostop
concurrency_policy: allow # allow | forbid | replace
timeout_minutes: 60 # minutes (optional)
working_dir: ../../workspace # optional; relative to this task file, or absolute path
timezone: "Asia/Tokyo" # e.g. "UTC", "Asia/Tokyo" (optional)
allowed_hours: "9-17" # e.g. "9-17,21" (optional)
denied_hours: "0-5" # e.g. "0-5,12" (optional)
notify_connectors: ["discord"] # list of connector names (optional)
active: true
---markdown
---
name: <Task Name>
cron: "<cron expression>"
provider: <provider name> # 例如:codex, claude, gemini, opencode, copilot, aider
mode: continuous # continuous | once | autostop
concurrency_policy: allow # allow | forbid | replace
timeout_minutes: 60 # 分钟(可选)
working_dir: ../../workspace # 可选;相对于当前任务文件的路径,或绝对路径
timezone: "Asia/Tokyo" # 例如:"UTC", "Asia/Tokyo"(可选)
allowed_hours: "9-17" # 例如:"9-17,21"(可选)
denied_hours: "0-5" # 例如:"0-5,12"(可选)
notify_connectors: ["discord"] # 连接器名称列表(可选)
active: true
---Task: <Title>
Task: <Title>
<Describe what the AI agent should do here.>
```
<在此描述AI Agent需要执行的操作。>
undefinedShell-Command Task Variant
Shell命令任务变体
markdown
---
name: <Task Name>
cron: "<cron expression>"
command: "<shell command>"
shell: bash
working_dir: ../../workspace
---markdown
---
name: <Task Name>
cron: "<cron expression>"
command: "<shell command>"
shell: bash
working_dir: ../../workspace
---Connectors
连接器
Connectors integrate with external chat services. Sending (task notifications via ) is always enabled as long as credentials are configured. Polling (bi-directional chat) is controlled by the flag.
notify_connectorspolltoml
[connectors.my_discord]
type = "discord"
poll = false # Set to true to enable bi-directional chat
working_dir = "~/my-project" # Optional: execution directory for this connector
bot_token = "..."
channel_id = "..."⚠️ Security Warning: Settingallows anyone in the channel to interact with the AI, which has full access to your PC's file system and tools. Only enable polling in private/trusted channels.poll = true
连接器用于与外部聊天服务集成。只要配置了凭证,通过 发送任务通知始终启用。轮询(双向聊天)功能由 标志控制。
notify_connectorspolltoml
[connectors.my_discord]
type = "discord"
poll = false # 设置为true以启用双向聊天
working_dir = "~/my-project" # 可选:该连接器的执行目录
bot_token = "..."
channel_id = "..."⚠️ 安全警告:设置会允许频道内的任何人与AI交互,而AI拥有对您电脑文件系统和工具的完全访问权限。仅在私人/可信频道中启用轮询功能。poll = true
Configuration Hierarchy
配置层级
- (Git-ignored overrides)
.kage/config.local.toml - (Project-shared)
.kage/config.toml - (User-global)
~/.kage/config.toml - Library Defaults
- Background Loop: Runs via (cron/launchd).
kage cron install
- (Git忽略的覆盖配置)
.kage/config.local.toml - (项目共享配置)
.kage/config.toml - (用户全局配置)
~/.kage/config.toml - 库默认配置
- 后台循环:通过 运行(基于cron/launchd)。
kage cron install