@fateforge/creo-cli 1.0.0 → 1.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 CHANGED
@@ -11,7 +11,7 @@ Lets an AI Agent read Creo Parametric models and change their dimensions, parame
11
11
  ![platform](https://img.shields.io/badge/platform-Windows-555555)
12
12
  ![risk](https://img.shields.io/badge/risk-T2-d29922)
13
13
  ![maturity](https://img.shields.io/badge/maturity-verified-8957e5)
14
- ![spec](https://img.shields.io/badge/spec-tool--driver--cli--spec_1.0.5-0969da)
14
+ ![spec](https://img.shields.io/badge/spec-tool--driver--cli--spec_1.0.6-0969da)
15
15
  ![license](https://img.shields.io/badge/license-Apache--2.0-blue)
16
16
  <!-- driver:badges:end -->
17
17
 
@@ -24,8 +24,8 @@ English | [中文](README_zh.md)
24
24
  | Modes | session |
25
25
  | Systems and CPUs | Windows (x64) |
26
26
  | Risk tier | T2 |
27
- | Maturity | verified: 0 draft, 12 verified, 3 stable |
28
- | Specification | tool-driver-cli-spec 1.0.5 |
27
+ | Maturity | verified: 0 draft, 16 verified, 13 stable |
28
+ | Specification | tool-driver-cli-spec 1.0.6 |
29
29
  | Host component | yes |
30
30
  <!-- driver:info-card:end -->
31
31
 
@@ -84,15 +84,24 @@ Every command of creo-cli, generated from its command registration; `(dangerous)
84
84
  - `job`: list, get, cancel
85
85
  - `plugin`: get, install, remove
86
86
  - `knowledge`: list, get, search, create, delete
87
- - `feature`: get, list, update
88
- - `model`: get, export, render
87
+ - `feature`: get, list, update, delete (dangerous)
88
+ - `model`: get, check, update, export, render
89
89
  - `geometry`: list
90
90
  - `distance`: get
91
91
  - `dimension`: list, update
92
- - `parameter`: list, update
93
- - `relation`: list
92
+ - `parameter`: list, update, create
93
+ - `relation`: list, update
94
94
  - `material`: list
95
95
  - `component`: list
96
+ - `extrude`: create
97
+ - `revolve`: create
98
+ - `shell`: create
99
+ - `round`: create
100
+ - `pattern`: create
101
+ - `plane`: create
102
+ - `axis`: create
103
+ - `chamfer`: create
104
+ - `draft`: create
96
105
  <!-- driver:command-map:end -->
97
106
 
98
107
  ## How It Works
@@ -111,7 +120,7 @@ creo-cli prints one JSON envelope for every call. `creo-cli reference` lists eve
111
120
 
112
121
  `--dry-run` shows the preview of any write and changes nothing. A confirm token works once, within 10 minutes, and only for the change it previewed. When the scope file sets `"confirm": "always"`, every write except stopping work is two-step, so that a person can approve each preview.
113
122
 
114
- **Saving in session mode.** A change is not a save. After a change, the receipt reports `persistence: unchanged` and the document stays dirty; only `creo-cli doc save` writes the document's file. Its preview lists every change since the last save, including changes a person made in Creo Parametric (`origin: external`) and writes whose outcome is still unknown.
123
+ **Saving in session mode.** A change is not a save. After a change, the receipt reports `persistence: unchanged` and the document stays dirty; only `creo-cli doc save` writes the document's file. Its preview lists every change since the last save, including changes a person made in Creo Parametric (`origin: external`) and writes whose outcome is still unknown. A command that Creo Parametric itself saves at once is two-step and reports `persistence: saved`.
115
124
 
116
125
  **Receipts.** Every write returns a receipt that reports separately whether the change ran, took effect, was delivered, was saved and was verified. When the reply to a write is lost, creo-cli returns `E_OUTCOME_UNKNOWN` with the command that settles the outcome, and the write is never sent twice.
117
126
 
@@ -190,13 +199,15 @@ Version 1.0 does not create models or features, and does not edit assemblies or
190
199
  | `CREO_CLI_SCOPE_FILE` | `scope.json` in the state directory | The scope file (see Authorization) |
191
200
  | `HTTPS_PROXY`, `HTTP_PROXY`, `NO_PROXY` | not set | Proxies for `update` and `doctor`, the only commands that contact the npm registry |
192
201
  | `CREO_CLI_JDK` | the JDK of `PRO_JAVA_COMMAND`, else `JAVA_HOME` | The JDK 25 `plugin install` builds the host component with |
202
+ | `CREO_CLI_VCVARS` | the newest Visual Studio with the x64 C compiler | The `vcvars64.bat` `plugin install` builds the host component's C library with |
193
203
  | `CREO_CLI_FAKE_HOST` | not set | For tests only: sends every call to the fake host instead of Creo Parametric and marks every result as simulated |
194
204
 
195
205
  ### Finding Creo Parametric
196
206
 
197
207
  - Installation: creo-cli looks under `C:\Program Files\PTC`, `C:\PTC`, `D:\PTC` and `E:\PTC`, up to four folders deep, for a `Common Files` folder that holds Object TOOLKIT Java (`text\java\otk.jar`). The version comes from the installation folder's name, such as `Creo 13.4.1.0`. `creo-cli doctor` shows what it found.
198
208
  - Running instances: every running `xtop.exe` is a session, with an ID made of its process ID and start time, such as `creo-9184-1d9a4c2e`. `creo-cli session list` lists them; a modal dialog open in Creo shows as `blocked`.
199
- - The host component: a session can be driven only while its host component is loaded. creo-cli ships it as source: `creo-cli plugin install` compiles it with a JDK 25 and unlocks it with PTC's `protk_unlock`, which needs the Creo Object TOOLKIT Java development license, or its extension license with a Creo TOOLKIT license, on the license server; running it needs the Object TOOLKIT Java runtime, development or extension license. Run `creo-cli plugin install`, add one line to the `config.pro` Creo starts with, and start Creo: `toolkit_registry_file <install_path>\protk.dat`, with the `install_path` that `creo-cli plugin get` shows, a folder under `%LOCALAPPDATA%\creo-cli\host`. The line stays the same across upgrades; creo-cli never changes `config.pro` itself. Creo loads the host component only at start, so after an upgrade a person restarts Creo.
209
+ - The host component: a session can be driven only while its host component is loaded. creo-cli ships it as source: `creo-cli plugin install` compiles its Java part with a JDK 25 and unlocks it with PTC's `protk_unlock`, which needs the Creo Object TOOLKIT Java development license, or its extension license with a Creo TOOLKIT license, on the license server; running it needs the Object TOOLKIT Java runtime, development or extension license. `plugin install` also compiles its C library, which sketches and ending Creo need, with Visual Studio 2022's C compiler (or its Build Tools with "Desktop development with C++") against the Creo TOOLKIT component of your Creo, and unlocks it with a Creo TOOLKIT development license; without them the Java part is still installed and only the commands that need the C library are refused, with the reason. Run `creo-cli plugin install`, add one line to the `config.pro` Creo starts with, and start Creo: `toolkit_registry_file <install_path>\protk.dat`, with the `install_path` that `creo-cli plugin get` shows, a folder under `%LOCALAPPDATA%\creo-cli\host`. The line stays the same across upgrades; creo-cli never changes the `config.pro` you start Creo with. Creo loads the host component only at start, so after an upgrade a person restarts Creo.
210
+ - Creo started by creo-cli: `creo-cli session open` starts a Creo of its own from the folder `start` beside the host component, with a `config.pro` there that loads the host component and sets `open_protk_unsigned_apps always`, so that this Creo loads the unsigned C library without asking; your own Creo keeps its settings. `session close` ends such a Creo as File > Exit does, and refuses while a model has unsaved changes.
200
211
  - `CREO_CLI_STATE_DIR` moves the state directory, and with it the place of `protk.dat` and of the discovery files the host component writes.
201
212
 
202
213
  ## Uninstall
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fateforge/creo-cli",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Lets an AI Agent operate Creo Parametric safely from the command line.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -27,6 +27,6 @@
27
27
  "provenance": true
28
28
  },
29
29
  "optionalDependencies": {
30
- "@fateforge/creo-cli-win32-x64": "1.0.0"
30
+ "@fateforge/creo-cli-win32-x64": "1.1.0"
31
31
  }
32
32
  }
@@ -4,17 +4,17 @@ description: >-
4
4
  Operates Creo Parametric through the creo-cli command line: checks the install,
5
5
  reads and changes Creo Parametric with preview and confirmation, and reports what
6
6
  changed, what was saved and what was verified.
7
- Use it to ask about a Creo part, assembly or drawing (volume, mass, features, dimensions,
8
- parameters, relations, materials, components), to change a dimension's value or tolerance or a
9
- parameter, to suppress, resume or rename a feature, and to open, save, close and export models
10
- (STEP, IGES, STL, PDF) or take a JPEG. Not for creating models or features, editing assemblies
11
- or drawings, or Windchill: creo-cli 1.0 cannot do them.
12
- 查询 Creo 零件、装配、工程图(体积、质量、特征、尺寸、参数、关系、材料、元件),修改尺寸的值或公差、
13
- 修改参数,隐含、恢复、改名特征,打开、保存、关闭、导出模型(STEP、IGES、STL、PDF)或出 JPEG 图片。
14
- 不能新建模型或特征、修改装配或工程图、操作 Windchill。
7
+ Use it to ask about a Creo part, assembly or drawing (volume, mass, dimensions, parameters,
8
+ relations, materials, components), to change a dimension's value or tolerance or a parameter,
9
+ to start or close Creo, and to create, open, save, close and export models (STEP, IGES, STL,
10
+ PDF) or take a JPEG. Building features is in creo-feature. Not for editing assemblies or
11
+ drawings, or Windchill.
12
+ 查询 Creo 零件、装配、工程图(体积、质量、尺寸、参数、关系、材料、元件),修改尺寸的值或公差、修改参数,
13
+ 启动或关闭 Creo,新建、打开、保存、关闭、导出模型(STEP、IGES、STL、PDF)或出 JPEG 图片。建特征见 creo-feature。
14
+ 不能修改装配或工程图、操作 Windchill。
15
15
  用 creo-cli 命令行操作 Creo Parametric:检查安装、读取、预览确认后修改,并汇报改了什么、存了没有、验证了没有。
16
16
  metadata:
17
- version: 1.0.0
17
+ version: 1.1.0
18
18
  ---
19
19
 
20
20
  # creo-cli
@@ -43,13 +43,12 @@ Check `ok`; on failure, read `error.details.next_action`.
43
43
  - `job`: list, get, cancel
44
44
  - `plugin`: get, install, remove
45
45
  - `knowledge`: list, get, search, create, delete
46
- - `feature`: get, list, update
47
- - `model`: get, export, render
46
+ - `model`: get, update, export, render
48
47
  - `geometry`: list
49
48
  - `distance`: get
50
49
  - `dimension`: list, update
51
- - `parameter`: list, update
52
- - `relation`: list
50
+ - `parameter`: list, update, create
51
+ - `relation`: list, update
53
52
  - `material`: list
54
53
  - `component`: list
55
54
  <!-- driver:command-map:end -->
@@ -86,7 +85,7 @@ Check a change with its `result` and receipt, and with the read commands, which
86
85
 
87
86
  ### Save
88
87
 
89
- A change in session mode is not saved until `creo-cli doc save`; its receipt says `persistence: unchanged`. A receipt with verification `deferred` is verified by the next `doc save` of that document; it is not verified before. Before confirming a save, check its preview: it lists every change since the last save, including changes made outside creo-cli (`origin: external`), and in `blocked_by` the operations whose outcome is still unknown. Settle those first.
88
+ A change in session mode whose receipt says `persistence: unchanged` is not saved until `creo-cli doc save`; a change the application saves at once says `saved`. A receipt with verification `deferred` is verified by the next `doc save` of that document; it is not verified before. Before confirming a save, check its preview: it lists every change since the last save, including changes made outside creo-cli (`origin: external`), and in `blocked_by` the operations whose outcome is still unknown. Settle those first.
90
89
 
91
90
  ### Long jobs and blocking
92
91
 
@@ -140,4 +139,5 @@ End every task with a report that answers each point separately:
140
139
 
141
140
  | Task | Skill |
142
141
  |---|---|
143
- | Every Creo Parametric task | `creo-cli`, this Skill |
142
+ | Model a part, add, read, suppress or rename features | `creo-feature` |
143
+ | Everything else in Creo Parametric | `creo-cli`, this Skill |
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: creo-feature
3
+ description: >-
4
+ Builds Creo parts feature by feature with creo-cli: sketched extrudes and cuts, shells,
5
+ rounds, chamfers, drafts, patterns, datum planes and axes, and reading, suppressing or
6
+ renaming features. Use it to model a new part or add features to one.
7
+ 一个特征一个特征地建 Creo 零件:草图拉伸和切除、抽壳、倒圆角、倒角、拔模、阵列、基准面和基准轴,
8
+ 以及读取、隐含、改名特征。用来建新零件或给零件加特征。
9
+ Not for reading or changing dimensions, parameters, materials, sessions, saving or exports;
10
+ use creo-cli for those. 不负责读改尺寸、参数、材料,会话、保存和导出;这些请用 creo-cli。
11
+ metadata:
12
+ version: 1.1.0
13
+ commands: [extrude create, revolve create, shell create, round create, chamfer create, draft create, pattern create, plane create, axis create, feature list, feature get, feature update, feature delete, model check]
14
+ ---
15
+
16
+ Read the entry Skill `creo-cli` first: it holds the install check, the write recipe, the STOP checkpoints, saving and the report. If it is not installed, stop and ask the user to reinstall creo-cli's Skills.
17
+
18
+ ## Commands
19
+
20
+ <!-- driver:command-map:start -->
21
+ - `extrude`: create
22
+ - `revolve`: create
23
+ - `shell`: create
24
+ - `round`: create
25
+ - `chamfer`: create
26
+ - `draft`: create
27
+ - `pattern`: create
28
+ - `plane`: create
29
+ - `axis`: create
30
+ - `feature`: list, get, update, delete (dangerous)
31
+ - `model`: check
32
+ <!-- driver:command-map:end -->
33
+
34
+ ## Knowledge
35
+
36
+ Read before the first feature of a task: `creo-sketches` (how to write `--sketch`), `creo-geometry-references` (naming faces and edges such as `BASE/end` and `edge(A, B)`) and `creo-units`.
37
+
38
+ ## Playbooks
39
+
40
+ ### Model a part
41
+
42
+ 1. Read the requirement and write down the features in order, each with its name, and the dimensions to name, such as `BODY_LENGTH` or `OUTLET_PITCH`. Name every dimension a later change will touch.
43
+ 2. Create the part with `creo-cli doc create --session <id> --kind part --path <file>`; it comes with PART_NO and DESCRIPTION.
44
+ 3. Build one feature per call, each with `--name`. For a sketch, give every position and size by a constraint or a dimension; run the call with `--dry-run` first when unsure, and fix what `blocked_by` lists.
45
+ 4. After each call check `result`: the bounding box, the change of volume (positive when material was added, negative for a cut) and the faces by place. When they are not what the step meant, fix it before the next feature: `feature update --status suppressed` takes a feature out of the way.
46
+ 5. Finally change one or two named dimensions with `dimension update`, check that the geometry follows, set them back, and save with `doc save`.
47
+
48
+ ### Repeat a feature
49
+
50
+ Name the leader's position dimension in its sketch, then `creo-cli pattern create --feature <leader> --along <axis> --count <n> --spacing <length> --spacing-name <NAME>`. The count includes the leader.