sim-cli-core 0.3.3__py3-none-any.whl → 0.3.5__py3-none-any.whl

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.
@@ -0,0 +1,390 @@
1
+ Metadata-Version: 2.4
2
+ Name: sim-cli-core
3
+ Version: 0.3.5
4
+ Summary: Make every engineering tool agent-native — a CLI runtime that lets LLM agents launch, drive, and observe CAD/CAE software
5
+ Project-URL: Homepage, https://github.com/svd-ai-lab/sim-cli
6
+ Project-URL: Repository, https://github.com/svd-ai-lab/sim-cli
7
+ Project-URL: Issues, https://github.com/svd-ai-lab/sim-cli/issues
8
+ Project-URL: Documentation, https://github.com/svd-ai-lab/sim-cli#readme
9
+ Project-URL: Changelog, https://github.com/svd-ai-lab/sim-cli/blob/main/CHANGELOG.md
10
+ Author-email: Weiqi Ji <jiweiqi10@gmail.com>
11
+ License-Expression: Apache-2.0
12
+ License-File: LICENSE
13
+ License-File: NOTICE
14
+ Keywords: agent,agentic,cad,cae,cfd,fea,llm,out-of-tree,plugins,simulation
15
+ Classifier: Development Status :: 3 - Alpha
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: Science/Research
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Scientific/Engineering
24
+ Classifier: Topic :: Scientific/Engineering :: Physics
25
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
+ Requires-Python: >=3.10
27
+ Requires-Dist: click>=8.0
28
+ Requires-Dist: fastapi>=0.115
29
+ Requires-Dist: httpx>=0.28
30
+ Requires-Dist: lxml>=5.0
31
+ Requires-Dist: pillow>=10
32
+ Requires-Dist: psutil>=5.9; sys_platform == 'win32'
33
+ Requires-Dist: pywinauto>=0.6.8; sys_platform == 'win32'
34
+ Requires-Dist: pyyaml>=6.0
35
+ Requires-Dist: tomli>=2.0; python_version < '3.11'
36
+ Requires-Dist: uvicorn>=0.34
37
+ Provides-Extra: dev
38
+ Requires-Dist: pytest>=8.0; extra == 'dev'
39
+ Requires-Dist: ruff>=0.4; extra == 'dev'
40
+ Description-Content-Type: text/markdown
41
+
42
+ <div align="center">
43
+
44
+ <img src="assets/banner.svg" alt="sim — agent runtime for physics simulations" width="820">
45
+
46
+ <br>
47
+
48
+ **Let AI agents operate real CAE and physics solvers step by step.**
49
+
50
+ `sim` is an open-source CLI and local runtime that lets Codex, Claude Code,
51
+ GitHub Copilot, Gemini, and other agents work with simulation software through
52
+ solver-specific plugins and bundled skills. An agent can check what is
53
+ installed, connect to a solver, inspect live state, execute bounded steps,
54
+ capture artifacts, and leave checkpoints for an engineer to review.
55
+
56
+ <p align="center">
57
+ <a href="#quick-start-agent-setup"><img src="https://img.shields.io/badge/Quick_Start-agent_setup-3b82f6?style=for-the-badge" alt="Quick Start"></a>
58
+ <a href="#solver-plugins"><img src="https://img.shields.io/badge/Solvers-plugin_based-22c55e?style=for-the-badge" alt="Solver plugins"></a>
59
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache_2.0-eab308?style=for-the-badge" alt="License"></a>
60
+ </p>
61
+
62
+ <p align="center">
63
+ <img src="https://img.shields.io/badge/python-3.10%2B-3776AB?logo=python&logoColor=white" alt="Python 3.10+">
64
+ <img src="https://img.shields.io/badge/CLI-Click_8-blue" alt="Click">
65
+ <img src="https://img.shields.io/badge/server-FastAPI-009688?logo=fastapi&logoColor=white" alt="FastAPI">
66
+ <img src="https://img.shields.io/badge/transport-HTTP%2FJSON-orange" alt="HTTP/JSON">
67
+ <img src="https://img.shields.io/badge/status-alpha-f97316" alt="Status: alpha">
68
+ </p>
69
+
70
+ [Quick Start](#quick-start-agent-setup) · [COMSOL + Codex](#example-comsol-and-codex-on-one-machine) · [Agent Loop](#the-agent-loop) · [Remote Solvers](#local-vs-remote-solvers) · [Plugins](#solver-plugins) · [Commands](#common-commands)
71
+
72
+ </div>
73
+
74
+ ---
75
+
76
+ ## Who this is for
77
+
78
+ `sim` is for agents and people trying to get real simulation work done.
79
+
80
+ - **CAE engineers who already script solvers** and want an agent to help
81
+ automate COMSOL, Fluent, MATLAB, LTspice, Abaqus, HFSS, and similar tools
82
+ without losing inspection and recovery between steps.
83
+ - **Design engineers and occasional simulation users** who have agent
84
+ experience and want a "vibe CAE" workflow: ask for a simulation, watch the
85
+ model evolve, review screenshots or plots, and keep final artifacts.
86
+ - **AI agents** reading this repository to learn the safe setup and operating
87
+ loop before touching a solver.
88
+ - **Engineering leaders** evaluating whether agent-assisted simulation can be
89
+ repeatable, reviewable, and compatible with existing solver installations.
90
+
91
+ Plugin authoring, runtime internals, and driver protocol details live in
92
+ [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md).
93
+
94
+ ## What sim gives an agent
95
+
96
+ LLMs can often write solver scripts, but a one-shot script is a weak workflow:
97
+ it hides intermediate state, fails late, and makes recovery difficult.
98
+
99
+ `sim` gives an agent a small, repeatable control surface:
100
+
101
+ ```text
102
+ check solver -> connect -> inspect -> execute one bounded step
103
+ -> inspect result/state -> save artifact or checkpoint -> continue
104
+ ```
105
+
106
+ The solver-specific knowledge is not baked into the core CLI. It comes from
107
+ plugins. A plugin can provide both:
108
+
109
+ - a **driver**, so `sim` can launch or talk to the solver
110
+ - a **skill**, so the agent knows the solver-specific workflow, pitfalls, and
111
+ inspection rules
112
+
113
+ ## Human-in-the-loop collaboration
114
+
115
+ `sim` is designed for shared control, not unattended black-box automation.
116
+ When a solver plugin exposes live state through `sim inspect`, the agent can
117
+ re-read the current solver session after each meaningful step. That means an
118
+ engineer can cut in through the solver GUI, change geometry, parameters,
119
+ boundary conditions, plots, or saved artifacts, then ask the agent to inspect
120
+ again and continue from the real current state.
121
+
122
+ This is the collaboration model: the human can watch, correct, and steer; the
123
+ agent keeps using inspection and checkpoints instead of assuming its previous
124
+ script still matches the real solver state.
125
+
126
+ ## Quick Start: agent setup
127
+
128
+ Use this path when the agent and solver are on the same machine. You do not
129
+ need to start `sim serve` manually for the local happy path; `sim connect`
130
+ will use the local runtime. The default docs use
131
+ [`uv`](https://docs.astral.sh/uv/) so agents run the `sim` and plugins declared
132
+ by the current project instead of guessing which executable is on `PATH`.
133
+
134
+ `uv run sim ...` runs `sim` from this project environment, so it sees this
135
+ project's installed solver plugins. Run from the project root:
136
+
137
+ ```bash
138
+ uv init # only if this is not already a uv project
139
+ uv add sim-cli-core sim-plugin-comsol
140
+ uv run sim plugin sync-skills --target .agents/skills --copy
141
+ uv run sim check comsol
142
+ uv run sim plugin doctor comsol --deep
143
+ ```
144
+
145
+ Use `.agents/skills` for Codex and GitHub Copilot projects. For Claude Code,
146
+ sync to `.claude/skills` instead:
147
+
148
+ ```bash
149
+ uv run sim plugin sync-skills --target .claude/skills --copy
150
+ ```
151
+
152
+ ### Without uv
153
+
154
+ If you cannot use `uv`, create a normal Python virtual environment, install
155
+ `sim-cli-core` and the solver plugin into that environment, then run `sim`
156
+ from the activated environment.
157
+
158
+ macOS/Linux:
159
+
160
+ ```bash
161
+ python -m venv .venv
162
+ source .venv/bin/activate
163
+ python -m pip install --upgrade pip
164
+ python -m pip install sim-cli-core sim-plugin-comsol
165
+ sim plugin sync-skills --target .agents/skills --copy
166
+ sim check comsol
167
+ sim plugin doctor comsol --deep
168
+ ```
169
+
170
+ Windows PowerShell:
171
+
172
+ ```powershell
173
+ py -m venv .venv
174
+ .\.venv\Scripts\Activate.ps1
175
+ python -m pip install --upgrade pip
176
+ python -m pip install sim-cli-core sim-plugin-comsol
177
+ sim plugin sync-skills --target .agents/skills --copy
178
+ sim check comsol
179
+ sim plugin doctor comsol --deep
180
+ ```
181
+
182
+ ## Hand this prompt to your agent
183
+
184
+ After setup, give your coding agent a direct instruction like this:
185
+
186
+ ```text
187
+ Use the installed solver skill. Run sim through this project with
188
+ `uv run sim ...`. Check my local solver installation before connecting. Work
189
+ one bounded step at a time: connect, inspect the session, execute a small step,
190
+ inspect last.result and the live model state, then save or update a checkpoint
191
+ before continuing. Do not guess solver API names; inspect the live model or the
192
+ solver's local docs first. If I make manual changes in the solver UI,
193
+ re-inspect the live state before continuing instead of assuming your previous
194
+ script still matches the model. Report saved artifacts, numerical checks,
195
+ warnings, and anything that still needs human engineering review.
196
+ ```
197
+
198
+ ## Example: COMSOL and Codex on one machine
199
+
200
+ If COMSOL and Codex are on the same machine, start by installing the COMSOL
201
+ plugin and syncing its bundled skill into the `.agents/skills` project target:
202
+
203
+ ```bash
204
+ uv add sim-cli-core sim-plugin-comsol
205
+ uv run sim plugin sync-skills --target .agents/skills --copy
206
+ uv run sim check comsol
207
+ uv run sim plugin doctor comsol --deep
208
+ ```
209
+
210
+ Then ask Codex:
211
+
212
+ ```text
213
+ Use the installed COMSOL skill. Start by checking COMSOL through `uv run sim
214
+ check comsol`. If you need a visible live COMSOL Desktop session, use:
215
+
216
+ uv run sim connect --solver comsol --ui-mode gui --driver-option visual_mode=shared-desktop
217
+
218
+ After connecting, inspect session.health and comsol.model.identity. Confirm the
219
+ live model binding is healthy before treating the GUI as synchronized. For
220
+ non-trivial work, establish a case folder and save .mph checkpoints after major
221
+ layers. Build and solve one bounded step at a time.
222
+ ```
223
+
224
+ For COMSOL-specific details such as shared Desktop mode, offline `.mph`
225
+ inspection, Desktop attach fallback, model identity checks, and checkpoint
226
+ policy, follow the bundled COMSOL skill.
227
+
228
+ ## The agent loop
229
+
230
+ For any solver, the agent should prefer this loop over one large generated
231
+ script:
232
+
233
+ 1. `uv run sim check <solver>` to detect installed solver versions and plugin
234
+ compatibility.
235
+ 2. `uv run sim connect --solver <solver> ...` for live stateful work, or
236
+ `uv run sim run` for a deterministic one-shot script.
237
+ 3. `uv run sim inspect session.versions` and the solver-specific health or
238
+ identity target before changing state.
239
+ 4. `uv run sim exec --file step.py --label <step>` for one bounded modeling
240
+ or analysis step.
241
+ 5. `uv run sim inspect last.result` and solver-specific state before
242
+ continuing.
243
+ 6. Save checkpoints and artifacts when the solver plugin or skill requires
244
+ them.
245
+ 7. `uv run sim disconnect` when the session is done.
246
+
247
+ Screenshots and plots help humans review the result, but engineering
248
+ acceptance should prefer numeric evidence when the solver skill defines it:
249
+ mesh statistics, convergence, finite probes, conservation checks, tolerances,
250
+ or expected trends.
251
+
252
+ ## Local vs remote solvers
253
+
254
+ **Same machine:** install `sim-cli-core` and the solver plugin into the project
255
+ environment, sync the skill to your agent, then use `uv run sim connect`. Do
256
+ not add `--host` unless you are intentionally talking to a remote `sim serve`.
257
+
258
+ **Remote solver workstation, lab box, or HPC login node:** install
259
+ `sim-cli-core` and the solver plugin on the solver host, start `sim serve`
260
+ there, then point the local agent at that host:
261
+
262
+ ```bash
263
+ # On the solver host.
264
+ uv run sim serve --host 0.0.0.0 --port 7600
265
+
266
+ # On the agent/control machine.
267
+ uv run sim --host <solver-host-ip> check <solver>
268
+ uv run sim --host <solver-host-ip> connect --solver <solver>
269
+ uv run sim --host <solver-host-ip> inspect session.summary
270
+ uv run sim --host <solver-host-ip> disconnect
271
+ ```
272
+
273
+ Only bind `sim serve` to a trusted network such as a VPN, Tailscale, or a
274
+ protected LAN. The runtime currently has no auth layer, and `/connect` plus
275
+ `/exec` can execute solver-side code.
276
+
277
+ ## Solver plugins
278
+
279
+ `sim-cli-core` ships with no solver drivers built in. Each simulation solver is
280
+ reached through an explicit plugin package.
281
+
282
+ Ready-to-use plugins:
283
+
284
+ | Solver | Package spec |
285
+ | --- | --- |
286
+ | COMSOL | `sim-plugin-comsol` |
287
+ | MATLAB / Simulink | `git+https://github.com/svd-ai-lab/sim-plugin-matlab@main` |
288
+ | Ansys Workbench | `sim-plugin-workbench` |
289
+ | Ansys Mechanical | `sim-plugin-mechanical` |
290
+ | Ansys Fluent | `sim-plugin-fluent` |
291
+ | Ansys HFSS | `sim-plugin-hfss` |
292
+ | Abaqus | `sim-plugin-abaqus` |
293
+ | LTspice | `sim-plugin-ltspice` |
294
+ | OpenFOAM | `git+https://github.com/svd-ai-lab/sim-plugin-openfoam@main` |
295
+
296
+ Under development: Amesim, Dymola, and Flotherm.
297
+
298
+ After adding any plugin package, sync its bundled skill and verify that the local
299
+ solver can be reached:
300
+
301
+ ```bash
302
+ uv run sim plugin list
303
+
304
+ # Codex or Copilot
305
+ uv run sim plugin sync-skills --target .agents/skills --copy
306
+
307
+ # Claude Code
308
+ uv run sim plugin sync-skills --target .claude/skills --copy
309
+
310
+ uv run sim check <solver>
311
+ uv run sim plugin doctor <solver> --deep
312
+ ```
313
+
314
+ For direct wheel, Git, local checkout, or non-uv workflows, see
315
+ [docs/plugin-install.md](docs/plugin-install.md).
316
+
317
+ ## Project setup with sim.toml
318
+
319
+ For reproducible Python packages, commit the `pyproject.toml` and `uv.lock`
320
+ created by `uv add`. Use `sim.toml` for solver defaults and workspace settings:
321
+
322
+ ```bash
323
+ uv run sim init
324
+ ```
325
+
326
+ Example:
327
+
328
+ ```toml
329
+ [sim]
330
+ default_solver = "comsol"
331
+ workspace = "./workspace"
332
+
333
+ [[sim.plugins]]
334
+ name = "comsol"
335
+ package = "sim-plugin-comsol"
336
+ ```
337
+
338
+ Then a fresh checkout can run:
339
+
340
+ ```bash
341
+ uv sync
342
+ uv run sim setup --dry-run
343
+
344
+ # Codex or Copilot
345
+ uv run sim plugin sync-skills --target .agents/skills --copy
346
+
347
+ # Claude Code
348
+ uv run sim plugin sync-skills --target .claude/skills --copy
349
+ ```
350
+
351
+ ## Common commands
352
+
353
+ | Command | Use it for |
354
+ |---|---|
355
+ | `uv run sim plugin list` | Show plugins visible in this project environment. |
356
+ | `uv run sim plugin info <solver>` | Show plugin metadata and compatibility summary. |
357
+ | `uv run sim plugin doctor <solver> --deep` | Check plugin wiring plus local solver detection. |
358
+ | `uv run sim plugin sync-skills --target .agents/skills --copy` | Materialize installed plugin skills for Codex or Copilot. |
359
+ | `uv run sim plugin sync-skills --target .claude/skills --copy` | Materialize installed plugin skills for Claude Code. |
360
+ | `uv run sim check <solver>` | Detect local or remote solver installs. |
361
+ | `uv run sim connect --solver <solver>` | Open a persistent solver session. |
362
+ | `uv run sim exec --file step.py` | Run one bounded step in the live session. |
363
+ | `uv run sim inspect <target>` | Query session, result, or solver-specific state. |
364
+ | `uv run sim run script.py --solver <solver>` | Run a deterministic one-shot script. |
365
+ | `uv run sim disconnect` | Tear down the active session. |
366
+ | `uv run sim setup` | Apply plugin declarations from `sim.toml` when you use them. |
367
+
368
+ Run `uv run sim describe` for a machine-readable command manifest, or
369
+ `uv run sim <command> --help` for exact options.
370
+
371
+ ## Solver ownership
372
+
373
+ `sim-cli` does not bundle or redistribute simulation solvers or vendor SDKs.
374
+ Install and operate each underlying solver according to its vendor terms. See
375
+ [NOTICE](NOTICE) for optional SDK dependency notes.
376
+
377
+ `sim-cli` is an independent open-source project and is not affiliated with,
378
+ endorsed by, or sponsored by any solver vendor. Product, solver, and company
379
+ names remain the property of their respective owners.
380
+
381
+ ## Developer docs
382
+
383
+ - [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) - project setup, layout, driver
384
+ development, and architecture notes
385
+ - [docs/plugin-install.md](docs/plugin-install.md) - plugin installation
386
+ reference
387
+
388
+ ## License
389
+
390
+ Apache-2.0 - see [LICENSE](LICENSE).
@@ -21,9 +21,9 @@ sim/gui/_win32_dialog.py,sha256=4hErvQxY4SwW_fTpX3FTUxhugkRYpkTRdBiBDu9_1DE,4731
21
21
  sim/gui/LICENSES/ATTRIBUTION.md,sha256=X5EdZV0Gt0FdG9FpeCZ-22I3cqRg9SmoQt-86DqCBak,1150
22
22
  sim/testing/__init__.py,sha256=iGwbSfJucKuhNLOiDnUmQCBlkhukWyp7cj89YDhoEOk,855
23
23
  sim/testing/protocol_conformance.py,sha256=q0r7QgPoAyU-eMqN4fJWx0XZv8YNolGghu9-zDC8bls,9867
24
- sim_cli_core-0.3.3.dist-info/METADATA,sha256=ct8geuGfeHmH-jSkq7HKAzycdr6sxIwoaPhLo_uZ2Tw,17962
25
- sim_cli_core-0.3.3.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
26
- sim_cli_core-0.3.3.dist-info/entry_points.txt,sha256=hpg7D0fRhpgmo1IyN35XQPoyIZRSw7SLNG7tW0eacGA,37
27
- sim_cli_core-0.3.3.dist-info/licenses/LICENSE,sha256=7toF0XzHlqSXvTlZ8W77R6pg2ilzKN73EOG0SioX7wQ,10762
28
- sim_cli_core-0.3.3.dist-info/licenses/NOTICE,sha256=GQ0HVRFnQwrSFFm-7mYWTTtWDcko0_p2Rdv5t62glts,1752
29
- sim_cli_core-0.3.3.dist-info/RECORD,,
24
+ sim_cli_core-0.3.5.dist-info/METADATA,sha256=XY9X01emmXz_D_PnbFJ0b0max0T9jq2_jNH6z2Zne18,15065
25
+ sim_cli_core-0.3.5.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
26
+ sim_cli_core-0.3.5.dist-info/entry_points.txt,sha256=hpg7D0fRhpgmo1IyN35XQPoyIZRSw7SLNG7tW0eacGA,37
27
+ sim_cli_core-0.3.5.dist-info/licenses/LICENSE,sha256=7toF0XzHlqSXvTlZ8W77R6pg2ilzKN73EOG0SioX7wQ,10762
28
+ sim_cli_core-0.3.5.dist-info/licenses/NOTICE,sha256=GQ0HVRFnQwrSFFm-7mYWTTtWDcko0_p2Rdv5t62glts,1752
29
+ sim_cli_core-0.3.5.dist-info/RECORD,,
@@ -1,361 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: sim-cli-core
3
- Version: 0.3.3
4
- Summary: Make every engineering tool agent-native — a CLI runtime that lets LLM agents launch, drive, and observe CAD/CAE software
5
- Project-URL: Homepage, https://github.com/svd-ai-lab/sim-cli
6
- Project-URL: Repository, https://github.com/svd-ai-lab/sim-cli
7
- Project-URL: Issues, https://github.com/svd-ai-lab/sim-cli/issues
8
- Project-URL: Documentation, https://github.com/svd-ai-lab/sim-cli#readme
9
- Project-URL: Changelog, https://github.com/svd-ai-lab/sim-cli/blob/main/CHANGELOG.md
10
- Author-email: Weiqi Ji <jiweiqi10@gmail.com>
11
- License-Expression: Apache-2.0
12
- License-File: LICENSE
13
- License-File: NOTICE
14
- Keywords: agent,agentic,cad,cae,cfd,fea,llm,out-of-tree,plugins,simulation
15
- Classifier: Development Status :: 3 - Alpha
16
- Classifier: Intended Audience :: Developers
17
- Classifier: Intended Audience :: Science/Research
18
- Classifier: Operating System :: OS Independent
19
- Classifier: Programming Language :: Python :: 3
20
- Classifier: Programming Language :: Python :: 3.10
21
- Classifier: Programming Language :: Python :: 3.11
22
- Classifier: Programming Language :: Python :: 3.12
23
- Classifier: Topic :: Scientific/Engineering
24
- Classifier: Topic :: Scientific/Engineering :: Physics
25
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
- Requires-Python: >=3.10
27
- Requires-Dist: click>=8.0
28
- Requires-Dist: fastapi>=0.115
29
- Requires-Dist: httpx>=0.28
30
- Requires-Dist: lxml>=5.0
31
- Requires-Dist: pillow>=10
32
- Requires-Dist: pywinauto>=0.6.8; sys_platform == 'win32'
33
- Requires-Dist: pyyaml>=6.0
34
- Requires-Dist: tomli>=2.0; python_version < '3.11'
35
- Requires-Dist: uvicorn>=0.34
36
- Provides-Extra: dev
37
- Requires-Dist: pytest>=8.0; extra == 'dev'
38
- Requires-Dist: ruff>=0.4; extra == 'dev'
39
- Description-Content-Type: text/markdown
40
-
41
- <div align="center">
42
-
43
- <img src="assets/banner.svg" alt="sim — the container runtime for physics simulations" width="820">
44
-
45
- <br>
46
-
47
- **Make every engineering tool agent-native.**
48
-
49
- *Today's CAD and CAE software was built for engineers clicking through GUIs.*
50
- *Tomorrow's user is an LLM agent — and it needs a way in.*
51
-
52
- <p align="center">
53
- <a href="#-quick-start"><img src="https://img.shields.io/badge/Quick_Start-2_min-3b82f6?style=for-the-badge" alt="Quick Start"></a>
54
- <a href="#-solver-registry"><img src="https://img.shields.io/badge/Solvers-growing_registry-22c55e?style=for-the-badge" alt="Growing solver registry"></a>
55
- <a href="https://github.com/svd-ai-lab/sim-skills"><img src="https://img.shields.io/badge/Agent_Skills-sim--skills-8b5cf6?style=for-the-badge" alt="Companion skills"></a>
56
- <a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache_2.0-eab308?style=for-the-badge" alt="License"></a>
57
- </p>
58
-
59
- <p align="center">
60
- <img src="https://img.shields.io/badge/python-3.10--3.12-3776AB?logo=python&logoColor=white" alt="Python">
61
- <img src="https://img.shields.io/badge/CLI-Click_8-blue" alt="Click">
62
- <img src="https://img.shields.io/badge/server-FastAPI-009688?logo=fastapi&logoColor=white" alt="FastAPI">
63
- <img src="https://img.shields.io/badge/transport-HTTP%2FJSON-orange" alt="HTTP/JSON">
64
- <img src="https://img.shields.io/badge/status-alpha-f97316" alt="Status: alpha">
65
- </p>
66
-
67
- **English** · [Deutsch](docs/README.de.md) · [日本語](docs/README.ja.md) · [中文](docs/README.zh.md)
68
-
69
- [Why sim](#-why-sim) · [Quick Start](#-quick-start) · [Solvers](#-solver-registry) · [Commands](#-commands) · [Skills](https://github.com/svd-ai-lab/sim-skills)
70
-
71
- </div>
72
-
73
- ---
74
-
75
- ## 🤔 Why sim?
76
-
77
- LLM agents already know how to write simulation scripts — training data is full of them. What they *don't* have is a standard way to **launch a solver, drive it step by step, and observe what happened** before deciding the next move.
78
-
79
- Today, the choices are awful:
80
-
81
- - **Fire-and-forget scripts** — agent writes 200 lines, runs the whole thing, an error at line 30 surfaces as garbage at line 200, no introspection, no recovery.
82
- - **Bespoke wrappers per solver** — every team rebuilds the same launch / exec / inspect / teardown loop in a different shape.
83
- - **Closed proprietary glue** — vendor SDKs that don't compose, don't share a vocabulary, and don't speak HTTP.
84
-
85
- `sim` is the missing layer:
86
-
87
- - **One CLI**, one HTTP protocol, **a growing driver registry** spanning CFD, multiphysics, thermal, pre-processing, and beyond.
88
- - **Persistent sessions** the agent introspects between every step.
89
- - **Remote-by-default** — the CLI client and the live solver can sit on different machines (LAN, Tailscale, HPC head node).
90
- - **Companion agent skills** that teach an LLM how to drive each backend safely.
91
-
92
- > Like a container runtime standardized how Kubernetes talks to containers, **sim** standardizes how agents talk to solvers.
93
-
94
- ---
95
-
96
- ## 🏛 Architecture
97
-
98
- <div align="center">
99
- <img src="assets/architecture.svg" alt="sim architecture: CLI client over HTTP/JSON to a sim serve FastAPI process holding a live solver session" width="900">
100
- </div>
101
-
102
- Two execution modes from the same CLI, sharing the same `DriverProtocol`:
103
-
104
- | Mode | Command | When to use it |
105
- |---|---|---|
106
- | **Persistent session** | `sim serve` + `sim connect / exec / inspect` | Long, stateful workflows the agent inspects between steps |
107
- | **One-shot** | `sim run script.py --solver X` | Whole-script jobs you want stored as a numbered run in `.sim/runs/` |
108
-
109
- For the full driver protocol, server endpoints, and execution pipeline see [CLAUDE.md](CLAUDE.md).
110
-
111
- ---
112
-
113
- ## 🚀 Quick Start
114
-
115
- > **Names at a glance:** repo `svd-ai-lab/sim-cli` · PyPI distribution `sim-cli-core` · console command `sim` · import `import sim`. Yes, three different strings — the repo name predates the PyPI publish; the rest follow Python packaging convention.
116
-
117
- Prereq: [`uv`](https://docs.astral.sh/uv/) — install with `curl -LsSf https://astral.sh/uv/install.sh | sh` (macOS / Linux) or `irm https://astral.sh/uv/install.ps1 | iex` (Windows PowerShell).
118
-
119
- **macOS / Linux:**
120
-
121
- ```bash
122
- # 1. On the host that has the solver installed, install sim core only
123
- # — no driver choice yet:
124
- uv pip install sim-cli-core
125
-
126
- # 2. Install the plugin for the solver you actually want:
127
- sim plugin install sim-plugin-ltspice
128
-
129
- # 3. Tell sim to look at this machine and pick the right SDK profile:
130
- sim check <solver>
131
- # → reports detected installs of <solver> and the profile they resolve to
132
-
133
- # 4. Bootstrap that profile env (creates .sim/envs/<profile>/ with the
134
- # pinned SDK; or pass --auto-install to step 5 to do it inline):
135
- sim env install <profile>
136
-
137
- # 5. Start the server (only needed for remote / cross-machine workflows):
138
- sim serve --host 0.0.0.0 # FastAPI on :7600
139
-
140
- # 6. From the agent / your laptop / anywhere on the network:
141
- sim --host <server-ip> connect --solver <solver> --mode solver --ui-mode gui
142
- sim --host <server-ip> inspect session.versions # ← always do this first
143
- sim --host <server-ip> exec "<solver-specific snippet>"
144
- sim --host <server-ip> screenshot -o shot.png
145
- sim --host <server-ip> disconnect
146
- ```
147
-
148
- **Windows (PowerShell):**
149
-
150
- ```powershell
151
- # 1. On the host that has the solver installed, install sim core only
152
- # — no driver choice yet:
153
- uv pip install sim-cli-core
154
-
155
- # 2. Install the plugin for the solver you actually want:
156
- sim plugin install sim-plugin-ltspice
157
-
158
- # 3. Tell sim to look at this machine and pick the right SDK profile:
159
- sim check <solver>
160
-
161
- # 4. Bootstrap that profile env (or pass --auto-install to step 5):
162
- sim env install <profile>
163
-
164
- # 5. Start the server (only needed for remote / cross-machine workflows):
165
- sim serve --host 0.0.0.0 # FastAPI on :7600
166
-
167
- # 6. From the agent / your laptop / anywhere on the network:
168
- sim --host <server-ip> connect --solver <solver> --mode solver --ui-mode gui
169
- sim --host <server-ip> inspect session.versions # ← always do this first
170
- sim --host <server-ip> exec "<solver-specific snippet>"
171
- sim --host <server-ip> screenshot -o shot.png
172
- sim --host <server-ip> disconnect
173
- ```
174
-
175
- That's the full loop: **detect → bootstrap → launch → drive → observe → tear down** — with the engineer optionally watching the solver GUI in real time.
176
-
177
- > **Why the bootstrap step?** Each `(solver, SDK, driver, skill)` combo is
178
- > its own compatibility universe — different solver releases may want
179
- > different SDK versions, and those SDK versions can't always coexist in
180
- > one Python env. sim treats each combo as an isolated "profile env" so
181
- > you can keep multiple versions on one machine without dependency
182
- > conflicts. The contract is in
183
- > [`docs/architecture/version-compat.md`](docs/architecture/version-compat.md).
184
-
185
- ---
186
-
187
- ## 📦 Plugin sources
188
-
189
- `sim plugin install <source>` accepts explicit install sources only:
190
-
191
- - Exact package specs, such as `sim-plugin-ltspice` or `sim-plugin-ltspice==0.2.3`
192
- - Package specs plus private indexes, such as `sim-plugin-mechanical --extra-index-url https://example.com/simple/`
193
- - Direct wheel/sdist URLs, such as `https://example.com/sim_plugin_ltspice-0.2.3-py3-none-any.whl`
194
- - Git URLs, such as `git+https://github.com/<org>/sim-plugin-<name>`
195
- - Local plugin directories, wheels, and sdists
196
-
197
- Discovery is separate from installation:
198
-
199
- ```bash
200
- sim plugin catalog # official plugins (display + copy-paste install string)
201
- sim plugin list # installed/registered plugins on this machine
202
- ```
203
-
204
- Short solver aliases such as `ltspice` are catalogue names, not install sources. Run `sim plugin catalog` to find the recommended install string for each plugin, then pass it to `sim plugin install`.
205
-
206
- ---
207
-
208
- ## 🧪 Solver registry
209
-
210
- `sim-cli` core is **fully solver-agnostic** — it ships with **zero built-in drivers**. Every solver is reached through a **plugin package** registered via the `sim.drivers` entry-point group. Adding a new backend is a ~200-LOC `DriverProtocol` implementation in its own `sim-plugin-<name>` repo.
211
-
212
- `sim` is most useful for **GUI-heavy solvers** — COMSOL, ANSYS Mechanical, ANSYS Fluent, MATLAB Simulink, Abaqus, Flotherm — where every agent iteration would otherwise mean clicking through dialog boxes.
213
-
214
- Install from a discovered package, then list what is installed locally:
215
-
216
- ```bash
217
- sim plugin catalog # discover what's available + install strings
218
- sim plugin install sim-plugin-ltspice
219
- sim plugin list # show installed plugins
220
- ```
221
-
222
- Reference implementation to read for shape: [`sim-plugin-ltspice`](https://github.com/svd-ai-lab/sim-plugin-ltspice).
223
-
224
- **Private plugins** (vendor-IP-sensitive backends) install through explicit URLs, private repos, or private Python indexes — same `sim plugin install` flow:
225
-
226
- ```bash
227
- sim plugin install git+https://github.com/<org>/sim-plugin-<name>
228
- # (you need read-access to the repo; without it, git clone returns 401)
229
-
230
- sim plugin install sim-plugin-mechanical --extra-index-url https://example.com/simple/
231
- # standard PEP 503/private-index path for commercial wrappers
232
- ```
233
-
234
- Per-solver protocols, snippets, and demo workflows live in [`sim-skills`](https://github.com/svd-ai-lab/sim-skills) and the per-plugin repos.
235
-
236
- ---
237
-
238
- ## ✨ Features
239
-
240
- ### 🧠 Built for agents
241
- - **Persistent sessions** that survive across snippets — never restart the solver mid-task
242
- - **Step-by-step introspection** with `sim inspect` between every action
243
- - **Pre-flight `sim lint`** catches missing imports and unsupported APIs before launch
244
- - **Numbered run history** in `.sim/runs/` for one-shot jobs, browsable via `sim logs`
245
-
246
- ### 🔌 Solver-agnostic
247
- - **One protocol** (`DriverProtocol`) — every driver is ~200 LOC, shipped as its own `sim-plugin-<name>` package via Python entry points
248
- - **Persistent + one-shot** from the same CLI — no separate client per mode
249
- - **Plugin discovery + explicit installs** — `sim plugin catalog` discovers available plugins; `sim plugin install` accepts exact package specs, private indexes, direct URLs, git URLs, and local artifacts
250
- - **Companion skills** in [`sim-skills`](https://github.com/svd-ai-lab/sim-skills) so an LLM picks up each new backend without prior context
251
-
252
- ### 🌐 Remote-friendly
253
- - **HTTP/JSON transport** — runs anywhere `httpx` runs
254
- - **Client / server split** — agent on a laptop, solver on an HPC node, GUI on a workstation
255
- - **Tailscale-ready** — designed for cross-network mesh deployments
256
-
257
- ---
258
-
259
- ## ⚙️ Commands
260
-
261
- | Command | What it does | Analogy |
262
- |---|---|---|
263
- | `sim plugin catalog` | Discover available solver plugins | `npm search` |
264
- | `sim plugin list / install / uninstall` | Manage installed plugins from explicit install sources | `npm install` |
265
- | `sim check <solver>` | Detect installations + resolve a profile | `docker info` |
266
- | `sim env install <profile>` | Bootstrap a profile env (venv + pinned SDK) | `pyenv install` |
267
- | `sim env list [--catalogue]` | Show bootstrapped envs (and the full catalogue) | `pyenv versions` |
268
- | `sim env remove <profile>` | Tear down a profile env | `pyenv uninstall` |
269
- | `sim serve` | Start the HTTP server (for cross-machine use) | `ollama serve` |
270
- | `sim connect` | Launch a solver, open a session | `docker start` |
271
- | `sim exec` | Run a Python snippet inside the live session | `docker exec` |
272
- | `sim inspect` | Query live session state (incl. `session.versions`) | `docker inspect` |
273
- | `sim ps` | Show the active session and its profile | `docker ps` |
274
- | `sim screenshot` | Grab a PNG of the solver GUI | — |
275
- | `sim disconnect` | Tear down the session | `docker stop` |
276
- | `sim stop` | Stop the sim-server process | `docker rm -f` |
277
- | `sim run` | One-shot script execution | `docker run` |
278
- | `sim lint` | Pre-flight static check on a script | `ruff check` |
279
- | `sim logs` | Browse stored run history | `docker logs` |
280
-
281
- Every command that touches a host (`check`, `env`, `connect`, `exec`, `inspect`, `disconnect`) accepts `--host <ip>` and runs against a remote `sim serve` instead of the local machine.
282
-
283
- Environment: `SIM_HOST`, `SIM_PORT` for the client; `SIM_DIR` (default `.sim/`) for run storage and profile envs.
284
-
285
- ### Choosing a profile
286
-
287
- You don't usually have to. `sim check <solver>` tells you which profile your installed solver maps to, and `sim connect ... --auto-install` will bootstrap it for you on first use. The escape hatches:
288
-
289
- - **Pin a specific profile:** `sim connect --solver <solver> --profile <profile>`
290
- - **Skip the profile env entirely (legacy / tests):** `sim connect --solver <solver> --inline`
291
- - **Power-user single-env install:** install the matching plugin package directly into your current venv (e.g. `pip install <plugin-package>`). Skips `sim env` entirely; OK when you only need one solver version on this machine.
292
-
293
- The full design is in [`docs/architecture/version-compat.md`](docs/architecture/version-compat.md).
294
-
295
- ---
296
-
297
- ## 🆚 Why not just run scripts?
298
-
299
- | Fire-and-forget script | sim |
300
- |---|---|
301
- | Write the whole thing, run, hope it converges | Connect → execute → observe → decide next step |
302
- | An error at step 2 surfaces at step 12 | Each step verified before the next is sent |
303
- | Agent has no view of solver state | `sim inspect` between every action |
304
- | Solver restarts on every iteration | One persistent session, snippets at will |
305
- | GUI invisible to the human | Engineer watches the GUI while the agent drives |
306
- | Output parsing reinvented per project | `driver.parse_output()` returns structured fields |
307
-
308
- ---
309
-
310
- ## 🛠 Development
311
-
312
- See [`docs/DEVELOPMENT.md`](docs/DEVELOPMENT.md) for setup, project layout, adding drivers, dev flags, and the layered skill system.
313
-
314
- ---
315
-
316
- ## 🌐 Remote deployment
317
-
318
- When the solver lives on a different machine (an HPC login node, a lab box, or any host with the solver installed) and you want to drive it from your laptop, a notebook, or an LLM agent — install `sim-cli-core` on **both** ends and run `sim serve` on the remote.
319
-
320
- ```bash
321
- # On the solver host (the machine with the solver installed)
322
- ssh user@solver-host
323
- pip install sim-cli-core
324
- sim serve --host 0.0.0.0 --port 7600 # bind to all interfaces
325
-
326
- # On your local control machine
327
- sim --host <solver-host-ip> connect --solver <solver> --mode <mode>
328
- sim --host <solver-host-ip> exec "<solver-specific snippet>"
329
- sim --host <solver-host-ip> inspect session.summary
330
- sim --host <solver-host-ip> disconnect
331
- sim --host <solver-host-ip> stop # shut down the remote server when done
332
- ```
333
-
334
- That is the entire setup — same `sim-cli-core` package on both sides, same wire protocol whether it is talking to a local or a remote server. Bind `--host 0.0.0.0` only on networks you trust (Tailscale, VPN, LAN behind a firewall); there is **no auth layer** on `/connect` and `/exec` execute arbitrary Python.
335
-
336
- ---
337
-
338
- ## 🔗 Related projects
339
-
340
- - **[`sim-skills`](https://github.com/svd-ai-lab/sim-skills)** — agent skills, snippets, and demo workflows for each supported solver
341
- - **[`sim-ltspice`](https://github.com/svd-ai-lab/sim-ltspice)** — standalone Python API for LTspice file formats (used by `sim-plugin-ltspice`)
342
-
343
- ---
344
-
345
- ## 📄 License
346
-
347
- Apache-2.0 — see [LICENSE](LICENSE).
348
-
349
- ### Third-party solver SDKs
350
-
351
- `sim-cli` is a thin wrapper/runtime — it does **not** bundle or redistribute any vendor solver or vendor SDK. Each solver backend is reached through a third-party SDK that the user installs separately via `sim env install` or as an optional extra.
352
-
353
- Users are responsible for obtaining a valid license for each underlying solver and for complying with the license, copyright, and EULA of every third-party SDK they choose to install alongside `sim-cli`. See [`NOTICE`](NOTICE) for the list of optional SDK dependencies and their upstream locations.
354
-
355
- ### Trademarks
356
-
357
- `sim-cli` is an independent open-source project and is **not affiliated with, endorsed by, or sponsored by** any solver vendor. Product, solver, and company names referenced anywhere in this repository remain the property of their respective owners:
358
-
359
- - **OpenFOAM®** is a registered trademark of **OpenCFD Ltd.**
360
- - **ParaView®** is a trademark of **Kitware, Inc.**
361
- - All other solver and product names are trademarks of their respective owners.