移除 --auth-context,改为 --auth-stdin,结构化传递解析认证信息
This commit is contained in:
+19
-17
@@ -39,15 +39,14 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = {
|
||||
path=("project", "list"),
|
||||
summary="列出当前用户可访问项目",
|
||||
description="调用 /meta/projects 返回项目列表。",
|
||||
examples=("tjwater-cli --auth-context auth.json project list",),
|
||||
next_commands=("tjwater-cli --auth-context auth.json project info",),
|
||||
output="项目摘要列表",
|
||||
examples=("tjwater-cli project list",),
|
||||
next_commands=("tjwater-cli project info",),
|
||||
),
|
||||
("project", "info"): CommandDoc(
|
||||
path=("project", "info"),
|
||||
summary="读取当前项目元数据",
|
||||
description="调用 /meta/project 返回当前 project 详情。",
|
||||
examples=("tjwater-cli --auth-context auth.json project info",),
|
||||
summary="查看当前项目摘要信息。",
|
||||
description="查看当前项目的基础信息。",
|
||||
examples=("tjwater-cli project info",),
|
||||
output="项目元数据",
|
||||
),
|
||||
("project", "db-health"): CommandDoc(
|
||||
@@ -109,8 +108,8 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = {
|
||||
CommandOptionDoc("duration", "持续分钟数", required=True),
|
||||
),
|
||||
next_commands=(
|
||||
"tjwater-cli --auth-context auth.json data timeseries realtime links --start-time 2025-01-02T03:04:05+08:00 --end-time 2025-01-02T03:34:05+08:00",
|
||||
"tjwater-cli --auth-context auth.json data timeseries realtime nodes --start-time 2025-01-02T03:04:05+08:00 --end-time 2025-01-02T03:34:05+08:00",
|
||||
"tjwater-cli data timeseries realtime links --start-time 2025-01-02T03:04:05+08:00 --end-time 2025-01-02T03:34:05+08:00",
|
||||
"tjwater-cli data timeseries realtime nodes --start-time 2025-01-02T03:04:05+08:00 --end-time 2025-01-02T03:34:05+08:00",
|
||||
),
|
||||
output="模拟触发结果;实时数据需通过 data timeseries 命令按时间段查询",
|
||||
),
|
||||
@@ -125,20 +124,23 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = {
|
||||
CommandOptionDoc("scheme", "方案名称"),
|
||||
),
|
||||
examples=(
|
||||
"tjwater-cli --auth-context auth.json analysis burst --start-time 2025-01-02T03:04:05+08:00 --duration 30 --burst-file ./burst.json --scheme burst_case_01",
|
||||
"tjwater-cli analysis burst --start-time 2025-01-02T03:04:05+08:00 --duration 30 --burst-file ./burst.json --scheme burst_case_01",
|
||||
"tjwater-cli data scheme get --name burst_case_01",
|
||||
"tjwater-cli data scheme list",
|
||||
),
|
||||
next_commands=(
|
||||
"tjwater-cli --auth-context auth.json data scheme get --name burst_case_01",
|
||||
"tjwater-cli --auth-context auth.json data scheme list",
|
||||
),
|
||||
output="分析执行结果;方案详情需通过 data scheme 命令单独查询",
|
||||
),
|
||||
("analysis", "valve"): CommandDoc(
|
||||
path=("analysis", "valve"),
|
||||
summary="执行阀门关闭或隔离分析",
|
||||
description="mode=close 使用 valve 列表;mode=isolation 需要 accident element,可选 disabled-valve。",
|
||||
summary="阀门工况分析。",
|
||||
description="指定阀门采取关闭/开启等操作逻辑,并执行定时长模拟。结果写入时序库。",
|
||||
options=(
|
||||
CommandOptionDoc(name="mode", description="阀门操作模式:'close' 或 'open'", required=True),
|
||||
CommandOptionDoc(name="start-time", description="起始绝对时间,必须显式带时区偏移", required=True),
|
||||
CommandOptionDoc(name="valve", description="阀门 ID(可多次指定)", required=True, repeated=True),
|
||||
CommandOptionDoc(name="duration", description="模拟持续分钟数", required=True),
|
||||
),
|
||||
examples=(
|
||||
"tjwater-cli --auth-context auth.json analysis valve --mode close --start-time 2025-01-02T03:04:05+08:00 --valve V1 --duration 900",
|
||||
"tjwater-cli analysis valve --mode close --start-time 2025-01-02T03:04:05+08:00 --valve V1 --duration 900",
|
||||
),
|
||||
),
|
||||
("analysis", "flushing"): CommandDoc(
|
||||
|
||||
Reference in New Issue
Block a user