licos-platform-cli 0.3.3__tar.gz → 0.4.1__tar.gz
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.
Potentially problematic release.
This version of licos-platform-cli might be problematic. Click here for more details.
- {licos_platform_cli-0.3.3 → licos_platform_cli-0.4.1}/PKG-INFO +2 -2
- {licos_platform_cli-0.3.3 → licos_platform_cli-0.4.1}/pyproject.toml +2 -2
- {licos_platform_cli-0.3.3 → licos_platform_cli-0.4.1}/src/licos_platform_cli/help_commands.py +250 -132
- licos_platform_cli-0.4.1/src/licos_platform_cli/industrial_commands.py +335 -0
- {licos_platform_cli-0.3.3 → licos_platform_cli-0.4.1}/src/licos_platform_cli/main.py +2 -0
- {licos_platform_cli-0.3.3 → licos_platform_cli-0.4.1}/src/licos_platform_cli/uns_commands.py +217 -217
- {licos_platform_cli-0.3.3 → licos_platform_cli-0.4.1}/tests/test_cli.py +179 -127
- {licos_platform_cli-0.3.3 → licos_platform_cli-0.4.1}/.gitignore +0 -0
- {licos_platform_cli-0.3.3 → licos_platform_cli-0.4.1}/src/licos_platform_cli/__init__.py +0 -0
- {licos_platform_cli-0.3.3 → licos_platform_cli-0.4.1}/src/licos_platform_cli/database_commands.py +0 -0
- {licos_platform_cli-0.3.3 → licos_platform_cli-0.4.1}/src/licos_platform_cli/knowledge_commands.py +0 -0
- {licos_platform_cli-0.3.3 → licos_platform_cli-0.4.1}/src/licos_platform_cli/oauth_commands.py +0 -0
- {licos_platform_cli-0.3.3 → licos_platform_cli-0.4.1}/src/licos_platform_cli/storage_commands.py +0 -0
|
@@ -4,11 +4,11 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "licos-platform-cli"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.4.1"
|
|
8
8
|
description = "LICOS platform CLI"
|
|
9
9
|
requires-python = ">=3.10"
|
|
10
10
|
dependencies = [
|
|
11
|
-
"licos-platform-sdk>=0.
|
|
11
|
+
"licos-platform-sdk>=0.5.0",
|
|
12
12
|
]
|
|
13
13
|
|
|
14
14
|
[project.scripts]
|
{licos_platform_cli-0.3.3 → licos_platform_cli-0.4.1}/src/licos_platform_cli/help_commands.py
RENAMED
|
@@ -31,92 +31,105 @@ STORAGE_HELP = {
|
|
|
31
31
|
"node": "import { storage } from '@kmlckj/licos-platform-sdk';\nconst file = await storage.uploadFile('/workspace/projects/report.pdf');\nconst link = await storage.shareUrl(file.id);",
|
|
32
32
|
},
|
|
33
33
|
"commands": {
|
|
34
|
-
"summary": {
|
|
35
|
-
"description": "Return project storage summary.",
|
|
36
|
-
"parameters": [],
|
|
37
|
-
"
|
|
38
|
-
|
|
34
|
+
"summary": {
|
|
35
|
+
"description": "Return project storage summary.",
|
|
36
|
+
"parameters": [],
|
|
37
|
+
"returns": "Storage summary object: IDs/scope strings, usedSizeBytes integer, fileCount/folderCount integers, serviceEnabled boolean.",
|
|
38
|
+
"example": "licos-platform storage summary",
|
|
39
|
+
},
|
|
39
40
|
"folders": {
|
|
40
|
-
"description": "List all folders in the current project storage scope.",
|
|
41
|
-
"parameters": [],
|
|
42
|
-
"
|
|
43
|
-
|
|
41
|
+
"description": "List all folders in the current project storage scope.",
|
|
42
|
+
"parameters": [],
|
|
43
|
+
"returns": "Array of folder objects. Folder IDs are durable operation identifiers; parentId is null for root.",
|
|
44
|
+
"example": "licos-platform storage folders",
|
|
45
|
+
},
|
|
44
46
|
"entries": {
|
|
45
47
|
"description": "List folders and files under a folder; omit folder-id for root.",
|
|
46
|
-
"parameters": [{"name": "--folder-id", "required": False, "description": "Folder ID. Omit for root."}],
|
|
47
|
-
"
|
|
48
|
-
|
|
48
|
+
"parameters": [{"name": "--folder-id", "type": "string", "required": False, "description": "Folder ID. Omit for root."}],
|
|
49
|
+
"returns": "Directory entries object with currentFolderId, currentFolderName, currentFolderPath, breadcrumbs, folders, and files.",
|
|
50
|
+
"example": "licos-platform storage entries --folder-id folder-id",
|
|
51
|
+
},
|
|
49
52
|
"files": {
|
|
50
|
-
"description": "List all files in the current project storage scope.",
|
|
51
|
-
"parameters": [],
|
|
52
|
-
"
|
|
53
|
-
|
|
53
|
+
"description": "List all files in the current project storage scope.",
|
|
54
|
+
"parameters": [],
|
|
55
|
+
"returns": "Array of file objects. downloadUrl is temporary; use id/storageKey as durable identity.",
|
|
56
|
+
"example": "licos-platform storage files",
|
|
57
|
+
},
|
|
54
58
|
"create-folder": {
|
|
55
59
|
"description": "Create a folder under root or a parent folder.",
|
|
56
60
|
"parameters": [
|
|
57
|
-
{"name": "folder_name", "required": True, "description": "
|
|
58
|
-
{"name": "--parent-id", "required": False, "description": "Parent folder ID. Omit for root."},
|
|
59
|
-
],
|
|
61
|
+
{"name": "folder_name", "type": "string", "required": True, "description": "Non-empty new folder name."},
|
|
62
|
+
{"name": "--parent-id", "type": "string", "required": False, "description": "Parent folder ID. Omit for root."},
|
|
63
|
+
],
|
|
64
|
+
"returns": "Created folder object.",
|
|
60
65
|
"example": "licos-platform storage create-folder reports --parent-id folder-id",
|
|
61
66
|
},
|
|
62
67
|
"rename-folder": {
|
|
63
68
|
"description": "Rename a folder by folder ID.",
|
|
64
69
|
"parameters": [
|
|
65
|
-
{"name": "folder_id", "required": True, "description": "
|
|
66
|
-
{"name": "folder_name", "required": True, "description": "
|
|
67
|
-
],
|
|
70
|
+
{"name": "folder_id", "type": "string", "required": True, "description": "Exact folder ID."},
|
|
71
|
+
{"name": "folder_name", "type": "string", "required": True, "description": "Non-empty new folder name."},
|
|
72
|
+
],
|
|
73
|
+
"returns": "Updated folder object.",
|
|
68
74
|
"example": "licos-platform storage rename-folder folder-id reports",
|
|
69
75
|
},
|
|
70
76
|
"delete-folder": {
|
|
71
77
|
"description": "Delete a folder by folder ID.",
|
|
72
|
-
"parameters": [{"name": "folder_id", "required": True, "description": "
|
|
78
|
+
"parameters": [{"name": "folder_id", "type": "string", "required": True, "description": "Exact folder ID."}],
|
|
79
|
+
"returns": "{\"success\": true} on success.",
|
|
73
80
|
"example": "licos-platform storage delete-folder folder-id",
|
|
74
81
|
},
|
|
75
82
|
"upload-file": {
|
|
76
|
-
"description": "Upload a local file up to
|
|
77
|
-
"parameters": [
|
|
78
|
-
{"name": "file", "required": True, "description": "
|
|
79
|
-
{"name": "--folder-id", "required": False, "description": "Target folder ID. Omit for root."},
|
|
80
|
-
{"name": "--file-name", "required": False, "description": "Override uploaded display file name."},
|
|
81
|
-
{"name": "--content-type", "required": False, "description": "MIME type, for example application/pdf."},
|
|
82
|
-
],
|
|
83
|
+
"description": "Upload a local file up to 100 MiB. Files over 8 MiB automatically use multipart upload; always use the returned file object.",
|
|
84
|
+
"parameters": [
|
|
85
|
+
{"name": "file", "type": "path", "required": True, "description": "Readable local file path; maximum size 100 MiB."},
|
|
86
|
+
{"name": "--folder-id", "type": "string", "required": False, "description": "Target folder ID. Omit for root."},
|
|
87
|
+
{"name": "--file-name", "type": "string", "required": False, "description": "Override uploaded display file name."},
|
|
88
|
+
{"name": "--content-type", "type": "MIME string", "required": False, "description": "MIME type, for example application/pdf."},
|
|
89
|
+
],
|
|
90
|
+
"returns": "Uploaded file object with durable id/storageKey metadata and a temporary downloadUrl.",
|
|
83
91
|
"example": "licos-platform storage upload-file ./report.pdf --folder-id folder-id --file-name report.pdf --content-type application/pdf",
|
|
84
92
|
},
|
|
85
93
|
"rename-file": {
|
|
86
94
|
"description": "Rename a file by file ID.",
|
|
87
95
|
"parameters": [
|
|
88
|
-
{"name": "file_id", "required": True, "description": "
|
|
89
|
-
{"name": "file_name", "required": True, "description": "
|
|
90
|
-
],
|
|
96
|
+
{"name": "file_id", "type": "string", "required": True, "description": "Exact file ID."},
|
|
97
|
+
{"name": "file_name", "type": "string", "required": True, "description": "Non-empty new file name."},
|
|
98
|
+
],
|
|
99
|
+
"returns": "Updated file object.",
|
|
91
100
|
"example": "licos-platform storage rename-file file-id final.pdf",
|
|
92
101
|
},
|
|
93
102
|
"move-file": {
|
|
94
103
|
"description": "Move a file to a folder; omit folder-id to move to root.",
|
|
95
104
|
"parameters": [
|
|
96
|
-
{"name": "file_id", "required": True, "description": "
|
|
97
|
-
{"name": "--folder-id", "required": False, "description": "Target folder ID. Omit
|
|
98
|
-
],
|
|
105
|
+
{"name": "file_id", "type": "string", "required": True, "description": "Exact file ID."},
|
|
106
|
+
{"name": "--folder-id", "type": "string", "required": False, "description": "Target folder ID. Omit to move to root."},
|
|
107
|
+
],
|
|
108
|
+
"returns": "Updated file object.",
|
|
99
109
|
"example": "licos-platform storage move-file file-id --folder-id folder-id",
|
|
100
110
|
},
|
|
101
111
|
"share-url": {
|
|
102
112
|
"description": "Generate a temporary share URL for a file.",
|
|
103
113
|
"parameters": [
|
|
104
|
-
{"name": "file_id", "required": True, "description": "
|
|
105
|
-
{"name": "--expiry-seconds", "required": False, "description": "URL lifetime in seconds."},
|
|
106
|
-
],
|
|
114
|
+
{"name": "file_id", "type": "string", "required": True, "description": "Exact file ID."},
|
|
115
|
+
{"name": "--expiry-seconds", "type": "integer", "required": False, "description": "Positive URL lifetime in seconds. Omit for the platform default of 7 days."},
|
|
116
|
+
],
|
|
117
|
+
"returns": "Object with temporary url string and expiresAt datetime string.",
|
|
107
118
|
"example": "licos-platform storage share-url file-id --expiry-seconds 3600",
|
|
108
119
|
},
|
|
109
120
|
"object-exists": {
|
|
110
121
|
"description": "Check whether an object exists by file ID or object key.",
|
|
111
122
|
"parameters": [
|
|
112
|
-
{"name": "--file-id", "required": False, "description": "File ID."},
|
|
113
|
-
{"name": "--object-key", "required": False, "description": "Storage object key."},
|
|
114
|
-
],
|
|
123
|
+
{"name": "--file-id", "type": "string", "required": False, "description": "File ID. Takes precedence when both selectors are provided."},
|
|
124
|
+
{"name": "--object-key", "type": "string", "required": False, "description": "Storage object key. At least one selector is required."},
|
|
125
|
+
],
|
|
126
|
+
"returns": "Object with fileId, bucketName, objectKey, and boolean exists.",
|
|
115
127
|
"example": "licos-platform storage object-exists --file-id file-id",
|
|
116
128
|
},
|
|
117
129
|
"delete-file": {
|
|
118
130
|
"description": "Delete a file by file ID.",
|
|
119
|
-
"parameters": [{"name": "file_id", "required": True, "description": "
|
|
131
|
+
"parameters": [{"name": "file_id", "type": "string", "required": True, "description": "Exact file ID."}],
|
|
132
|
+
"returns": "{\"success\": true} on success.",
|
|
120
133
|
"example": "licos-platform storage delete-file file-id",
|
|
121
134
|
},
|
|
122
135
|
},
|
|
@@ -508,10 +521,10 @@ UNS_HELP = {
|
|
|
508
521
|
"discover, validate, plan, and finalize are read-only for external systems; apply performs writes.",
|
|
509
522
|
"Run apply only after reviewing the current plan, and pass its exact documentHash and planHash with --confirm.",
|
|
510
523
|
"UNS.json must not contain platform IDs, external IDs, credentials, MQTT infrastructure IDs, or credential-bearing RTSP URLs.",
|
|
511
|
-
"Use resource-search before reference bindings; a reference selector must resolve exactly one existing resource.",
|
|
512
|
-
"Point nodes are message-backed. New manifests and changes do not create point storage; existing point storage remains unchanged and does not block point operations.",
|
|
513
|
-
"Use UNSChangeSet for supported isolated structural changes. Remove storage only on an explicit confirmed request. Unsupported operations must fail; do not regenerate a full manifest or call external services directly.",
|
|
514
|
-
"Use either a current-project node code or --path for business access. Data writes/deletions, point control, and video control require explicit confirmation.",
|
|
524
|
+
"Use resource-search before reference bindings; a reference selector must resolve exactly one existing resource.",
|
|
525
|
+
"Point nodes are message-backed. New manifests and changes do not create point storage; existing point storage remains unchanged and does not block point operations.",
|
|
526
|
+
"Use UNSChangeSet for supported isolated structural changes. Remove storage only on an explicit confirmed request. Unsupported operations must fail; do not regenerate a full manifest or call external services directly.",
|
|
527
|
+
"Use either a current-project node code or --path for business access. Data writes/deletions, point control, and video control require explicit confirmation.",
|
|
515
528
|
],
|
|
516
529
|
"sdk": {
|
|
517
530
|
"python": "from licos_platform_sdk import uns\nplanned = uns.plan(document)\nresult = uns.apply(document, expected_document_hash=planned['documentHash'], expected_plan_hash=planned['planHash'], confirmed=True)",
|
|
@@ -583,7 +596,7 @@ UNS_HELP = {
|
|
|
583
596
|
"parameters": [{"name": "--file", "required": True, "description": "Local UNS JSON file."}],
|
|
584
597
|
"example": "licos-platform uns plan --file UNS.json",
|
|
585
598
|
},
|
|
586
|
-
"apply": {
|
|
599
|
+
"apply": {
|
|
587
600
|
"description": "Execute a previously reviewed plan after explicit confirmation and hash verification.",
|
|
588
601
|
"parameters": [
|
|
589
602
|
{"name": "--file", "required": True, "description": "The exact local UNS JSON document that was planned."},
|
|
@@ -591,90 +604,90 @@ UNS_HELP = {
|
|
|
591
604
|
{"name": "--plan-hash", "required": True, "description": "planHash returned by the reviewed plan."},
|
|
592
605
|
{"name": "--confirm", "required": True, "description": "Explicitly confirm external writes."},
|
|
593
606
|
],
|
|
594
|
-
"example": "licos-platform uns apply --file UNS.json --document-hash <documentHash> --plan-hash <planHash> --confirm",
|
|
595
|
-
},
|
|
596
|
-
"changes-validate": {
|
|
597
|
-
"description": "Validate one strict UNSChangeSet document without writes.",
|
|
598
|
-
"parameters": [{"name": "--file", "required": True, "description": "Local UNSChangeSet JSON file."}],
|
|
599
|
-
"example": "licos-platform uns changes-validate --file UNS.change.json",
|
|
600
|
-
},
|
|
601
|
-
"changes-plan": {
|
|
602
|
-
"description": "Resolve targets and create a read-only plan for one UNSChangeSet.",
|
|
603
|
-
"parameters": [{"name": "--file", "required": True, "description": "Local UNSChangeSet JSON file."}],
|
|
604
|
-
"example": "licos-platform uns changes-plan --file UNS.change.json",
|
|
605
|
-
},
|
|
606
|
-
"changes-apply": {
|
|
607
|
-
"description": "Apply the exact reviewed UNSChangeSet; destructive or replacement actions require impact confirmation.",
|
|
608
|
-
"parameters": [
|
|
609
|
-
{"name": "--file", "required": True, "description": "The exact UNSChangeSet document that was planned."},
|
|
610
|
-
{"name": "--document-hash", "required": True, "description": "documentHash returned by changes-plan."},
|
|
611
|
-
{"name": "--plan-hash", "required": True, "description": "planHash returned by changes-plan."},
|
|
612
|
-
{"name": "--confirm", "required": True, "description": "Confirm the planned writes."},
|
|
613
|
-
{"name": "--confirm-impact", "required": False, "description": "Additionally confirm delete, move, replacement, or rebind impact."},
|
|
614
|
-
],
|
|
615
|
-
"example": "licos-platform uns changes-apply --file UNS.change.json --document-hash <documentHash> --plan-hash <planHash> --confirm --confirm-impact",
|
|
616
|
-
},
|
|
617
|
-
"node-update": {
|
|
618
|
-
"description": "Build and plan one supported node metadata update; this command never applies it.",
|
|
619
|
-
"parameters": [
|
|
620
|
-
{"name": "--path / --node-code", "required": True, "description": "Exactly one project-local target locator."},
|
|
621
|
-
{"name": "--set-json", "required": True, "description": "Supported node fields to replace."},
|
|
622
|
-
],
|
|
623
|
-
"example": "licos-platform uns node-update --path project:/LINE_1/TEMP_1 --set-json '{\"name\":\"炉温\"}'",
|
|
624
|
-
},
|
|
625
|
-
"node-move": {
|
|
626
|
-
"description": "Build and plan one project-local node move; this command never applies it.",
|
|
627
|
-
"parameters": [
|
|
628
|
-
{"name": "--path / --node-code", "required": True, "description": "Exactly one target locator."},
|
|
629
|
-
{"name": "--parent-path / --parent-node-code", "required": True, "description": "Exactly one destination locator."},
|
|
630
|
-
],
|
|
631
|
-
"example": "licos-platform uns node-move --node-code TEMP_1 --parent-path project:/LINE_2",
|
|
632
|
-
},
|
|
633
|
-
"point-rebind": {
|
|
634
|
-
"description": "Build and plan rebinding one point to one exact existing collection point; this command never applies it.",
|
|
635
|
-
"parameters": [
|
|
636
|
-
{"name": "--path / --node-code", "required": True, "description": "Exactly one point target locator."},
|
|
637
|
-
{"name": "--selector-json", "required": True, "description": "Exact tagCode, taskName, and protocol selector."},
|
|
638
|
-
{"name": "--field-mappings-json", "required": False, "description": "Optional field mapping array."},
|
|
639
|
-
],
|
|
640
|
-
"example": "licos-platform uns point-rebind --node-code TEMP_1 --selector-json '{\"tagCode\":\"T1\",\"taskName\":\"OPC采集\",\"protocol\":\"opcua\"}'",
|
|
641
|
-
},
|
|
642
|
-
"directory-create": {
|
|
643
|
-
"description": "Build and plan creating one project-local grouping directory; this command never applies it.",
|
|
644
|
-
"parameters": [
|
|
645
|
-
{"name": "--parent-path / --parent-node-code", "required": True, "description": "Exactly one parent locator."},
|
|
646
|
-
{"name": "--node-json", "required": True, "description": "Directory name, stable code, and optional metadata."},
|
|
647
|
-
],
|
|
648
|
-
"example": "licos-platform uns directory-create --parent-path project:/ --node-json '{\"name\":\"一号产线\",\"code\":\"LINE_1\"}'",
|
|
649
|
-
},
|
|
650
|
-
"connection-update": {
|
|
651
|
-
"description": "生成并规划一个当前项目托管采集连接的增量修改,不直接执行写入。",
|
|
652
|
-
"parameters": [
|
|
653
|
-
{"name": "--selector-json", "required": True, "description": "精确的 name、protocol 选择器。"},
|
|
654
|
-
{"name": "--set-json", "required": True, "description": "name、credentialRef 或 configPatch。"},
|
|
655
|
-
{"name": "--output", "required": False, "description": "在项目目录内保存生成的 UNSChangeSet。"},
|
|
656
|
-
],
|
|
657
|
-
"example": "licos-platform uns connection-update --selector-json '{\"name\":\"一号PLC\",\"protocol\":\"modbus-tcp\"}' --set-json '{\"configPatch\":{\"host\":\"10.0.0.2\"}}' --output UNS.change.json",
|
|
658
|
-
},
|
|
659
|
-
"collection-task-update": {
|
|
660
|
-
"description": "生成并规划一个当前项目托管采集任务的增量修改,不直接执行写入。",
|
|
661
|
-
"parameters": [
|
|
662
|
-
{"name": "--selector-json", "required": True, "description": "精确的 name、protocol、connectionName 选择器。"},
|
|
663
|
-
{"name": "--set-json", "required": True, "description": "name、pollIntervalMs、enabled 或 configPatch。"},
|
|
664
|
-
{"name": "--output", "required": False, "description": "在项目目录内保存生成的 UNSChangeSet。"},
|
|
665
|
-
],
|
|
666
|
-
"example": "licos-platform uns collection-task-update --selector-json '{\"name\":\"温度采集\",\"protocol\":\"modbus-tcp\",\"connectionName\":\"一号PLC\"}' --set-json '{\"pollIntervalMs\":2000}' --output UNS.change.json",
|
|
667
|
-
},
|
|
668
|
-
"point-config-update": {
|
|
669
|
-
"description": "生成并规划一个当前项目托管采集点位配置的增量修改,不改变点位编码和所属任务。",
|
|
670
|
-
"parameters": [
|
|
671
|
-
{"name": "--selector-json", "required": True, "description": "精确的 tagCode、taskName、protocol 选择器。"},
|
|
672
|
-
{"name": "--set-json", "required": True, "description": "点位通用字段或协议 addressPatch。"},
|
|
673
|
-
{"name": "--output", "required": False, "description": "在项目目录内保存生成的 UNSChangeSet。"},
|
|
674
|
-
],
|
|
675
|
-
"example": "licos-platform uns point-config-update --selector-json '{\"tagCode\":\"TEMP_01\",\"taskName\":\"温度采集\",\"protocol\":\"modbus-tcp\"}' --set-json '{\"addressPatch\":{\"address\":\"40002\"}}' --output UNS.change.json",
|
|
676
|
-
},
|
|
677
|
-
"finalize": {
|
|
607
|
+
"example": "licos-platform uns apply --file UNS.json --document-hash <documentHash> --plan-hash <planHash> --confirm",
|
|
608
|
+
},
|
|
609
|
+
"changes-validate": {
|
|
610
|
+
"description": "Validate one strict UNSChangeSet document without writes.",
|
|
611
|
+
"parameters": [{"name": "--file", "required": True, "description": "Local UNSChangeSet JSON file."}],
|
|
612
|
+
"example": "licos-platform uns changes-validate --file UNS.change.json",
|
|
613
|
+
},
|
|
614
|
+
"changes-plan": {
|
|
615
|
+
"description": "Resolve targets and create a read-only plan for one UNSChangeSet.",
|
|
616
|
+
"parameters": [{"name": "--file", "required": True, "description": "Local UNSChangeSet JSON file."}],
|
|
617
|
+
"example": "licos-platform uns changes-plan --file UNS.change.json",
|
|
618
|
+
},
|
|
619
|
+
"changes-apply": {
|
|
620
|
+
"description": "Apply the exact reviewed UNSChangeSet; destructive or replacement actions require impact confirmation.",
|
|
621
|
+
"parameters": [
|
|
622
|
+
{"name": "--file", "required": True, "description": "The exact UNSChangeSet document that was planned."},
|
|
623
|
+
{"name": "--document-hash", "required": True, "description": "documentHash returned by changes-plan."},
|
|
624
|
+
{"name": "--plan-hash", "required": True, "description": "planHash returned by changes-plan."},
|
|
625
|
+
{"name": "--confirm", "required": True, "description": "Confirm the planned writes."},
|
|
626
|
+
{"name": "--confirm-impact", "required": False, "description": "Additionally confirm delete, move, replacement, or rebind impact."},
|
|
627
|
+
],
|
|
628
|
+
"example": "licos-platform uns changes-apply --file UNS.change.json --document-hash <documentHash> --plan-hash <planHash> --confirm --confirm-impact",
|
|
629
|
+
},
|
|
630
|
+
"node-update": {
|
|
631
|
+
"description": "Build and plan one supported node metadata update; this command never applies it.",
|
|
632
|
+
"parameters": [
|
|
633
|
+
{"name": "--path / --node-code", "required": True, "description": "Exactly one project-local target locator."},
|
|
634
|
+
{"name": "--set-json", "required": True, "description": "Supported node fields to replace."},
|
|
635
|
+
],
|
|
636
|
+
"example": "licos-platform uns node-update --path project:/LINE_1/TEMP_1 --set-json '{\"name\":\"炉温\"}'",
|
|
637
|
+
},
|
|
638
|
+
"node-move": {
|
|
639
|
+
"description": "Build and plan one project-local node move; this command never applies it.",
|
|
640
|
+
"parameters": [
|
|
641
|
+
{"name": "--path / --node-code", "required": True, "description": "Exactly one target locator."},
|
|
642
|
+
{"name": "--parent-path / --parent-node-code", "required": True, "description": "Exactly one destination locator."},
|
|
643
|
+
],
|
|
644
|
+
"example": "licos-platform uns node-move --node-code TEMP_1 --parent-path project:/LINE_2",
|
|
645
|
+
},
|
|
646
|
+
"point-rebind": {
|
|
647
|
+
"description": "Build and plan rebinding one point to one exact existing collection point; this command never applies it.",
|
|
648
|
+
"parameters": [
|
|
649
|
+
{"name": "--path / --node-code", "required": True, "description": "Exactly one point target locator."},
|
|
650
|
+
{"name": "--selector-json", "required": True, "description": "Exact tagCode, taskName, and protocol selector."},
|
|
651
|
+
{"name": "--field-mappings-json", "required": False, "description": "Optional field mapping array."},
|
|
652
|
+
],
|
|
653
|
+
"example": "licos-platform uns point-rebind --node-code TEMP_1 --selector-json '{\"tagCode\":\"T1\",\"taskName\":\"OPC采集\",\"protocol\":\"opcua\"}'",
|
|
654
|
+
},
|
|
655
|
+
"directory-create": {
|
|
656
|
+
"description": "Build and plan creating one project-local grouping directory; this command never applies it.",
|
|
657
|
+
"parameters": [
|
|
658
|
+
{"name": "--parent-path / --parent-node-code", "required": True, "description": "Exactly one parent locator."},
|
|
659
|
+
{"name": "--node-json", "required": True, "description": "Directory name, stable code, and optional metadata."},
|
|
660
|
+
],
|
|
661
|
+
"example": "licos-platform uns directory-create --parent-path project:/ --node-json '{\"name\":\"一号产线\",\"code\":\"LINE_1\"}'",
|
|
662
|
+
},
|
|
663
|
+
"connection-update": {
|
|
664
|
+
"description": "生成并规划一个当前项目托管采集连接的增量修改,不直接执行写入。",
|
|
665
|
+
"parameters": [
|
|
666
|
+
{"name": "--selector-json", "required": True, "description": "精确的 name、protocol 选择器。"},
|
|
667
|
+
{"name": "--set-json", "required": True, "description": "name、credentialRef 或 configPatch。"},
|
|
668
|
+
{"name": "--output", "required": False, "description": "在项目目录内保存生成的 UNSChangeSet。"},
|
|
669
|
+
],
|
|
670
|
+
"example": "licos-platform uns connection-update --selector-json '{\"name\":\"一号PLC\",\"protocol\":\"modbus-tcp\"}' --set-json '{\"configPatch\":{\"host\":\"10.0.0.2\"}}' --output UNS.change.json",
|
|
671
|
+
},
|
|
672
|
+
"collection-task-update": {
|
|
673
|
+
"description": "生成并规划一个当前项目托管采集任务的增量修改,不直接执行写入。",
|
|
674
|
+
"parameters": [
|
|
675
|
+
{"name": "--selector-json", "required": True, "description": "精确的 name、protocol、connectionName 选择器。"},
|
|
676
|
+
{"name": "--set-json", "required": True, "description": "name、pollIntervalMs、enabled 或 configPatch。"},
|
|
677
|
+
{"name": "--output", "required": False, "description": "在项目目录内保存生成的 UNSChangeSet。"},
|
|
678
|
+
],
|
|
679
|
+
"example": "licos-platform uns collection-task-update --selector-json '{\"name\":\"温度采集\",\"protocol\":\"modbus-tcp\",\"connectionName\":\"一号PLC\"}' --set-json '{\"pollIntervalMs\":2000}' --output UNS.change.json",
|
|
680
|
+
},
|
|
681
|
+
"point-config-update": {
|
|
682
|
+
"description": "生成并规划一个当前项目托管采集点位配置的增量修改,不改变点位编码和所属任务。",
|
|
683
|
+
"parameters": [
|
|
684
|
+
{"name": "--selector-json", "required": True, "description": "精确的 tagCode、taskName、protocol 选择器。"},
|
|
685
|
+
{"name": "--set-json", "required": True, "description": "点位通用字段或协议 addressPatch。"},
|
|
686
|
+
{"name": "--output", "required": False, "description": "在项目目录内保存生成的 UNSChangeSet。"},
|
|
687
|
+
],
|
|
688
|
+
"example": "licos-platform uns point-config-update --selector-json '{\"tagCode\":\"TEMP_01\",\"taskName\":\"温度采集\",\"protocol\":\"modbus-tcp\"}' --set-json '{\"addressPatch\":{\"address\":\"40002\"}}' --output UNS.change.json",
|
|
689
|
+
},
|
|
690
|
+
"finalize": {
|
|
678
691
|
"description": "Validate and atomically install a candidate as project-root UNS.json, revalidate it, and return a read-only plan.",
|
|
679
692
|
"parameters": [{"name": "--file", "required": True, "description": "Candidate JSON file inside LICOS_PROJECT_PATH."}],
|
|
680
693
|
"example": "licos-platform uns finalize --file .UNS.json.candidate",
|
|
@@ -767,11 +780,116 @@ UNS_HELP = {
|
|
|
767
780
|
}
|
|
768
781
|
|
|
769
782
|
|
|
783
|
+
INDUSTRIAL_HELP = {
|
|
784
|
+
"topic": "industrial",
|
|
785
|
+
"description": "Project-scoped direct collection and video integration without creating UNS nodes.",
|
|
786
|
+
"runtime": RUNTIME_ENV,
|
|
787
|
+
"rules": [
|
|
788
|
+
"Use only when the user explicitly requests direct collector access or explicitly says not to create UNS.",
|
|
789
|
+
"CLI and SDK call platform APIs; never request or expose IOTDATA API keys or MQTT credentials.",
|
|
790
|
+
"Search before create. Update and delete require the versionHash returned by resource-get/search.",
|
|
791
|
+
"Apply requires reviewed documentHash and planHash. Delete also requires --confirm-impact.",
|
|
792
|
+
"Realtime defaults to WebSocket; MQTT must be selected explicitly. Point control defaults to HTTP; MQTT must be selected explicitly.",
|
|
793
|
+
"Transport failures do not silently switch to another transport.",
|
|
794
|
+
],
|
|
795
|
+
"resourceTypes": [
|
|
796
|
+
"edgeAgent (read-only)",
|
|
797
|
+
"connection",
|
|
798
|
+
"collectionTask",
|
|
799
|
+
"collectionPoint",
|
|
800
|
+
"videoEdge",
|
|
801
|
+
"videoGateway",
|
|
802
|
+
"videoDevice",
|
|
803
|
+
"videoChannel",
|
|
804
|
+
],
|
|
805
|
+
"commands": {
|
|
806
|
+
"protocol-schema": {
|
|
807
|
+
"description": "Get required and default fields for one collection protocol.",
|
|
808
|
+
"parameters": [{"name": "protocol", "required": True, "description": "Protocol code."}],
|
|
809
|
+
"example": "licos-platform industrial protocol-schema modbus-tcp",
|
|
810
|
+
},
|
|
811
|
+
"resource-search": {
|
|
812
|
+
"description": "Search project-managed or enterprise collection/video resources.",
|
|
813
|
+
"parameters": [
|
|
814
|
+
{"name": "--resource-type", "required": True, "description": "Allowlisted resource type."},
|
|
815
|
+
{"name": "--scope", "required": False, "description": "project or enterprise."},
|
|
816
|
+
{"name": "--protocol", "required": False, "description": "Collection protocol filter."},
|
|
817
|
+
{"name": "--keyword", "required": False, "description": "Name/code/address keyword."},
|
|
818
|
+
{"name": "--selector-json", "required": False, "description": "Exact field selector object."},
|
|
819
|
+
],
|
|
820
|
+
"example": "licos-platform industrial resource-search --resource-type collectionPoint --scope enterprise --keyword TEMP",
|
|
821
|
+
},
|
|
822
|
+
"resource-get": {
|
|
823
|
+
"description": "Get one resource, writable state, and concurrency versionHash.",
|
|
824
|
+
"parameters": [
|
|
825
|
+
{"name": "--resource-type", "required": True, "description": "Allowlisted resource type."},
|
|
826
|
+
{"name": "--resource-id", "required": True, "description": "Resource ID."},
|
|
827
|
+
],
|
|
828
|
+
"example": "licos-platform industrial resource-get --resource-type collectionPoint --resource-id point-id",
|
|
829
|
+
},
|
|
830
|
+
"changes-validate / changes-plan / changes-apply": {
|
|
831
|
+
"description": "Validate, review, and apply an IndustrialChangeSet JSON file.",
|
|
832
|
+
"parameters": [
|
|
833
|
+
{"name": "--file", "required": True, "description": "IndustrialChangeSet JSON file."},
|
|
834
|
+
{"name": "--document-hash / --plan-hash", "required": True, "description": "Required only by apply."},
|
|
835
|
+
{"name": "--confirm", "required": True, "description": "Required only by apply."},
|
|
836
|
+
{"name": "--confirm-impact", "required": False, "description": "Required when the plan contains delete impact."},
|
|
837
|
+
],
|
|
838
|
+
"example": "licos-platform industrial changes-plan --file ./industrial.change.json",
|
|
839
|
+
},
|
|
840
|
+
"resource-create / resource-update / resource-delete": {
|
|
841
|
+
"description": "Generate and plan one operation; these commands do not apply writes.",
|
|
842
|
+
"parameters": [
|
|
843
|
+
{"name": "--resource-type", "required": True, "description": "Allowlisted resource type."},
|
|
844
|
+
{"name": "--spec-json / --set-json", "required": False, "description": "Create or update fields."},
|
|
845
|
+
{"name": "--resource-id / --version-hash", "required": False, "description": "Required by update/delete."},
|
|
846
|
+
{"name": "--output", "required": False, "description": "Write the generated ChangeSet under LICOS_PROJECT_PATH."},
|
|
847
|
+
],
|
|
848
|
+
"example": "licos-platform industrial resource-update --resource-type collectionPoint --resource-id point-id --version-hash HASH --set-json '{\"name\":\"炉温\"}'",
|
|
849
|
+
},
|
|
850
|
+
"realtime-config": {
|
|
851
|
+
"description": "Build the platform WebSocket URL and subscribe message for application code.",
|
|
852
|
+
"parameters": [
|
|
853
|
+
{"name": "--point-id / --tag-code", "required": True, "description": "At least one selector; repeatable."},
|
|
854
|
+
{"name": "--transport", "required": False, "description": "auto/websocket defaults to WebSocket; mqtt is explicit."},
|
|
855
|
+
],
|
|
856
|
+
"example": "licos-platform industrial realtime-config --point-id point-id --transport websocket",
|
|
857
|
+
},
|
|
858
|
+
"point-current / point-history": {
|
|
859
|
+
"description": "Read current or historical point values.",
|
|
860
|
+
"parameters": [{"name": "point_id", "required": True, "description": "Collection point ID."}],
|
|
861
|
+
"example": "licos-platform industrial point-current point-id",
|
|
862
|
+
},
|
|
863
|
+
"point-write": {
|
|
864
|
+
"description": "Dry-run or control a writable project-managed point.",
|
|
865
|
+
"parameters": [
|
|
866
|
+
{"name": "point_id", "required": True, "description": "Collection point ID."},
|
|
867
|
+
{"name": "--value-json", "required": True, "description": "JSON scalar/object value."},
|
|
868
|
+
{"name": "--reason / --ticket", "required": True, "description": "Audit reason and ticket."},
|
|
869
|
+
{"name": "--transport", "required": False, "description": "auto/http defaults to HTTP; mqtt is explicit."},
|
|
870
|
+
{"name": "--dry-run / --confirm", "required": True, "description": "One safety mode is required."},
|
|
871
|
+
],
|
|
872
|
+
"example": "licos-platform industrial point-write point-id --value-json 80 --reason 调试 --ticket T-1 --confirm",
|
|
873
|
+
},
|
|
874
|
+
"video-stream / video-start / video-stop": {
|
|
875
|
+
"description": "Get playback options or explicitly start/stop a project-managed video preview.",
|
|
876
|
+
"parameters": [
|
|
877
|
+
{"name": "channel_id", "required": True, "description": "Video channel ID."},
|
|
878
|
+
{"name": "--protocol", "required": False, "description": "Start defaults to http-flv."},
|
|
879
|
+
{"name": "--confirm", "required": True, "description": "Required by start/stop."},
|
|
880
|
+
],
|
|
881
|
+
"example": "licos-platform industrial video-start channel-id --protocol http-flv --confirm",
|
|
882
|
+
},
|
|
883
|
+
},
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
|
|
770
887
|
HELP_TOPICS = {
|
|
771
888
|
"storage": STORAGE_HELP,
|
|
772
889
|
"database": DATABASE_HELP,
|
|
773
890
|
"knowledge": KNOWLEDGE_HELP,
|
|
774
891
|
"oauth": OAUTH_HELP,
|
|
892
|
+
"industrial": INDUSTRIAL_HELP,
|
|
775
893
|
"uns": UNS_HELP,
|
|
776
894
|
}
|
|
777
895
|
|