aipm-cli 0.1.0__py3-none-any.whl
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.
- aipm_cli-0.1.0.dist-info/LICENSE +21 -0
- aipm_cli-0.1.0.dist-info/METADATA +81 -0
- aipm_cli-0.1.0.dist-info/RECORD +22 -0
- aipm_cli-0.1.0.dist-info/WHEEL +5 -0
- aipm_cli-0.1.0.dist-info/entry_points.txt +3 -0
- aipm_cli-0.1.0.dist-info/top_level.txt +1 -0
- pmai/__init__.py +3 -0
- pmai/__main__.py +7 -0
- pmai/app.py +6 -0
- pmai/bootstrap.py +72 -0
- pmai/cli.py +8 -0
- pmai/cli_main.py +190 -0
- pmai/json_store.py +329 -0
- pmai/run.py +8 -0
- pmai/run_server.py +38 -0
- pmai/store.py +1002 -0
- pmai/ui/README.md +11 -0
- pmai/ui/dist/assets/index-DGaldb9r.js +412 -0
- pmai/ui/dist/assets/index-RiTKPu0I.css +1 -0
- pmai/ui/dist/index.html +13 -0
- pmai/usage_guide.py +95 -0
- pmai/web_server.py +180 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 arthurchan1906
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: aipm-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Local project management tool for AI coding workflows
|
|
5
|
+
License: MIT License
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2026 arthurchan1906
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
26
|
+
|
|
27
|
+
Keywords: ai,project-management,cli,developer-tools
|
|
28
|
+
Classifier: Development Status :: 3 - Alpha
|
|
29
|
+
Classifier: Intended Audience :: Developers
|
|
30
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
31
|
+
Classifier: Operating System :: OS Independent
|
|
32
|
+
Classifier: Programming Language :: Python :: 3
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
38
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
39
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
40
|
+
Requires-Python: >=3.8
|
|
41
|
+
Description-Content-Type: text/markdown
|
|
42
|
+
License-File: LICENSE
|
|
43
|
+
|
|
44
|
+
# AIPM CLI
|
|
45
|
+
|
|
46
|
+
AIPM CLI 是一个给 AI 编码项目使用的本地项目管理工具。
|
|
47
|
+
|
|
48
|
+
PyPI 分发名:`aipm-cli`
|
|
49
|
+
|
|
50
|
+
特性:
|
|
51
|
+
- `aipmc init` 在当前项目创建 `.pmai/` 隐藏目录
|
|
52
|
+
- JSON 数据库存放在 `.pmai/data/pmai.json`
|
|
53
|
+
- Web 配置存放在 `.pmai/config.json`
|
|
54
|
+
- AI 使用说明可写入 `.pmai/USAGE.md`
|
|
55
|
+
- CLI 可记录 canon、task、decision、commit、daily
|
|
56
|
+
- Web 直接用 Python 标准库 `http.server` 提供,无需 FastAPI
|
|
57
|
+
- 可通过 PyPI 安装并直接使用
|
|
58
|
+
|
|
59
|
+
常用命令:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install aipm-cli
|
|
63
|
+
aipmc init
|
|
64
|
+
aipmc help
|
|
65
|
+
aipmc info
|
|
66
|
+
aipmc canon show
|
|
67
|
+
aipmv
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
运行时目录:
|
|
71
|
+
- `.pmai/data/pmai.json`
|
|
72
|
+
- `.pmai/config.json`
|
|
73
|
+
- `.pmai/USAGE.md`
|
|
74
|
+
|
|
75
|
+
主要模块:
|
|
76
|
+
- `src/pmai/bootstrap.py`
|
|
77
|
+
- `src/pmai/cli_main.py`
|
|
78
|
+
- `src/pmai/usage_guide.py`
|
|
79
|
+
- `src/pmai/store.py`
|
|
80
|
+
- `src/pmai/web_server.py`
|
|
81
|
+
- `src/pmai/run_server.py`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
pmai/__init__.py,sha256=POJ4-7NuxhA69MwLfWswOhlLlmmWJwD7TzXdURJQRJk,46
|
|
2
|
+
pmai/__main__.py,sha256=2eo9snGH-oXyyNOYkSAWfDFzufFK7zbZTacYPcqjqjc,110
|
|
3
|
+
pmai/app.py,sha256=0cJpDstgEwmxn5Q_GI-nhytmRCHdoYNvsWkwvF2n0zM,208
|
|
4
|
+
pmai/bootstrap.py,sha256=cX-vu_8OlsP1odqUEVZ0c-_I15_-7wEGXK2rWkcFu0k,5955
|
|
5
|
+
pmai/cli.py,sha256=2QxWDae2-ztkGtFzlbOXAavpbEtYx1Xt6WbLOyobbaQ,137
|
|
6
|
+
pmai/cli_main.py,sha256=jr656nlT_D5lg6jkYjyCEnSb20Pdb1csXpMeSqnfGoo,9725
|
|
7
|
+
pmai/json_store.py,sha256=qO217fhg6MrKLmoq5iyTUrVnHzcZTkBKKPTQ7gxX0ho,11606
|
|
8
|
+
pmai/run.py,sha256=06BD3DiHliK0b2u74UkkLquhGXGD3Xb1NoGdRW7XtEA,141
|
|
9
|
+
pmai/run_server.py,sha256=VkZ1z_64346LuNALqWm22u7BrenhFnsialRFd2KPpzo,1034
|
|
10
|
+
pmai/store.py,sha256=GuPLMnmsTOmO6GZas_Z9m_tzd3ZOoGGmAGHTA9d7W8k,37436
|
|
11
|
+
pmai/usage_guide.py,sha256=RZ9V3WfulHHAzSCXWfI0BsZnl6v9weEISKtPiA82MnY,1959
|
|
12
|
+
pmai/web_server.py,sha256=9TCMtaMIkrA-RSkYeTw6r9ZQ2wIBuPkyFym0e4UmFN0,7364
|
|
13
|
+
pmai/ui/README.md,sha256=OnMbwQGBn7HErNqNIRmuu-t9gGZvU_sE-Bmg7eM8HFk,208
|
|
14
|
+
pmai/ui/dist/index.html,sha256=qBiBmxoTqYXklNi2RLfXFqaEkHOpNi1NPOCWjatjJp4,415
|
|
15
|
+
pmai/ui/dist/assets/index-DGaldb9r.js,sha256=7-CtW_o-6Ie8KDXGKkb_7O6MbcsJ_lXwNKd3-e0Jf8c,1051822
|
|
16
|
+
pmai/ui/dist/assets/index-RiTKPu0I.css,sha256=JwhkJTLbWRd_Uscf-AEFNZKUwYIdR_ylx4TzgeJHjbg,6854
|
|
17
|
+
aipm_cli-0.1.0.dist-info/LICENSE,sha256=iaOijxYZNl7w4SZ61tZfhpoW75CcYTcwcpu1R2tIY8o,1092
|
|
18
|
+
aipm_cli-0.1.0.dist-info/METADATA,sha256=bJ_1VrL1gY87VviHVl_owN5m93h5CCmx5oJOdUGY54E,3052
|
|
19
|
+
aipm_cli-0.1.0.dist-info/WHEEL,sha256=BNRMDyzLkkcmlv0J8ppDQkk2VED33SesJDynr9ED1gc,91
|
|
20
|
+
aipm_cli-0.1.0.dist-info/entry_points.txt,sha256=pJ0QhoBKwYpuZGjRQyetugn8NaEQaiGbL2QuQv_gBIg,74
|
|
21
|
+
aipm_cli-0.1.0.dist-info/top_level.txt,sha256=9m-DNjB8L0X_ZZV0vV_74y0DPT5k-p2VimPhqT16r6M,5
|
|
22
|
+
aipm_cli-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pmai
|
pmai/__init__.py
ADDED
pmai/__main__.py
ADDED
pmai/app.py
ADDED
pmai/bootstrap.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
try:
|
|
2
|
+
from .json_store import bootstrap_state
|
|
3
|
+
from .store import today
|
|
4
|
+
except ImportError:
|
|
5
|
+
from json_store import bootstrap_state
|
|
6
|
+
from store import today
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def bootstrap_project_db() -> bool:
|
|
10
|
+
bootstrap_state(
|
|
11
|
+
{
|
|
12
|
+
"meta": {
|
|
13
|
+
"project_name": "pmai-project",
|
|
14
|
+
"project_type": "ai-coding-project-manager",
|
|
15
|
+
"runtime_root": ".pmai",
|
|
16
|
+
"runtime_database": ".pmai/data/pmai.json",
|
|
17
|
+
"runtime_config": ".pmai/config.json",
|
|
18
|
+
"ai_read_order": [
|
|
19
|
+
".pmai/data/pmai.json:canon",
|
|
20
|
+
".pmai/data/pmai.json:tasks",
|
|
21
|
+
".pmai/data/pmai.json:doc_records",
|
|
22
|
+
"README.md",
|
|
23
|
+
"pyproject.toml",
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
"canon": {
|
|
27
|
+
"id": "canon-current",
|
|
28
|
+
"updated_at": today(),
|
|
29
|
+
"product_goal": "为 AI 编码项目提供可安装的项目管理工具,支持 CLI 记录、Web 查看和项目级初始化。",
|
|
30
|
+
"engineering_focus": "统一隐藏目录、CLI、JSON 数据层和内置 Web 服务,确保复制目录后仍能正常运行。",
|
|
31
|
+
"architecture": "Python stdlib CLI + HTTPServer + JSON + React 静态页面",
|
|
32
|
+
"version_scope": ["项目级 .pmai 隐藏目录初始化", "CLI 任务/提交/决策/日报管理", "内置 Web 查看与编辑", "pip 可安装分发", "移除旧 pmai 路径残留"],
|
|
33
|
+
"avoid_now": ["引入额外后端框架依赖", "依赖团队协作或多用户同步", "把运行时数据放回代码目录"],
|
|
34
|
+
"top_tasks": ["清理旧包名和路径硬编码", "保证 aipmc init 可在任意项目创建 .pmai", "保证 aipmv 使用标准库直接启动"],
|
|
35
|
+
"source_docs": ["README.md", "pyproject.toml", "cli_main.py", "bootstrap.py", "json_store.py", "web_server.py", "run_server.py"],
|
|
36
|
+
"related_decisions": ["decision-runtime-hidden-dir", "decision-stdlib-web-server"],
|
|
37
|
+
},
|
|
38
|
+
"decisions": [
|
|
39
|
+
{"id": "decision-runtime-hidden-dir", "title": "运行时数据放入项目隐藏目录", "date": today(), "status": "accepted", "background": "工具会被复制到不同目录中使用,代码路径不应承担项目数据目录职责。", "decision": "在用户项目根目录使用 .pmai/ 保存数据库和运行配置,并支持从子目录向上发现该目录。", "impact": ["每个项目独立保存数据和端口配置"], "alternatives": ["继续把数据库放在源码目录"], "related_tasks": ["task-runtime-layout"], "updates_canon": True},
|
|
40
|
+
{"id": "decision-stdlib-web-server", "title": "Web 服务改为 Python 标准库", "date": today(), "status": "accepted", "background": "该工具主要由单个开发者在本机使用,不需要额外的 Web 框架复杂度。", "decision": "用 http.server 提供静态文件和 JSON API,去掉额外后端依赖。", "impact": ["安装成本更低", "更适合本地单用户工具"], "alternatives": ["继续保留 FastAPI 方案"], "related_tasks": ["task-stdlib-web"], "updates_canon": True},
|
|
41
|
+
],
|
|
42
|
+
"tasks": [
|
|
43
|
+
{"id": "task-runtime-layout", "title": "统一 .pmai 运行时目录和初始化逻辑", "status": "in_progress", "priority": "P0", "phase": "foundation", "acceptance": ["aipmc init 会创建 .pmai/data/pmai.json 和 .pmai/config.json", "CLI 和 Web 从子目录也能定位到同一项目数据库"], "related_docs": ["bootstrap.py", "store.py", "run_server.py"], "related_decisions": ["decision-runtime-hidden-dir"], "last_note": "", "updated_at": today()},
|
|
44
|
+
{"id": "task-stdlib-web", "title": "将 Web 服务改为标准库实现", "status": "in_progress", "priority": "P0", "phase": "runtime", "acceptance": ["无需额外安装 FastAPI/uvicorn/pydantic", "保留现有前端静态资源和 API 路径"], "related_docs": ["web_server.py", "run_server.py", "pyproject.toml"], "related_decisions": ["decision-stdlib-web-server"], "last_note": "", "updated_at": today()},
|
|
45
|
+
],
|
|
46
|
+
"ideas": [],
|
|
47
|
+
"doc_records": [
|
|
48
|
+
{"path": "README.md", "type": "readme", "status": "active", "layer": "baseline", "source_of_truth": True, "last_reviewed": today(), "superseded_by": None},
|
|
49
|
+
{"path": "pyproject.toml", "type": "packaging", "status": "active", "layer": "baseline", "source_of_truth": True, "last_reviewed": today(), "superseded_by": None},
|
|
50
|
+
{"path": "cli_main.py", "type": "cli", "status": "active", "layer": "implementation", "source_of_truth": True, "last_reviewed": today(), "superseded_by": None},
|
|
51
|
+
{"path": "bootstrap.py", "type": "bootstrap", "status": "active", "layer": "implementation", "source_of_truth": True, "last_reviewed": today(), "superseded_by": None},
|
|
52
|
+
{"path": "json_store.py", "type": "data-layer", "status": "active", "layer": "implementation", "source_of_truth": True, "last_reviewed": today(), "superseded_by": None},
|
|
53
|
+
{"path": "web_server.py", "type": "web-server", "status": "active", "layer": "implementation", "source_of_truth": True, "last_reviewed": today(), "superseded_by": None},
|
|
54
|
+
{"path": "run_server.py", "type": "runtime-entry", "status": "active", "layer": "implementation", "source_of_truth": True, "last_reviewed": today(), "superseded_by": None},
|
|
55
|
+
],
|
|
56
|
+
"daily_notes": {},
|
|
57
|
+
"commits": [],
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
return False
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def fetch_canon(_unused=None):
|
|
64
|
+
try:
|
|
65
|
+
from .json_store import fetch_canon as _fetch_canon
|
|
66
|
+
except ImportError:
|
|
67
|
+
from json_store import fetch_canon as _fetch_canon
|
|
68
|
+
return _fetch_canon()
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def replace_canon_item_group(_conn, _item_type, _values):
|
|
72
|
+
return None
|
pmai/cli.py
ADDED
pmai/cli_main.py
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import json
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
try:
|
|
8
|
+
from .bootstrap import bootstrap_project_db
|
|
9
|
+
from .json_store import (
|
|
10
|
+
append_daily_note,
|
|
11
|
+
create_commit,
|
|
12
|
+
create_decision,
|
|
13
|
+
create_idea,
|
|
14
|
+
create_task,
|
|
15
|
+
fetch_canon,
|
|
16
|
+
list_commits,
|
|
17
|
+
list_decisions,
|
|
18
|
+
list_ideas,
|
|
19
|
+
list_tasks,
|
|
20
|
+
review_idea,
|
|
21
|
+
update_canon,
|
|
22
|
+
update_task,
|
|
23
|
+
)
|
|
24
|
+
from .store import describe_runtime, get_config_path, get_runtime_dir, save_runtime_config
|
|
25
|
+
from .usage_guide import build_usage_markdown, write_usage_file
|
|
26
|
+
except ImportError:
|
|
27
|
+
from bootstrap import bootstrap_project_db
|
|
28
|
+
from json_store import (
|
|
29
|
+
append_daily_note,
|
|
30
|
+
create_commit,
|
|
31
|
+
create_decision,
|
|
32
|
+
create_idea,
|
|
33
|
+
create_task,
|
|
34
|
+
fetch_canon,
|
|
35
|
+
list_commits,
|
|
36
|
+
list_decisions,
|
|
37
|
+
list_ideas,
|
|
38
|
+
list_tasks,
|
|
39
|
+
review_idea,
|
|
40
|
+
update_canon,
|
|
41
|
+
update_task,
|
|
42
|
+
)
|
|
43
|
+
from store import describe_runtime, get_config_path, get_runtime_dir, save_runtime_config
|
|
44
|
+
from usage_guide import build_usage_markdown, write_usage_file
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def init_project(args: argparse.Namespace) -> None:
|
|
48
|
+
get_runtime_dir(create=True)
|
|
49
|
+
if args.port is not None or args.host:
|
|
50
|
+
payload: dict[str, Any] = {}
|
|
51
|
+
if args.host:
|
|
52
|
+
payload["web_host"] = args.host
|
|
53
|
+
if args.port is not None:
|
|
54
|
+
payload["web_port"] = args.port
|
|
55
|
+
save_runtime_config(payload)
|
|
56
|
+
elif not get_config_path().exists():
|
|
57
|
+
save_runtime_config({})
|
|
58
|
+
bootstrap_project_db()
|
|
59
|
+
write_usage_file()
|
|
60
|
+
print(json.dumps(describe_runtime(), ensure_ascii=False, indent=2))
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def show_info() -> None:
|
|
64
|
+
print(json.dumps(describe_runtime(), ensure_ascii=False, indent=2))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def show_canon() -> None:
|
|
68
|
+
print(json.dumps(fetch_canon(), ensure_ascii=False, indent=2))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def show_help_text() -> None:
|
|
72
|
+
print(build_usage_markdown())
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
76
|
+
parser = argparse.ArgumentParser(description="AIPM CLI")
|
|
77
|
+
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
78
|
+
init_parser = subparsers.add_parser("init")
|
|
79
|
+
init_parser.add_argument("--host", default="")
|
|
80
|
+
init_parser.add_argument("--port", type=int, default=None)
|
|
81
|
+
subparsers.add_parser("help")
|
|
82
|
+
subparsers.add_parser("info")
|
|
83
|
+
canon = subparsers.add_parser("canon").add_subparsers(dest="canon_command", required=True)
|
|
84
|
+
canon.add_parser("show")
|
|
85
|
+
canon_update = canon.add_parser("update")
|
|
86
|
+
canon_update.add_argument("--decision-id", required=True)
|
|
87
|
+
canon_update.add_argument("--product-goal", default="")
|
|
88
|
+
canon_update.add_argument("--engineering-focus", default="")
|
|
89
|
+
canon_update.add_argument("--architecture", default="")
|
|
90
|
+
canon_update.add_argument("--add-scope", nargs="*", default=[])
|
|
91
|
+
canon_update.add_argument("--add-avoid", nargs="*", default=[])
|
|
92
|
+
decision = subparsers.add_parser("decision").add_subparsers(dest="decision_command", required=True)
|
|
93
|
+
decision.add_parser("list")
|
|
94
|
+
decision_add = decision.add_parser("add")
|
|
95
|
+
decision_add.add_argument("--title", required=True)
|
|
96
|
+
decision_add.add_argument("--background", required=True)
|
|
97
|
+
decision_add.add_argument("--decision", required=True)
|
|
98
|
+
decision_add.add_argument("--status", default="proposed")
|
|
99
|
+
idea = subparsers.add_parser("idea").add_subparsers(dest="idea_command", required=True)
|
|
100
|
+
idea_list = idea.add_parser("list")
|
|
101
|
+
idea_list.add_argument("--status", default="")
|
|
102
|
+
idea_capture = idea.add_parser("capture")
|
|
103
|
+
idea_capture.add_argument("--title", required=True)
|
|
104
|
+
idea_capture.add_argument("--summary", required=True)
|
|
105
|
+
idea_capture.add_argument("--impact", default="")
|
|
106
|
+
idea_capture.add_argument("--source", default="manual")
|
|
107
|
+
idea_capture.add_argument("--canon-conflict", action="store_true", dest="canon_conflict")
|
|
108
|
+
idea_review = idea.add_parser("review")
|
|
109
|
+
idea_review.add_argument("--id", required=True)
|
|
110
|
+
idea_review.add_argument("--status", required=True)
|
|
111
|
+
idea_review.add_argument("--note", default="")
|
|
112
|
+
task = subparsers.add_parser("task").add_subparsers(dest="task_command", required=True)
|
|
113
|
+
task.add_parser("list")
|
|
114
|
+
task_add = task.add_parser("add")
|
|
115
|
+
task_add.add_argument("--title", required=True)
|
|
116
|
+
task_add.add_argument("--priority", default="P1")
|
|
117
|
+
task_add.add_argument("--status", default="todo")
|
|
118
|
+
task_add.add_argument("--phase", default="general")
|
|
119
|
+
task_add.add_argument("--acceptance", nargs="*", default=[])
|
|
120
|
+
task_update = task.add_parser("update")
|
|
121
|
+
task_update.add_argument("--id", required=True)
|
|
122
|
+
task_update.add_argument("--status", required=True)
|
|
123
|
+
task_update.add_argument("--note", default="")
|
|
124
|
+
commit = subparsers.add_parser("commit").add_subparsers(dest="commit_command", required=True)
|
|
125
|
+
commit_list = commit.add_parser("list")
|
|
126
|
+
commit_list.add_argument("--status", default="")
|
|
127
|
+
commit_add = commit.add_parser("add")
|
|
128
|
+
commit_add.add_argument("--title", required=True)
|
|
129
|
+
commit_add.add_argument("--summary", default="")
|
|
130
|
+
commit_add.add_argument("--branch", default="")
|
|
131
|
+
commit_add.add_argument("--commit-hash", default="", dest="commit_hash")
|
|
132
|
+
commit_add.add_argument("--task-id", default="", dest="task_id")
|
|
133
|
+
commit_add.add_argument("--decision-id", default="", dest="decision_id")
|
|
134
|
+
commit_add.add_argument("--status", default="draft")
|
|
135
|
+
commit_add.add_argument("--test-status", default="not_run", dest="test_status")
|
|
136
|
+
commit_add.add_argument("--review-status", default="pending", dest="review_status")
|
|
137
|
+
commit_add.add_argument("--files", nargs="*", default=[])
|
|
138
|
+
daily = subparsers.add_parser("daily").add_subparsers(dest="daily_command", required=True)
|
|
139
|
+
daily_show = daily.add_parser("show")
|
|
140
|
+
daily_show.add_argument("--date", default=None)
|
|
141
|
+
daily_close = daily.add_parser("close")
|
|
142
|
+
daily_close.add_argument("--completed", nargs="*", default=[])
|
|
143
|
+
daily_close.add_argument("--problems", nargs="*", default=[])
|
|
144
|
+
daily_close.add_argument("--risks", nargs="*", default=[])
|
|
145
|
+
daily_close.add_argument("--next", nargs="*", default=[])
|
|
146
|
+
return parser
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def main() -> None:
|
|
150
|
+
parser = build_parser()
|
|
151
|
+
args = parser.parse_args()
|
|
152
|
+
if args.command == "init":
|
|
153
|
+
init_project(args)
|
|
154
|
+
elif args.command == "help":
|
|
155
|
+
show_help_text()
|
|
156
|
+
elif args.command == "info":
|
|
157
|
+
show_info()
|
|
158
|
+
elif args.command == "canon" and args.canon_command == "show":
|
|
159
|
+
show_canon()
|
|
160
|
+
elif args.command == "canon" and args.canon_command == "update":
|
|
161
|
+
print(json.dumps(update_canon({"decision_id": args.decision_id, "product_goal": args.product_goal, "engineering_focus": args.engineering_focus, "architecture": args.architecture, "add_scope": args.add_scope, "add_avoid": args.add_avoid}), ensure_ascii=False, indent=2))
|
|
162
|
+
elif args.command == "decision" and args.decision_command == "list":
|
|
163
|
+
print(json.dumps({"decisions": list_decisions()}, ensure_ascii=False, indent=2))
|
|
164
|
+
elif args.command == "decision" and args.decision_command == "add":
|
|
165
|
+
print(json.dumps(create_decision({"title": args.title, "background": args.background, "decision": args.decision, "status": args.status}), ensure_ascii=False, indent=2))
|
|
166
|
+
elif args.command == "idea" and args.idea_command == "list":
|
|
167
|
+
print(json.dumps({"ideas": list_ideas(args.status or None)}, ensure_ascii=False, indent=2))
|
|
168
|
+
elif args.command == "idea" and args.idea_command == "capture":
|
|
169
|
+
print(json.dumps(create_idea({"title": args.title, "summary": args.summary, "impact": args.impact, "source": args.source, "canon_conflict": args.canon_conflict}), ensure_ascii=False, indent=2))
|
|
170
|
+
elif args.command == "idea" and args.idea_command == "review":
|
|
171
|
+
print(json.dumps(review_idea(args.id, args.status, args.note), ensure_ascii=False, indent=2))
|
|
172
|
+
elif args.command == "task" and args.task_command == "list":
|
|
173
|
+
print(json.dumps({"tasks": list_tasks()}, ensure_ascii=False, indent=2))
|
|
174
|
+
elif args.command == "task" and args.task_command == "add":
|
|
175
|
+
print(json.dumps(create_task({"title": args.title, "priority": args.priority, "status": args.status, "phase": args.phase, "acceptance": args.acceptance}), ensure_ascii=False, indent=2))
|
|
176
|
+
elif args.command == "task" and args.task_command == "update":
|
|
177
|
+
print(json.dumps(update_task(args.id, args.status, args.note), ensure_ascii=False, indent=2))
|
|
178
|
+
elif args.command == "commit" and args.commit_command == "list":
|
|
179
|
+
print(json.dumps({"commits": list_commits(args.status or None)}, ensure_ascii=False, indent=2))
|
|
180
|
+
elif args.command == "commit" and args.commit_command == "add":
|
|
181
|
+
print(json.dumps(create_commit({"title": args.title, "summary": args.summary, "branch": args.branch, "commit_hash": args.commit_hash, "task_id": args.task_id or None, "decision_id": args.decision_id or None, "status": args.status, "test_status": args.test_status, "review_status": args.review_status, "files": args.files}), ensure_ascii=False, indent=2))
|
|
182
|
+
elif args.command == "daily" and args.daily_command == "show":
|
|
183
|
+
from json_store import get_daily_note
|
|
184
|
+
print(json.dumps(get_daily_note(args.date), ensure_ascii=False, indent=2))
|
|
185
|
+
elif args.command == "daily" and args.daily_command == "close":
|
|
186
|
+
print(json.dumps(append_daily_note({"completed": args.completed, "problems": args.problems, "risks": args.risks, "next": args.next}), ensure_ascii=False, indent=2))
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
if __name__ == "__main__":
|
|
190
|
+
main()
|