casement-lite-cli 0.0.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/README.md ADDED
@@ -0,0 +1,114 @@
1
+ # casement-lite
2
+
3
+ 轻量 Casement CLI,通过 `token + cookie` 直接请求 Casement 接口。
4
+
5
+ ## 安装与构建
6
+
7
+ ```bash
8
+ cd /Users/shipeng.chen/Documents/codex-project/empty/casement-lite
9
+ corepack pnpm install
10
+ corepack pnpm build
11
+ ```
12
+
13
+ 本地运行:
14
+
15
+ ```bash
16
+ node dist/index.js help --json
17
+ ```
18
+
19
+ ## 登录会话
20
+
21
+ ### 方式 1(默认):自动浏览器采集登录
22
+
23
+ ```bash
24
+ node dist/index.js auth login
25
+ ```
26
+
27
+ 会拉起受控浏览器窗口到 `https://casement.scredit.io/workspace`。
28
+ 你只需要在该窗口完成登录,CLI 会自动抓取 token/cookie 并保存,无需手工复制粘贴。
29
+
30
+ 可选参数:
31
+
32
+ ```bash
33
+ node dist/index.js auth login --browser chrome --timeout 300
34
+ ```
35
+
36
+ 建议默认只用:
37
+
38
+ ```bash
39
+ node dist/index.js auth login
40
+ ```
41
+
42
+ ### 方式 2:命令行直接传(跳过自动采集)
43
+
44
+ ```bash
45
+ node dist/index.js auth login --token '<TOKEN>' --cookie 'k1=v1; k2=v2'
46
+ ```
47
+
48
+ ### 方式 3:手动输入模式
49
+
50
+ ```bash
51
+ node dist/index.js auth login --mode manual
52
+ ```
53
+
54
+ ### 方式 4:环境变量
55
+
56
+ ```bash
57
+ CASEMENT_LOGIN_TOKEN='<TOKEN>' CASEMENT_COOKIE='k1=v1; k2=v2' node dist/index.js auth login
58
+ ```
59
+
60
+ ### 方式 5:从文件导入
61
+
62
+ ```bash
63
+ node dist/index.js auth login --from ./session.json
64
+ ```
65
+
66
+ `session.json` 示例:
67
+
68
+ ```json
69
+ {
70
+ "token": "<CASEMENT_LOGIN_TOKEN>",
71
+ "cookie": "k1=v1; k2=v2"
72
+ }
73
+ ```
74
+
75
+ 会话文件默认保存到:
76
+
77
+ `~/.casement-lite/session.json`
78
+
79
+ 检查会话:
80
+
81
+ ```bash
82
+ node dist/index.js auth status --json
83
+ ```
84
+
85
+ 退出:
86
+
87
+ ```bash
88
+ node dist/index.js auth logout --json
89
+ ```
90
+
91
+ > 默认不需要 DevTools 复制。只有在 `--mode manual` 或你主动走 `--token/--cookie` 时才需要。
92
+
93
+ ## 命令
94
+
95
+ ```bash
96
+ # help
97
+ node dist/index.js help
98
+ node dist/index.js help update-subtask --json
99
+
100
+ # query
101
+ node dist/index.js projects credit 10 --json
102
+ node dist/index.js project-detail 6 true true --json
103
+ node dist/index.js versions 6 1 100 undone --json
104
+ node dist/index.js version-detail 9099 --json
105
+ node dist/index.js project-members 6 1 100 --json
106
+ node dist/index.js tasks assignToMe --json
107
+ node dist/index.js subtasks undone --json
108
+
109
+ # write
110
+ node dist/index.js create-subtask SPSK-245038 '{"summary":"[BE] demo","assignee":"shipeng.chen","priority":"High"}' --json
111
+ node dist/index.js update-status SPSK-273096 Doing --json
112
+ node dist/index.js update-subtask SPSK-273096 storyPoints 2.5 --json
113
+ node dist/index.js update-subtask SPSK-273096 '{"summary":"new","storyPoints":2.5,"priority":"P1"}' --json
114
+ ```
@@ -0,0 +1,2 @@
1
+
2
+ export { }