@xqyz/xq-cli 0.1.0
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 +159 -0
- package/bin/xq-cli.js +3 -0
- package/package.json +24 -0
- package/src/cli.mjs +3349 -0
- package/src/fileTypeConfig.mjs +29 -0
- package/src/templateData.mjs +118 -0
package/README.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# @xqyz/xq-cli
|
|
2
|
+
|
|
3
|
+
Standalone CLI project for xique brand task workflows.
|
|
4
|
+
|
|
5
|
+
Project execution rules for agents live in [AGENTS.md](./AGENTS.md). That file defines the mandatory config-confirmation flow before any bid generation run.
|
|
6
|
+
|
|
7
|
+
## Install from this repo
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g D:\code\xq-cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Pack and share
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
cd D:\code\xq-cli
|
|
17
|
+
npm pack
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
That command produces a `.tgz` tarball which can be shared and installed with:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install -g .\xqyz-xq-cli-0.1.0.tgz
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
xq-cli login --base-url https://xqai.atest.qianlima.com/api
|
|
30
|
+
xq-cli login --base-url https://xqai.atest.qianlima.com/api --name mahao3 --password 123456
|
|
31
|
+
xq-cli wizard
|
|
32
|
+
xq-cli wizard --file D:\bids\tender.docx
|
|
33
|
+
xq-cli init --file D:\bids\tender.docx --wait
|
|
34
|
+
xq-cli outline --cid <cid> --interactive --wait
|
|
35
|
+
xq-cli outline --cid <cid> --wait
|
|
36
|
+
xq-cli write --cid <cid> --wait
|
|
37
|
+
xq-cli status --cid <cid> --content --json
|
|
38
|
+
xq-cli export --cid <cid> --interactive --out D:\output
|
|
39
|
+
xq-cli export --cid <cid> --out D:\output
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`login` now defaults to browser authorization. If you explicitly pass `--name` and `--password`, the CLI falls back to password login.
|
|
43
|
+
|
|
44
|
+
When `outline --wait` or `write --wait` hits a required response-basis step, the CLI will pause and ask you to choose `0/1/2` before continuing. It no longer auto-selects a default when you just press Enter.
|
|
45
|
+
|
|
46
|
+
`write --wait` now also retries `sequelForOutline` when the directory phase stalls at the outline-complete step, and auto-calls `generateAllUnfinished` if the backend reports `100%` but still leaves unfinished chapters behind.
|
|
47
|
+
|
|
48
|
+
`write` follows the frontend flow:
|
|
49
|
+
|
|
50
|
+
`order/charge -> c/viewStep(101) -> task/autoGenerateContent`
|
|
51
|
+
|
|
52
|
+
## Interactive menus
|
|
53
|
+
|
|
54
|
+
Use the full wizard if you want a CLI flow close to the frontend configuration panel:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
xq-cli wizard
|
|
58
|
+
xq-cli wizard --file D:\bids\tender.docx
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The wizard will prompt for:
|
|
62
|
+
|
|
63
|
+
- source bid file
|
|
64
|
+
- article length
|
|
65
|
+
- writing mode
|
|
66
|
+
- visual style
|
|
67
|
+
- table quantity / color / style
|
|
68
|
+
- planning mode
|
|
69
|
+
- optional image-source toggles
|
|
70
|
+
- export template / layout / output path
|
|
71
|
+
|
|
72
|
+
You can also open menus for a single phase:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
xq-cli outline --cid <cid> --interactive --wait
|
|
76
|
+
xq-cli export --cid <cid> --interactive --out D:\output
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Config choices
|
|
80
|
+
|
|
81
|
+
`xq-cli` now exposes the same major bid-book generation settings that the frontend outline/download flow uses.
|
|
82
|
+
|
|
83
|
+
Inspect the selectable enums with:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
xq-cli choices
|
|
87
|
+
xq-cli choices outline
|
|
88
|
+
xq-cli choices export --json
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Outline generation now supports frontend-backed options such as:
|
|
92
|
+
|
|
93
|
+
- `--page-scope` / `--page-scope-code`
|
|
94
|
+
- `--base`
|
|
95
|
+
- `--theme-style`
|
|
96
|
+
- `--table-quantity`
|
|
97
|
+
- `--table-color`
|
|
98
|
+
- `--table-style`
|
|
99
|
+
- `--info-img`, `--scene-img`, `--online-img`, `--mermaid-img`, `--knowledge-img`
|
|
100
|
+
- `--mermaid-style`
|
|
101
|
+
- `--plan-mode`
|
|
102
|
+
- `--multi-bid-id`, `--multi-bid-type`
|
|
103
|
+
- `--epc-engineer-type`
|
|
104
|
+
|
|
105
|
+
Export now supports frontend-backed style options such as:
|
|
106
|
+
|
|
107
|
+
- `--template`
|
|
108
|
+
- `--style-json`
|
|
109
|
+
- `--start-index`
|
|
110
|
+
- `--auto-number`
|
|
111
|
+
- `--add-mark`
|
|
112
|
+
- `--layout`
|
|
113
|
+
- `--top-margin`, `--bottom-margin`, `--left-margin`, `--right-margin`
|
|
114
|
+
- `--table-color`, `--table-style`
|
|
115
|
+
- `--skeleton-color`
|
|
116
|
+
- `--img-title-color`, `--heading4-color`, `--heading5-color`
|
|
117
|
+
- `--content-title-color`, `--content-color`
|
|
118
|
+
- `--heading4-text-color`, `--heading5-text-color`, `--content-title-text-color`, `--img-title-text-color`
|
|
119
|
+
|
|
120
|
+
Example outline config:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
xq-cli outline --cid <cid> --page-scope 3 --base expert --theme-style 4 --table-quantity rich --table-color blue --table-style zebra --mermaid-style blue --knowledge-img 1 --scene-img 1 --plan-mode quick --wait
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Example export config:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
xq-cli export --cid <cid> --template 2 --layout enhanced --table-color green --table-style header --auto-number 1 --add-mark 0 --top-margin 2.54 --bottom-margin 2.54 --left-margin 3.18 --right-margin 3.18 --skeleton-color 1276C1 --img-title-color 1276C1 --out D:\output
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Advanced export style JSON can mirror the frontend custom format dialog payload:
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"startIndex": 1,
|
|
137
|
+
"directorySettings": [
|
|
138
|
+
{ "type": 1, "serialNumber": "1", "fontName": "SimSun", "fontSize": "16", "alignment": "1", "bold": "1", "level": "1" }
|
|
139
|
+
],
|
|
140
|
+
"contentSettings": {
|
|
141
|
+
"serialNumber1": "10",
|
|
142
|
+
"serialNumber2": "11",
|
|
143
|
+
"serialNumber3": "12",
|
|
144
|
+
"serialNumber4": "13",
|
|
145
|
+
"fontName": "SimSun",
|
|
146
|
+
"fontSize": "12",
|
|
147
|
+
"alignment": "3",
|
|
148
|
+
"bold": "0"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
xq-cli export --cid <cid> --template 5 --style-json D:\styles\custom-style.json --out D:\output
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## OpenCLI plugin
|
|
158
|
+
|
|
159
|
+
This repo also includes a local OpenCLI plugin in `opencli-plugin-xique/`.
|
package/bin/xq-cli.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xqyz/xq-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI for xique bid-book task workflows",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"pack": "npm pack"
|
|
8
|
+
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"xq-cli": "./bin/xq-cli.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"bin",
|
|
14
|
+
"src",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"axios": "^0.27.2",
|
|
22
|
+
"form-data": "^4.0.4"
|
|
23
|
+
}
|
|
24
|
+
}
|