Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/99-others/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"label": "其他",
"key": "general-other",
"position": 99,
"collapsible": true
}
}
62 changes: 49 additions & 13 deletions docs/developers/cocli/3-cli-action-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,54 @@ coScene 的动作系统可以用来触发复杂的计算和处理过程,通过
cocli action -h
```

![cocli-action-help](./img/6-3-cocli-action-help.png)
```
Work with coScene action.

# 列出当前项目中的动作
Usage:
cocli action [command]

```bash
cocli action list
```
Available Commands:
list List actions in the current project
list-run List action-runs in the current project
run Create an action run.

![cocli-list-actions](./img/6-3-cocli-list-actions.png)
Flags:
-h, --help help for action

默认 List 下,命令行会将项目中所有的动作都列出来。通过 Category 类别以及 Author 作者,
我们可以更好的区分想要的动作。
Global Flags:
--config string config file path (default "/Users/yujing/.cocli.yaml")
--log-level string log level, one of: trace|debug|info|warn|error (default "info")

当然我们也可以使用 `grep` 等标准命令来做进一步的筛选
Use "cocli action [command] --help" for more information about a command.
```

# 列出当前项目中的动作 {#list-actions-in-the-current-project}

```bash
cocli action list
```

![cocli-list-actions-grep-system](./img/6-3-action-list-filtering.png)
```
ID CATEGORY TITLE AUTHOR UPDATE TIME
5110ab15-9cc9-452b-b9d6-46be3adc7ef4 system analysis-export 1970-01-01T08:00:00+08:00
c2a0f23a-0384-4de3-bed6-ee27e457c714 system copy-record 1970-01-01T08:00:00+08:00
7a605493-628e-4348-9c3d-446cc6cbfcb1 system create-task 1970-01-01T08:00:00+08:00
bf9b33a3-1f00-44a8-afb8-a9920b9b66e6 system csv-mcap-converter 1970-01-01T08:00:00+08:00
a142623d-b7f9-4989-a8fe-7d12e9f66694 system curve-comparison 1970-01-01T08:00:00+08:00
5ecf5286-cb74-470f-a172-6cc8f346191f system decompress-file 1970-01-01T08:00:00+08:00
73c5d00c-7c3d-41b9-b3d2-31d7b54df94e system event-creator 1970-01-01T08:00:00+08:00
a903fb83-f028-4bef-ab5a-c6a1c7df9a69 system extraction 1970-01-01T08:00:00+08:00
e99fecdb-74c5-41f9-8061-841d054d52a8 system hdf5-mcap-converter 1970-01-01T08:00:00+08:00
7b48486a-b94d-4558-ac79-8c2b91ab0f50 system mcap-hdf5-converter 1970-01-01T08:00:00+08:00
d8fcf7dd-b7f7-4c5d-ae4a-c45ba0321c89 system parse-pcap-and-upload 1970-01-01T08:00:00+08:00
06105ba0-3a69-4fc4-9bf4-8795b423e8fe system record-auto-diagnosis 1970-01-01T08:00:00+08:00
68813bbe-d4e4-478d-acce-49f790e9cea7 system record-clipper 1970-01-01T08:00:00+08:00
f9ceb8c8-63c3-4b37-a057-e9f70755e354 system remote-file-for-record 1970-01-01T08:00:00+08:00
fb1bb37a-7b27-11ee-b962-0242ac120002 system ros2-mcap-converter 1970-01-01T08:00:00+08:00
6cdf7cf9-d635-4cad-9333-cb58fc6a8e24 system yw-cyber-converter 1970-01-01T08:00:00+08:00
```

## 触发动作
## 触发动作 {#trigger-an-action}

找到我们想要的执行的动作之后,我们可以在命令行中,直接触发这个动作,实现全流程的自动化。

Expand All @@ -43,7 +73,10 @@ ACTION_ID=$(cocli action list | grep 'coScene-test' | cut -d ' ' -f1)
cocli action run $ACTION_ID $RECORD_ID
```

![cocli-run-action-manual-confirm](./img/6-3-run-action-confirm.png)
```
The final parameters in the action run to be created:
Action run created successfully.
```

执行动作是一个比较消耗计算和存储资源的操作,在没有 `-f` 标识位的情况下,需要手动确认
才会真正执行。如果对当前操作不需要进行手动确认的,可以使用 `-f` 标志直接跳过。这在批量
Expand All @@ -53,7 +86,10 @@ cocli action run $ACTION_ID $RECORD_ID
cocli action run $ACTION_ID $RECORD_ID -f
```

![cocli-run-action-force](./img/6-3-run-action-force.png)
```
The final parameters in the action run to be created:
Action run created successfully.
```

较为复杂的动作可能会需要额外的参数对动作进行定制,您可以使用 `-p` 的标志位提供这些参数

Expand Down
Binary file not shown.
Binary file removed docs/developers/cocli/img/6-3-cocli-action-help.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed docs/developers/cocli/img/6-3-run-action-force.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/viz/8-extensions/5-api/6-other/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"label": "其他",
"key": "viz-extensions-other",
"position": 6,
"collapsible": true,
"link": {
Expand Down
4 changes: 3 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ const config = {
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenAnchors: 'throw',
onBrokenMarkdownLinks: 'throw',
onDuplicateRoutes: 'throw',
favicon: 'img/favicon.ico',
markdown: {
mermaid: true,
hooks: {
onBrokenMarkdownLinks: 'throw',
},
},
themes: ['@docusaurus/theme-mermaid'],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,52 @@ The coScene action system can be used to trigger complex calculations and proces
cocli action -h
```

