跳转到内容

命令

这一页只列出用户直接执行的命令。首次 setup 请从 安装 开始。

  • 首次 setup: agent-note init
  • 从仓库移除 Agent Note: agent-note deinit
  • 检查状态: agent-note status
  • 查看最近活动: agent-note log
  • 显示 commit 数据: agent-note show
  • 查看某一行为什么改变: agent-note why

在仓库中设置 Agent Note。

Terminal window
npx agent-note init --agent claude
参数说明
--agent <name...>选择一个或多个 agent adapters: claude, codex, cursor or gemini
--dashboard同时创建共享 Dashboard workflow
--no-hooks跳过 agent hooks 配置
--no-git-hooks跳过 Git Hooks 安装
--no-action跳过 workflow 创建
--no-notes跳过 notes auto-fetch 配置
--hooks仅安装 agent hooks
--action仅创建 workflow

移除一个或多个 Agent 的 hooks 和 config。

Terminal window
npx agent-note deinit --agent claude
Flag说明
--agent <name...>claude, codex, cursor or gemini
--remove-workflow同时删除 PR Report 和 Dashboard workflow
--keep-notes保留 notes auto-fetch 配置

显示追踪状态。

Terminal window
npx agent-note status
agent-note v1.x.x
agent: active (cursor)
capture: cursor(prompt, response, edits, shell)
git: active (prepare-commit-msg, post-commit, pre-push)
commit: tracked via git hooks
session: a1b2c3d4…
agent: cursor
linked: 3/20 recent commits

列出最近提交和 AI Ratio。

Terminal window
npx agent-note log
npx agent-note log 20
ce941f7 feat: add auth [a1b2c3d4… | 🤖60% | 2p]
326a568 test: add tests [a1b2c3d4… | 🤖100% | 1p]
ba091be fix: update deps

显示某个 commit 的 AI Session。

Terminal window
npx agent-note show
npx agent-note show abc1234
commit: ce941f7 feat: add JWT auth middleware
session: a1b2c3d4-5678-4abc-8def-111122223333
ai: 60% (45/75 lines) [█████░░░]
model: claude-sonnet-4-20250514
agent: claude
files: 3 changed, 2 by AI
src/middleware/auth.ts 🤖
src/types/token.ts 🤖
CHANGELOG.md 👤
prompts: 2
1. Implement JWT auth middleware with refresh token rotation
2. Add tests for expired token and invalid signature

显示某一行背后的 Agent Note context。

Terminal window
npx agent-note why src/middleware/auth.ts:42
npx agent-note why src/middleware/auth.ts:42-55
npx agent-note why src/middleware/auth.ts:42:7
npx agent-note why src/middleware/auth.ts#L42
npx agent-note why src/middleware/auth.ts#L42-L55
npx agent-note why src/middleware/auth.ts#L42C7
npx agent-note why @src/middleware/auth.ts#L42
npx agent-note why https://github.com/owner/repo/blob/main/src/middleware/auth.ts#L42
npx agent-note why file:///workspace/repo/src/middleware/auth.ts#L42
npx agent-note why vscode://file/workspace/repo/src/middleware/auth.ts:42:7

安装 Agent Note Skill 后,可以用自然语言请求这些任务。

Terminal window
gh skill install wasabeef/AgentNote agent-note --agent codex --scope user

对于 gh skill install,请根据 Agent 选择对应的 identifier: codex, claude-code, cursor or gemini-cli