casement-lite-cli
v0.0.1
Published
Lightweight Casement CLI for project/version/subtask queries and updates.
Maintainers
Readme
casement-lite
轻量 Casement CLI,通过 token + cookie 直接请求 Casement 接口。
安装与构建
cd /Users/shipeng.chen/Documents/codex-project/empty/casement-lite
corepack pnpm install
corepack pnpm build本地运行:
node dist/index.js help --json登录会话
方式 1(默认):自动浏览器采集登录
node dist/index.js auth login会拉起受控浏览器窗口到 https://casement.scredit.io/workspace。
你只需要在该窗口完成登录,CLI 会自动抓取 token/cookie 并保存,无需手工复制粘贴。
可选参数:
node dist/index.js auth login --browser chrome --timeout 300建议默认只用:
node dist/index.js auth login方式 2:命令行直接传(跳过自动采集)
node dist/index.js auth login --token '<TOKEN>' --cookie 'k1=v1; k2=v2'方式 3:手动输入模式
node dist/index.js auth login --mode manual方式 4:环境变量
CASEMENT_LOGIN_TOKEN='<TOKEN>' CASEMENT_COOKIE='k1=v1; k2=v2' node dist/index.js auth login方式 5:从文件导入
node dist/index.js auth login --from ./session.jsonsession.json 示例:
{
"token": "<CASEMENT_LOGIN_TOKEN>",
"cookie": "k1=v1; k2=v2"
}会话文件默认保存到:
~/.casement-lite/session.json
检查会话:
node dist/index.js auth status --json退出:
node dist/index.js auth logout --json默认不需要 DevTools 复制。只有在
--mode manual或你主动走--token/--cookie时才需要。
命令
# help
node dist/index.js help
node dist/index.js help update-subtask --json
# query
node dist/index.js projects credit 10 --json
node dist/index.js project-detail 6 true true --json
node dist/index.js versions 6 1 100 undone --json
node dist/index.js version-detail 9099 --json
node dist/index.js project-members 6 1 100 --json
node dist/index.js tasks assignToMe --json
node dist/index.js subtasks undone --json
# write
node dist/index.js create-subtask SPSK-245038 '{"summary":"[BE] demo","assignee":"shipeng.chen","priority":"High"}' --json
node dist/index.js update-status SPSK-273096 Doing --json
node dist/index.js update-subtask SPSK-273096 storyPoints 2.5 --json
node dist/index.js update-subtask SPSK-273096 '{"summary":"new","storyPoints":2.5,"priority":"P1"}' --json