![cocli-action-help](./img/cocli-action-help.png)
```
Work with coScene action.

Usage:
cocli action [command]

Available Commands:
list List actions in the current project
list-run List action-runs in the current project
run Create an action run.

Flags:
-h, --help help for action

Global Flags:
--config string config file path (default "/Users/yujing/.cocli.yaml")
--log-level string log level, one of: trace|debug|info|warn|error (default "info")

Use "cocli action [command] --help" for more information about a command.
```

# List Actions in the Current Project

```bash
cocli action list
```

![cocli-list-actions](./img/cocli-list-actions.png)

By default, the list command will display all actions in the project. You can better distinguish the desired actions by category and author.

Of course, you can also use standard commands like `grep` for further filtering.
![cocli-list-actions-grep-system](./img/cocli-list-actions-grep-system.png)
```
ID CATEGORY TITLE AUTHOR UPDATE TIME
5110ab15-9cc9-452b-b9d6-46be3adc7ef4 system analysis-export 1970-01-01T08:00:00+08:00
c2a0f23a-0384-4de3-bed6-ee27e457c714 system copy-record 1970-01-01T08:00:00+08:00
7a605493-628e-4348-9c3d-446cc6cbfcb1 system create-task 1970-01-01T08:00:00+08:00
bf9b33a3-1f00-44a8-afb8-a9920b9b66e6 system csv-mcap-converter 1970-01-01T08:00:00+08:00
a142623d-b7f9-4989-a8fe-7d12e9f66694 system curve-comparison 1970-01-01T08:00:00+08:00
5ecf5286-cb74-470f-a172-6cc8f346191f system decompress-file 1970-01-01T08:00:00+08:00
73c5d00c-7c3d-41b9-b3d2-31d7b54df94e system event-creator 1970-01-01T08:00:00+08:00
a903fb83-f028-4bef-ab5a-c6a1c7df9a69 system extraction 1970-01-01T08:00:00+08:00
e99fecdb-74c5-41f9-8061-841d054d52a8 system hdf5-mcap-converter 1970-01-01T08:00:00+08:00
7b48486a-b94d-4558-ac79-8c2b91ab0f50 system mcap-hdf5-converter 1970-01-01T08:00:00+08:00
d8fcf7dd-b7f7-4c5d-ae4a-c45ba0321c89 system parse-pcap-and-upload 1970-01-01T08:00:00+08:00
06105ba0-3a69-4fc4-9bf4-8795b423e8fe system record-auto-diagnosis 1970-01-01T08:00:00+08:00
68813bbe-d4e4-478d-acce-49f790e9cea7 system record-clipper 1970-01-01T08:00:00+08:00
f9ceb8c8-63c3-4b37-a057-e9f70755e354 system remote-file-for-record 1970-01-01T08:00:00+08:00
fb1bb37a-7b27-11ee-b962-0242ac120002 system ros2-mcap-converter 1970-01-01T08:00:00+08:00
6cdf7cf9-d635-4cad-9333-cb58fc6a8e24 system yw-cyber-converter 1970-01-01T08:00:00+08:00
```

## Trigger an Action

Expand All @@ -40,15 +72,21 @@ ACTION_ID=$(cocli action list | grep 'coScene-test' | cut -d ' ' -f1)
cocli action run $ACTION_ID $RECORD_ID
```

![cocli-run-action-manual-confirm](./img/cocli-run-action-manual-confirm.png)
```
The final parameters in the action run to be created:
Action run created successfully.
```

Executing an action is a resource-intensive operation. Without the `-f` flag, you need to manually confirm the execution. If you do not need manual confirmation for the current operation, you can use the `-f` flag to skip it. This is very useful when processing large amounts of data in bulk.

```bash
cocli action run $ACTION_ID $RECORD_ID -f
```

![cocli-run-action-force](./img/cocli-run-action-force.png)
```
The final parameters in the action run to be created:
Action run created successfully.
```

More complex actions may require additional parameters for customization. You can provide these parameters using the `-p` flag.

Expand All @@ -62,6 +100,6 @@ Please note that in this calling mode, if there are parameters other than `param

After successfully triggering an action, you can view the invocation history to see the actions you have triggered.

## Find All Invocation Records of a Specific Action

## Filter by Status
```bash
cocli action list-run
```
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"format:write": "prettier --write --loglevel warn \"./**/*.{js,jsx,ts,tsx,css,md,json}\" "
},
"dependencies": {
"@docusaurus/core": "^3.8.1",
"@docusaurus/preset-classic": "^3.8.1",
"@docusaurus/theme-common": "^3.8.1",
"@docusaurus/theme-mermaid": "^3.8.1",
"@docusaurus/core": "^3.9.2",
"@docusaurus/preset-classic": "^3.9.2",
"@docusaurus/theme-common": "^3.9.2",
"@docusaurus/theme-mermaid": "^3.9.2",
"@mdx-js/react": "^3.1.0",
"autoprefixer": "^10.4.21",
"postcss": "^8.5.4",
Expand All @@ -28,10 +28,10 @@
"tailwindcss": "^3.4.17"
},
"devDependencies": {
"@docusaurus/faster": "^3.8.1",
"@docusaurus/module-type-aliases": "^3.8.1",
"@docusaurus/tsconfig": "^3.8.1",
"@docusaurus/types": "^3.8.1",
"@docusaurus/faster": "^3.9.2",
"@docusaurus/module-type-aliases": "^3.9.2",
"@docusaurus/tsconfig": "^3.9.2",
"@docusaurus/types": "^3.9.2",
"@tsconfig/docusaurus": "^2.0.3",
"@types/react": "^19.0.12",
"prettier": "^3.6.2",
Expand All @@ -52,4 +52,4 @@
"engines": {
"node": ">= 20"
}
}
}
Loading