@c4a/context-cli 0.6.1-beta.1 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c4a/context-cli",
|
|
3
|
-
"version": "0.6.1
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local CLI for capturing, compiling, and governing knowledge workspaces",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"context": "cli.js"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@c4a/context": "0.6.1
|
|
23
|
+
"@c4a/context": "0.6.1",
|
|
24
24
|
"commander": "^11.0.0",
|
|
25
25
|
"handlebars": "^4.7.8",
|
|
26
26
|
"ink": "^5.0.0",
|
package/plugins/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.6.1
|
|
1
|
+
0.6.1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context",
|
|
3
|
-
"version": "0.6.1
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "c4a"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"skills": "./skills/",
|
|
19
19
|
"interface": {
|
|
20
20
|
"displayName": "C4A Context",
|
|
21
|
-
"shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.1
|
|
21
|
+
"shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.1",
|
|
22
22
|
"longDescription": "Create a Context workspace and use agent-guided next steps to register sources, run extraction, review candidates, build package outputs, and verify health without silently mutating source repositories.",
|
|
23
23
|
"developerName": "c4a",
|
|
24
24
|
"category": "Productivity",
|
package/README.zh-CN.md
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
# Context CLI
|
|
2
|
-
|
|
3
|
-
[English](./README.md)
|
|
4
|
-
|
|
5
|
-
`@c4a/context-cli` 提供 **Context CLI** 和全局 Agent 插件安装能力。CLI 负责管理本地知识工作区的状态,Agent 插件负责解释状态、询问用户决策并修改项目配置。
|
|
6
|
-
|
|
7
|
-
CLI 同时兼容 Node 和 Bun,本身不会调用 LLM。机械操作交给 CLI,语义判断交给 Agent,重要决策交给用户。
|
|
8
|
-
|
|
9
|
-
## 安装
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install -g @c4a/context-cli
|
|
13
|
-
context plugin install
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
全局安装 npm 包时也会尝试刷新插件,但不会因为插件安装失败而阻塞 CLI 安装。安装或升级 Claude、Codex 后,可以再次执行 `context plugin install`,然后重启 Agent。
|
|
17
|
-
|
|
18
|
-
面向用户的 Agent 入口是:
|
|
19
|
-
|
|
20
|
-
- `/context:init`:创建一个本地 Context workspace。
|
|
21
|
-
- `/context:continue`:读取已有工作区的状态,并从下一步继续。
|
|
22
|
-
|
|
23
|
-
`/context:continue` 是 Agent 工作指引,不是 CLI 子命令;不存在 `context continue` 命令。
|
|
24
|
-
|
|
25
|
-
最简安装后流程参见 [CLI 快速开始](./docs/quickstart.md)。
|
|
26
|
-
|
|
27
|
-
## CLI、Agent 和用户的分工
|
|
28
|
-
|
|
29
|
-
| 职责 | 负责方 |
|
|
30
|
-
|---|---|
|
|
31
|
-
| 来源登记、内容读取、代码提取、应用审核、验证和构建 | CLI |
|
|
32
|
-
| 解释选择、修改 `src/index.ts`、提出知识结构、基于证据生成候选 | Agent |
|
|
33
|
-
| 来源授权、知识分类、审核决定和打包方式 | 用户 |
|
|
34
|
-
|
|
35
|
-
Agent 会跟随 `context status` 和 CLI 返回的诊断,不会凭记忆猜下一条命令。安全的机械步骤可以自动执行,但遇到人工门禁和来源仓库外部操作时会停下来确认。
|
|
36
|
-
|
|
37
|
-
## 创建或继续工作区
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
# 创建独立工作区
|
|
41
|
-
context init context
|
|
42
|
-
cd context
|
|
43
|
-
bun install
|
|
44
|
-
|
|
45
|
-
# 让 Agent 从当前状态继续
|
|
46
|
-
/context:continue
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
初始化生成的 `AGENTS.md` 是 Agent 在当前项目中的操作指南。安装依赖后,SDK 手册位于:
|
|
50
|
-
|
|
51
|
-
```text
|
|
52
|
-
node_modules/@c4a/context/docs/README.md
|
|
53
|
-
node_modules/@c4a/context/docs/guides/agent-guide.md
|
|
54
|
-
node_modules/@c4a/context/docs/reference/project-api.md
|
|
55
|
-
node_modules/@c4a/context/docs/reference/package-templates.md
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
工作区状态分布在:
|
|
59
|
-
|
|
60
|
-
- `src/`:项目声明和知识包模板。
|
|
61
|
-
- `sources/`:来源登记和已经读取的证据。
|
|
62
|
-
- `unapproved/`:草稿、拒绝或废弃的知识候选。
|
|
63
|
-
- `knowledge/`:审核通过的知识。
|
|
64
|
-
- `dist/`:构建生成的知识包。
|
|
65
|
-
- `.tmp/context-runtime/`:忽略的日志、预览、报告、锁和缓存。
|
|
66
|
-
|
|
67
|
-
不要通过手动删除或改写这些目录来修复流程状态,应使用 CLI 返回的命令或下一步操作。
|
|
68
|
-
|
|
69
|
-
## 状态驱动流程
|
|
70
|
-
|
|
71
|
-
项目流程声明在 `src/index.ts` 中,由 `context status` 负责路由:
|
|
72
|
-
|
|
73
|
-
| 阶段 | CLI 入口 |
|
|
74
|
-
|---|---|
|
|
75
|
-
| 来源设置 | `context source add repo/file/lark`、`context source add batch`、`context source ensure` |
|
|
76
|
-
| 文档读取 | 通过 `context run <phase-id>` 执行声明好的 capture 阶段 |
|
|
77
|
-
| 代码提取 | 通过 `context run <phase-id>` 执行声明好的 `extractTs` 阶段 |
|
|
78
|
-
| 文档结构 | `context run align:<type>:<source>:<collection> ...` 的证据和校验视图 |
|
|
79
|
-
| 文档编译 | `context run compile:<type>:<source>:<collection> ...` 的证据和校验视图 |
|
|
80
|
-
| 人工审核 | `context review html`、范围化决定和 `context review apply` |
|
|
81
|
-
| 收口与质量 | `context close`、`context verify` |
|
|
82
|
-
| 知识包输出 | `context build` |
|
|
83
|
-
|
|
84
|
-
一次构建只完成当前已经确认的知识状态,并不会冻结工作区。后续还可以继续添加和处理新的来源。
|
|
85
|
-
|
|
86
|
-
## 命令分组
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
# 插件安装与诊断
|
|
90
|
-
context plugin install
|
|
91
|
-
context plugin status
|
|
92
|
-
|
|
93
|
-
# 工作区状态
|
|
94
|
-
context init [project-dir]
|
|
95
|
-
context status
|
|
96
|
-
|
|
97
|
-
# 知识来源
|
|
98
|
-
context source add repo [YYYYMMDD] --module <module> --local <repo-or-subdir>
|
|
99
|
-
context source add file [YYYYMMDD] --module <module> --local <file-or-folder>
|
|
100
|
-
context source add lark [YYYYMMDD] --module <module> --url <lark-url>
|
|
101
|
-
context source add batch [YYYYMMDD] --input <yaml-or-json>
|
|
102
|
-
context source ensure [source]
|
|
103
|
-
context source inspect [source]
|
|
104
|
-
|
|
105
|
-
# 声明阶段与审核
|
|
106
|
-
context run --list
|
|
107
|
-
context run <phase-id> --dry-run
|
|
108
|
-
context run <phase-id>
|
|
109
|
-
context review html [collection] --open
|
|
110
|
-
context review apply <payload-file>
|
|
111
|
-
|
|
112
|
-
# 最终质量与输出
|
|
113
|
-
context close
|
|
114
|
-
context verify
|
|
115
|
-
context build
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
当前参数以 `context <command> --help` 为准。需要工作区的命令会向上查找带有 `context.project=true` 和 `context.entry` 配置的 `package.json`。
|
|
119
|
-
|
|
120
|
-
## 人工门禁与证据
|
|
121
|
-
|
|
122
|
-
- CLI 不会悄悄在来源仓库中执行 clone、checkout、reset、fetch、install、build 或脚本。
|
|
123
|
-
- 登记来源和读取来源正文是两次独立授权。
|
|
124
|
-
- 写入知识候选前,需要确认代码提取范围和文档分类。
|
|
125
|
-
- 审核决定来自用户,Agent 不能自行编造批准或拒绝结果。
|
|
126
|
-
- 正式知识准备好后再选择打包方式;知识包模板是项目配置,不是第二份事实来源。
|
|
127
|
-
|
|
128
|
-
CLI 返回的来源名称、阶段 ID、候选 ID、诊断和 `source_ref` 都是流程标识。`source_ref` 是不可拆解的证据引用,应原样复制,不能把它当作文件路径解析。
|
|
129
|
-
|
|
130
|
-
## 继续阅读
|
|
131
|
-
|
|
132
|
-
- [CLI 快速开始](./docs/quickstart.md)
|
|
133
|
-
- [SDK 文档索引](../context/docs/README.md)
|
|
134
|
-
- [快速开始](../context/docs/getting-started.md)
|
|
135
|
-
- [Agent 指南](../context/docs/guides/agent-guide.md)
|
|
136
|
-
- [Agent 对话指南](../context/docs/guides/agent-dialogue.md)
|
|
137
|
-
- [项目 API](../context/docs/reference/project-api.md)
|
|
138
|
-
- [知识包模板](../context/docs/reference/package-templates.md)
|
|
139
|
-
|
|
140
|
-
## 开发
|
|
141
|
-
|
|
142
|
-
完整的源码、链接、插件和 npm 产物流程参见
|
|
143
|
-
[`DEVELOPMENT.md`](../../DEVELOPMENT.md) 和当前包的
|
|
144
|
-
[`DEVELOPMENT.md`](./DEVELOPMENT.md)。
|
|
145
|
-
|
|
146
|
-
```bash
|
|
147
|
-
./start.sh link
|
|
148
|
-
bun run --filter @c4a/context-cli build
|
|
149
|
-
bun run --filter @c4a/context-cli typecheck
|
|
150
|
-
bun run --filter @c4a/context-cli lint
|
|
151
|
-
bun run --filter @c4a/context-cli test
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
构建会把 Claude、Codex、Cursor 和纯 Skill 形态的插件写入 `dist/plugins`。`context plugin install` 从包内构建产物安装插件,不要直接修改生成目录。
|
|
155
|
-
|
|
156
|
-
## License
|
|
157
|
-
|
|
158
|
-
MIT.
|