sim-cli-core 0.3.4__py3-none-any.whl → 0.3.6__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.
sim/_plugin_install.py CHANGED
@@ -52,10 +52,10 @@ _VERSION_PIN_RE = re.compile(r"(?:==|!=|~=|>=|<=|>|<)\s*(.+)$")
52
52
  def _short_name_error(name: str) -> str:
53
53
  return (
54
54
  f"{name!r} is not an explicit plugin install source. "
55
- "See 'sim plugin catalog' for the official plugin list, or pass an "
56
- "explicit pip-installable source: a local wheel/sdist path, a direct "
57
- "wheel/sdist URL, a git URL, or a package spec such as "
58
- f"'sim-plugin-{name}'."
55
+ "See https://github.com/svd-ai-lab/sim-plugin-index for a curated "
56
+ "plugin list, or pass an explicit pip-installable source: a local "
57
+ "wheel/sdist path, a direct wheel/sdist URL, a git URL, or a package "
58
+ f"spec such as 'sim-plugin-{name}'."
59
59
  )
60
60
 
61
61
 
@@ -318,9 +318,9 @@ def bundle_plugins(names: list[str], output_dir: Path, *,
318
318
  index_url: str | None = None) -> dict[str, Any]:
319
319
  """The install-resolver-backed bundle flow was removed.
320
320
 
321
- Use the discovery catalogue to find plugins, then download explicit wheel
322
- URLs or install exact package specs. The catalogue itself is not an
323
- install-time resolver.
321
+ See https://github.com/svd-ai-lab/sim-plugin-index for a curated plugin
322
+ list, then download explicit wheel URLs or install exact package specs.
323
+ There is no install-time resolver to map short names to wheels.
324
324
  """
325
325
  _ = (names, output_dir, index_url)
326
326
  return {
@@ -331,10 +331,10 @@ def bundle_plugins(names: list[str], output_dir: Path, *,
331
331
  {
332
332
  "name": name,
333
333
  "error": (
334
- "bundle no longer resolves catalogue names; use "
335
- "sim plugin catalog to discover plugins, then pass "
336
- "explicit wheel URLs, local artifacts, git URLs, or exact "
337
- "package specs"
334
+ "bundle no longer resolves short plugin names; see "
335
+ "https://github.com/svd-ai-lab/sim-plugin-index for a "
336
+ "curated plugin list, then pass explicit wheel URLs, "
337
+ "local artifacts, git URLs, or exact package specs"
338
338
  ),
339
339
  }
340
340
  for name in names
sim/cli.py CHANGED
@@ -1003,47 +1003,6 @@ def plugin():
1003
1003
  """
1004
1004
 
1005
1005
 
1006
- @plugin.command("catalog")
1007
- @click.option("--offline", is_flag=True,
1008
- help="Use the cached discovery catalogue only.")
1009
- @click.option("--refresh", is_flag=True,
1010
- help="Refresh the cached discovery catalogue.")
1011
- @click.option("--catalog-url", default=None,
1012
- help="Override the discovery catalogue URL.")
1013
- @click.pass_context
1014
- def plugin_catalog_cmd(ctx, offline, refresh, catalog_url):
1015
- """List available plugins from the discovery catalogue.
1016
-
1017
- This is discovery only. Install commands remain explicit and pip-native;
1018
- the catalogue is not used to silently resolve short names during install.
1019
- """
1020
- from sim.plugin_catalog import DEFAULT_CATALOG_URL, list_catalog
1021
-
1022
- rows = list_catalog(
1023
- url=catalog_url or DEFAULT_CATALOG_URL,
1024
- offline=offline,
1025
- force=refresh,
1026
- )
1027
- if ctx.obj["json"]:
1028
- click.echo(json_mod.dumps([r.to_dict() for r in rows], indent=2))
1029
- return
1030
-
1031
- if not rows:
1032
- click.echo("[sim] plugin catalog: no available plugins found")
1033
- return
1034
-
1035
- click.echo(f"[sim] {len(rows)} available plugin(s) in catalog:")
1036
- for r in rows:
1037
- ver = f" {r.version}" if r.version else ""
1038
- license_class = f" ({r.license_class})" if r.license_class else ""
1039
- dist = f" [{r.distribution}]" if r.distribution else ""
1040
- click.echo(f" {r.id:20s} {r.name}{ver}{dist}{license_class}")
1041
- if r.summary:
1042
- click.echo(f" {r.summary}")
1043
- if r.install:
1044
- click.echo(f" install: sim plugin install {r.install}")
1045
-
1046
-
1047
1006
  @plugin.command("list")
1048
1007
  @click.pass_context
1049
1008
  def plugin_list(ctx):
sim/describe.py CHANGED
@@ -119,10 +119,6 @@ _EXAMPLES: dict[str, list[dict[str, str]]] = {
119
119
  {"cmd": "sim --json plugin list",
120
120
  "summary": "List every registered plugin (built-in + external)."},
121
121
  ],
122
- "plugin catalog": [
123
- {"cmd": "sim --json plugin catalog",
124
- "summary": "List available plugins from the discovery catalogue."},
125
- ],
126
122
  "plugin info": [
127
123
  {"cmd": "sim plugin info coolprop",
128
124
  "summary": "Show one plugin's metadata and compatibility profiles."},
@@ -0,0 +1,419 @@
1
+ Metadata-Version: 2.4
2
+ Name: sim-cli-core
3
+ Version: 0.3.6
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
+ **sim-cli lets AI agents operate CAE solvers one verified step at a time.**
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 modeling
54
+ or analysis steps, verify result/state, and save checkpoints/artifacts for
55
+ engineering review.
56
+
57
+ <p align="center">
58
+ <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>
59
+ <a href="#solver-plugins"><img src="https://img.shields.io/badge/Solvers-plugin_based-22c55e?style=for-the-badge" alt="Solver plugins"></a>
60
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache_2.0-eab308?style=for-the-badge" alt="License"></a>
61
+ </p>
62
+
63
+ <p align="center">
64
+ <img src="https://img.shields.io/badge/python-3.10%2B-3776AB?logo=python&logoColor=white" alt="Python 3.10+">
65
+ <img src="https://img.shields.io/badge/CLI-Click_8-blue" alt="Click">
66
+ <img src="https://img.shields.io/badge/server-FastAPI-009688?logo=fastapi&logoColor=white" alt="FastAPI">
67
+ <img src="https://img.shields.io/badge/transport-HTTP%2FJSON-orange" alt="HTTP/JSON">
68
+ <img src="https://img.shields.io/badge/status-alpha-f97316" alt="Status: alpha">
69
+ </p>
70
+
71
+ [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)
72
+
73
+ </div>
74
+
75
+ ---
76
+
77
+ ## Who this is for
78
+
79
+ `sim` is for agents and people trying to get real simulation work done.
80
+
81
+ - **CAE engineers who already script solvers** and want an agent to help
82
+ automate COMSOL, Fluent, MATLAB, LTspice, Abaqus, HFSS, and similar tools
83
+ without losing inspection and recovery between steps.
84
+ - **Design engineers and occasional simulation users** who have agent
85
+ experience and want an agent-assisted workflow: ask for a simulation, watch
86
+ the model evolve, review screenshots or plots, and keep final artifacts.
87
+ - **AI agents** reading this repository to learn the safe setup and operating
88
+ loop before touching a solver.
89
+ - **Engineering leaders** evaluating whether agent-assisted simulation can be
90
+ repeatable, reviewable, and compatible with existing solver installations.
91
+
92
+ Plugin authoring, runtime internals, and driver protocol details live in
93
+ [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md).
94
+
95
+ ## What sim gives an agent
96
+
97
+ LLMs can often write solver scripts, but a one-shot script is a weak workflow:
98
+ it hides intermediate state, fails late, and makes recovery difficult.
99
+
100
+ `sim` gives an agent a small, repeatable control surface:
101
+
102
+ ```text
103
+ check readiness → attach to live session → inspect model state
104
+ → run one bounded CAE step → verify result/state → save checkpoint/artifacts
105
+ ```
106
+
107
+ A bounded CAE step is one small modeling, meshing, solving, or postprocessing
108
+ action that can be inspected and verified before continuing. Examples: create a
109
+ geometry feature, assign a material, apply a boundary condition, generate a
110
+ mesh, run one study, extract a probe value, create a plot, or export a result
111
+ table.
112
+
113
+ The solver-specific knowledge is not baked into the core CLI. It comes from
114
+ plugins. A plugin can provide both:
115
+
116
+ - a **driver**, so `sim` can launch or talk to the solver
117
+ - a **skill**, so the agent knows the solver-specific workflow, pitfalls, and
118
+ inspection rules
119
+
120
+ ## Human-in-the-loop collaboration
121
+
122
+ `sim` is designed for shared control, not unattended black-box automation.
123
+ When a solver plugin exposes live state through `sim inspect`, the agent can
124
+ re-read the current solver session after each meaningful step. That means an
125
+ engineer can cut in through the solver GUI, change geometry, parameters,
126
+ boundary conditions, plots, or saved artifacts, then ask the agent to inspect
127
+ again and continue from the real current state.
128
+
129
+ This is the collaboration model: the human can watch, correct, and steer; the
130
+ agent keeps using inspection and checkpoints instead of assuming its previous
131
+ script still matches the real solver state.
132
+
133
+ ## Quick Start: agent setup
134
+
135
+ Use this path when the agent and solver are on the same machine. You do not
136
+ need to start `sim serve` manually for the local happy path; `sim connect`
137
+ will use the local runtime. The default docs use
138
+ [`uv`](https://docs.astral.sh/uv/) so agents run the `sim` and plugins declared
139
+ by the current project instead of guessing which executable is on `PATH`.
140
+
141
+ `uv run sim ...` runs `sim` from this project environment, so it sees this
142
+ project's installed solver plugins. Run from the project root:
143
+
144
+ ```bash
145
+ uv init # only if this is not already a uv project
146
+ uv add sim-cli-core sim-plugin-comsol
147
+ uv run sim plugin sync-skills --target .agents/skills --copy
148
+ uv run sim check comsol
149
+ uv run sim plugin doctor comsol --deep
150
+ ```
151
+
152
+ Use `.agents/skills` for Codex and GitHub Copilot projects. For Claude Code,
153
+ sync to `.claude/skills` instead:
154
+
155
+ ```bash
156
+ uv run sim plugin sync-skills --target .claude/skills --copy
157
+ ```
158
+
159
+ ### Without uv
160
+
161
+ If you cannot use `uv`, create a normal Python virtual environment, install
162
+ `sim-cli-core` and the solver plugin into that environment, then run `sim`
163
+ from the activated environment.
164
+
165
+ macOS/Linux:
166
+
167
+ ```bash
168
+ python -m venv .venv
169
+ source .venv/bin/activate
170
+ python -m pip install --upgrade pip
171
+ python -m pip install sim-cli-core sim-plugin-comsol
172
+ sim plugin sync-skills --target .agents/skills --copy
173
+ sim check comsol
174
+ sim plugin doctor comsol --deep
175
+ ```
176
+
177
+ Windows PowerShell:
178
+
179
+ ```powershell
180
+ py -m venv .venv
181
+ .\.venv\Scripts\Activate.ps1
182
+ python -m pip install --upgrade pip
183
+ python -m pip install sim-cli-core sim-plugin-comsol
184
+ sim plugin sync-skills --target .agents/skills --copy
185
+ sim check comsol
186
+ sim plugin doctor comsol --deep
187
+ ```
188
+
189
+ ## Hand this prompt to your agent
190
+
191
+ After setup, give your coding agent a direct instruction like this:
192
+
193
+ ```text
194
+ Use the installed solver skill. Run sim through this project with
195
+ `uv run sim ...`. Check my local solver installation before connecting. Work
196
+ one bounded step at a time: connect, inspect the session, execute a small step,
197
+ inspect last.result and the live model state, then save or update a checkpoint
198
+ before continuing. Do not guess solver API names; inspect the live model or the
199
+ solver's local docs first. If I make manual changes in the solver UI,
200
+ re-inspect the live state before continuing instead of assuming your previous
201
+ script still matches the model. Report saved artifacts, numerical checks,
202
+ warnings, and anything that still needs human engineering review.
203
+ ```
204
+
205
+ ## Example: COMSOL and Codex on one machine
206
+
207
+ If COMSOL and Codex are on the same machine, start by installing the COMSOL
208
+ plugin and syncing its bundled skill into the `.agents/skills` project target:
209
+
210
+ ```bash
211
+ uv add sim-cli-core sim-plugin-comsol
212
+ uv run sim plugin sync-skills --target .agents/skills --copy
213
+ uv run sim check comsol
214
+ uv run sim plugin doctor comsol --deep
215
+ ```
216
+
217
+ Then ask Codex:
218
+
219
+ ```text
220
+ Use the installed COMSOL skill. Start by checking COMSOL through `uv run sim
221
+ check comsol`. If you need a visible live COMSOL Desktop session, use:
222
+
223
+ uv run sim connect --solver comsol --ui-mode gui --driver-option visual_mode=shared-desktop
224
+
225
+ After connecting, inspect session.health and comsol.model.identity. Confirm the
226
+ live model binding is healthy before treating the GUI as synchronized. For
227
+ non-trivial work, establish a case folder and save .mph checkpoints after major
228
+ layers. Build and solve one bounded step at a time.
229
+ ```
230
+
231
+ For COMSOL-specific details such as shared Desktop mode, offline `.mph`
232
+ inspection, Desktop attach fallback, model identity checks, and checkpoint
233
+ policy, follow the bundled COMSOL skill.
234
+
235
+ ## Why CLI-first?
236
+
237
+ sim-cli is CLI-first because engineering simulation is file-based,
238
+ scriptable, local, artifact-heavy, and long-running.
239
+
240
+ CAE agents need to work with solver executables, model files,
241
+ Python/Java/journal scripts, shell commands, logs, checkpoints, plots,
242
+ and artifacts. A CLI command surface composes with all of that and
243
+ matches how Codex CLI, Claude Code, and other coding agents already
244
+ operate.
245
+
246
+ MCP is useful for API-style integrations and remote tool discovery,
247
+ but a broad MCP surface can add context overhead and wrapper
248
+ maintenance. For COMSOL, Abaqus, Ansys Workbench, OpenFOAM, LTspice,
249
+ and similar solvers, sim-cli keeps the source of truth as a small,
250
+ auditable command loop:
251
+
252
+ ```text
253
+ check readiness → attach to live session → inspect model state
254
+ → run one bounded CAE step → verify result/state → save checkpoint/artifacts
255
+ ```
256
+
257
+ Solver plugins provide solver-specific behavior. Agent skills teach
258
+ Codex, Claude Code, and other agents when and how to use the CLI
259
+ safely.
260
+
261
+ ## The agent loop
262
+
263
+ For any solver, the agent should prefer this loop over one large generated
264
+ script:
265
+
266
+ 1. `uv run sim check <solver>` to detect installed solver versions and plugin
267
+ compatibility.
268
+ 2. `uv run sim connect --solver <solver> ...` for live stateful work, or
269
+ `uv run sim run` for a deterministic one-shot script.
270
+ 3. `uv run sim inspect session.versions` and the solver-specific health or
271
+ identity target before changing state.
272
+ 4. `uv run sim exec --file step.py --label <step>` for one bounded modeling
273
+ or analysis step.
274
+ 5. `uv run sim inspect last.result` and solver-specific state.
275
+ 6. Verify the result/state using solver-specific numerical evidence when available.
276
+ 7. Save checkpoints and artifacts when the solver plugin or skill requires
277
+ them.
278
+ 8. `uv run sim disconnect` when the session is done.
279
+
280
+ Screenshots and plots help humans review the result, but engineering
281
+ acceptance should prefer numeric evidence when the solver skill defines it:
282
+ mesh statistics, convergence, finite probes, conservation checks, tolerances,
283
+ or expected trends.
284
+
285
+ ## Local vs remote solvers
286
+
287
+ **Same machine:** install `sim-cli-core` and the solver plugin into the project
288
+ environment, sync the skill to your agent, then use `uv run sim connect`. Do
289
+ not add `--host` unless you are intentionally talking to a remote `sim serve`.
290
+
291
+ **Remote solver workstation, lab box, or HPC login node:** install
292
+ `sim-cli-core` and the solver plugin on the solver host, start `sim serve`
293
+ there, then point the local agent at that host:
294
+
295
+ ```bash
296
+ # On the solver host.
297
+ uv run sim serve --host 0.0.0.0 --port 7600
298
+
299
+ # On the agent/control machine.
300
+ uv run sim --host <solver-host-ip> check <solver>
301
+ uv run sim --host <solver-host-ip> connect --solver <solver>
302
+ uv run sim --host <solver-host-ip> inspect session.summary
303
+ uv run sim --host <solver-host-ip> disconnect
304
+ ```
305
+
306
+ Only bind `sim serve` to a trusted network such as a VPN, Tailscale, or a
307
+ protected LAN. The runtime currently has no auth layer, and `/connect` plus
308
+ `/exec` can execute solver-side code.
309
+
310
+ ## Solver plugins
311
+
312
+ `sim-cli-core` ships with no solver drivers built in. Each simulation solver is
313
+ reached through an explicit plugin package.
314
+
315
+ A few representative plugins:
316
+
317
+ | Solver | Package spec | Plugin repo |
318
+ | --- | --- | --- |
319
+ | COMSOL | `sim-plugin-comsol` | [sim-plugin-comsol](https://github.com/svd-ai-lab/sim-plugin-comsol) |
320
+ | Abaqus | `sim-plugin-abaqus` | [sim-plugin-abaqus](https://github.com/svd-ai-lab/sim-plugin-abaqus) |
321
+ | Ansys Workbench | `sim-plugin-workbench` | [sim-plugin-workbench](https://github.com/svd-ai-lab/sim-plugin-workbench) |
322
+ | Autodesk Fusion 360 | _in development_ | [sim-plugin-fusion360](https://github.com/svd-ai-lab/sim-plugin-fusion360) |
323
+ | LTspice | `sim-plugin-ltspice` | [sim-plugin-ltspice](https://github.com/svd-ai-lab/sim-plugin-ltspice) |
324
+
325
+ For the curated full list, see [sim-plugin-index](https://github.com/svd-ai-lab/sim-plugin-index).
326
+
327
+ After adding any plugin package, sync its bundled skill and verify that the local
328
+ solver can be reached:
329
+
330
+ ```bash
331
+ uv run sim plugin list
332
+
333
+ # Codex or Copilot
334
+ uv run sim plugin sync-skills --target .agents/skills --copy
335
+
336
+ # Claude Code
337
+ uv run sim plugin sync-skills --target .claude/skills --copy
338
+
339
+ uv run sim check <solver>
340
+ uv run sim plugin doctor <solver> --deep
341
+ ```
342
+
343
+ For direct wheel, Git, local checkout, or non-uv workflows, see
344
+ [docs/plugin-install.md](docs/plugin-install.md).
345
+
346
+ ## Project setup with sim.toml
347
+
348
+ For reproducible Python packages, commit the `pyproject.toml` and `uv.lock`
349
+ created by `uv add`. Use `sim.toml` for solver defaults and workspace settings:
350
+
351
+ ```bash
352
+ uv run sim init
353
+ ```
354
+
355
+ Example:
356
+
357
+ ```toml
358
+ [sim]
359
+ default_solver = "comsol"
360
+ workspace = "./workspace"
361
+
362
+ [[sim.plugins]]
363
+ name = "comsol"
364
+ package = "sim-plugin-comsol"
365
+ ```
366
+
367
+ Then a fresh checkout can run:
368
+
369
+ ```bash
370
+ uv sync
371
+ uv run sim setup --dry-run
372
+
373
+ # Codex or Copilot
374
+ uv run sim plugin sync-skills --target .agents/skills --copy
375
+
376
+ # Claude Code
377
+ uv run sim plugin sync-skills --target .claude/skills --copy
378
+ ```
379
+
380
+ ## Common commands
381
+
382
+ | Command | Use it for |
383
+ |---|---|
384
+ | `uv run sim plugin list` | Show plugins visible in this project environment. |
385
+ | `uv run sim plugin info <solver>` | Show plugin metadata and compatibility summary. |
386
+ | `uv run sim plugin doctor <solver> --deep` | Check plugin wiring plus local solver detection. |
387
+ | `uv run sim plugin sync-skills --target .agents/skills --copy` | Materialize installed plugin skills for Codex or Copilot. |
388
+ | `uv run sim plugin sync-skills --target .claude/skills --copy` | Materialize installed plugin skills for Claude Code. |
389
+ | `uv run sim check <solver>` | Detect local or remote solver installs. |
390
+ | `uv run sim connect --solver <solver>` | Open a persistent solver session. |
391
+ | `uv run sim exec --file step.py` | Run one bounded step in the live session. |
392
+ | `uv run sim inspect <target>` | Query session, result, or solver-specific state. |
393
+ | `uv run sim run script.py --solver <solver>` | Run a deterministic one-shot script. |
394
+ | `uv run sim disconnect` | Tear down the active session. |
395
+ | `uv run sim setup` | Apply plugin declarations from `sim.toml` when you use them. |
396
+
397
+ Run `uv run sim describe` for a machine-readable command manifest, or
398
+ `uv run sim <command> --help` for exact options.
399
+
400
+ ## Solver ownership
401
+
402
+ `sim-cli` does not bundle or redistribute simulation solvers or vendor SDKs.
403
+ Install and operate each underlying solver according to its vendor terms. See
404
+ [NOTICE](NOTICE) for optional SDK dependency notes.
405
+
406
+ `sim-cli` is an independent open-source project and is not affiliated with,
407
+ endorsed by, or sponsored by any solver vendor. Product, solver, and company
408
+ names remain the property of their respective owners.
409
+
410
+ ## Developer docs
411
+
412
+ - [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) - project setup, layout, driver
413
+ development, and architecture notes
414
+ - [docs/plugin-install.md](docs/plugin-install.md) - plugin installation
415
+ reference
416
+
417
+ ## License
418
+
419
+ Apache-2.0 - see [LICENSE](LICENSE).
@@ -1,15 +1,14 @@
1
1
  sim/__init__.py,sha256=FQjdXr5BNBglRfKQ940zGQ3t5c2rCUjzDCuK2SYIp1Y,345
2
2
  sim/__main__.py,sha256=hwGnM_V9it8Ds_SjAg0hRDqIaNp7L0A8Zx4WUbPKi6U,1034
3
- sim/_plugin_install.py,sha256=SIIsIcnrKtyCZHXjwiMTyqO3233_7dqf8Hwz7abBfpc,13156
3
+ sim/_plugin_install.py,sha256=tcqNNuvEY1AjwXFlTydCw8GNaLbYU2a4F6ACOVXigzg,13259
4
4
  sim/_timeout.py,sha256=jUWw311yDinvqwWGO55CDgInbyioB3a4_8xovR_8g9E,3697
5
- sim/cli.py,sha256=56XLWDy0K_HTa4dyon5Z-eKUU5dh0QRZ2yn7WLDE2_g,59804
5
+ sim/cli.py,sha256=l3k8CNKiJpQSetmjPMkIb1IMKS7g9NfjI903O4vVD80,58237
6
6
  sim/compat.py,sha256=khoAPuIZcj5e5nKAq0Bw7B3DDTbTD_nLhjmsE2CJoMo,16139
7
7
  sim/config.py,sha256=EXkwiGXPa-rxjkHdRqdt4Ru7UCHChbVL01itXsBVeNk,12217
8
- sim/describe.py,sha256=siG0cRhY90iFOJ_6xFTR4yRsQTLF9pIilu69hQsxQL0,14499
8
+ sim/describe.py,sha256=fOuVpwT9vnzj09ViMsWMdaoTVPWq_hKc4M9mwHnFVmk,14346
9
9
  sim/driver.py,sha256=8jSmoeIeT9fh5XLaTDse8_d8w34xP-TggU5_-jkzrbE,6573
10
10
  sim/history.py,sha256=Sd61XsrG-eDEAc0YuMVmwQzl0WEWZcBleCxJkY1I5fE,5410
11
11
  sim/inspect.py,sha256=DJGiC_KKQyEWOYKwZa7ogiHpxnqVsPyCNAade0QGPbs,44676
12
- sim/plugin_catalog.py,sha256=qDMqeD4cmXwYcefeu-KUzcSfY_6RscaBoYEt4Abuhhg,8361
13
12
  sim/plugins.py,sha256=bzBgKKruMwzC2lWVoH49K-J0ksc6Nv7l4RAcTOW2vbA,17554
14
13
  sim/runner.py,sha256=QGT9wAfN7mrO1n7BSn1x49c7kerSCXLscyJ2dCwZCOo,6641
15
14
  sim/server.py,sha256=E4H8YWt_DOh7sHfxpkCvwhDUrJQGCQP4OCDwMmS_uUs,20034
@@ -21,9 +20,9 @@ sim/gui/_win32_dialog.py,sha256=4hErvQxY4SwW_fTpX3FTUxhugkRYpkTRdBiBDu9_1DE,4731
21
20
  sim/gui/LICENSES/ATTRIBUTION.md,sha256=X5EdZV0Gt0FdG9FpeCZ-22I3cqRg9SmoQt-86DqCBak,1150
22
21
  sim/testing/__init__.py,sha256=iGwbSfJucKuhNLOiDnUmQCBlkhukWyp7cj89YDhoEOk,855
23
22
  sim/testing/protocol_conformance.py,sha256=q0r7QgPoAyU-eMqN4fJWx0XZv8YNolGghu9-zDC8bls,9867
24
- sim_cli_core-0.3.4.dist-info/METADATA,sha256=9v3K8OTok7X3rOQYXPq1qiMqUxaMoo7IZSkhVp59kKo,18014
25
- sim_cli_core-0.3.4.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
26
- sim_cli_core-0.3.4.dist-info/entry_points.txt,sha256=hpg7D0fRhpgmo1IyN35XQPoyIZRSw7SLNG7tW0eacGA,37
27
- sim_cli_core-0.3.4.dist-info/licenses/LICENSE,sha256=7toF0XzHlqSXvTlZ8W77R6pg2ilzKN73EOG0SioX7wQ,10762
28
- sim_cli_core-0.3.4.dist-info/licenses/NOTICE,sha256=GQ0HVRFnQwrSFFm-7mYWTTtWDcko0_p2Rdv5t62glts,1752
29
- sim_cli_core-0.3.4.dist-info/RECORD,,
23
+ sim_cli_core-0.3.6.dist-info/METADATA,sha256=1ajDGUFdaA9_kZ7lJ4m7PHTwY_hhfoKo5d7z3leajaw,16732
24
+ sim_cli_core-0.3.6.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
25
+ sim_cli_core-0.3.6.dist-info/entry_points.txt,sha256=hpg7D0fRhpgmo1IyN35XQPoyIZRSw7SLNG7tW0eacGA,37
26
+ sim_cli_core-0.3.6.dist-info/licenses/LICENSE,sha256=7toF0XzHlqSXvTlZ8W77R6pg2ilzKN73EOG0SioX7wQ,10762
27
+ sim_cli_core-0.3.6.dist-info/licenses/NOTICE,sha256=GQ0HVRFnQwrSFFm-7mYWTTtWDcko0_p2Rdv5t62glts,1752
28
+ sim_cli_core-0.3.6.dist-info/RECORD,,
sim/plugin_catalog.py DELETED
@@ -1,232 +0,0 @@
1
- """Plugin catalogue/discovery helpers.
2
-
3
- The catalogue answers "what plugins exist?" for users and agents. It is
4
- intentionally separate from ``sim plugin install`` source resolution: catalogue
5
- entries advertise an explicit install string, but installing still requires the
6
- caller to pass that string (or any other pip-native source) to
7
- ``sim plugin install``. The catalogue is advisory metadata, not a trust
8
- boundary or a runtime resolver.
9
-
10
- Schema (sim-plugin-index ``index.json``, ``schema_version: 2``):
11
-
12
- {
13
- "id": "ltspice", # short slug
14
- "name": "LTspice", # display name
15
- "distribution": "pypi" | "wheel" | "git", # advisory tag
16
- "install": "sim-plugin-ltspice==0.2.3" # literal arg to `sim plugin install`
17
- | "https://.../foo.whl#sha256=..."
18
- | "git+https://...",
19
- "version": "0.2.3",
20
- "summary": "...", # optional, display only
21
- "homepage": "...", # optional, display only
22
- "license_class": "oss" | "commercial" # optional, display only
23
- }
24
-
25
- The reader also accepts the legacy ``schema_version: 1`` shape (``name`` as
26
- slug, ``latest_version``, ``latest_wheel_url``/``git``/``package``) so the
27
- catalogue can migrate independently of sim-cli releases.
28
- """
29
- from __future__ import annotations
30
-
31
- import json
32
- import time
33
- import urllib.request
34
- from dataclasses import dataclass
35
- from pathlib import Path
36
- from typing import Any
37
-
38
- DEFAULT_CATALOG_URL = (
39
- "https://raw.githubusercontent.com/svd-ai-lab/sim-plugin-index/main/index.json"
40
- )
41
- CATALOG_CACHE_TTL_SECONDS = 3600
42
-
43
-
44
- def _catalog_cache_path() -> Path:
45
- return Path.home() / ".sim" / "index-cache" / "catalog.json"
46
-
47
-
48
- @dataclass(frozen=True)
49
- class CatalogEntry:
50
- """One available plugin as advertised by the discovery catalogue."""
51
-
52
- id: str # short slug, e.g. "ltspice"
53
- name: str = "" # display name, e.g. "LTspice"
54
- distribution: str = "" # "pypi" | "wheel" | "git" | ""
55
- install: str = "" # literal arg to `sim plugin install`
56
- version: str = "" # advertised current version
57
- summary: str = ""
58
- homepage: str = ""
59
- license_class: str = ""
60
- source: str = "catalog"
61
-
62
- def to_dict(self) -> dict[str, str]:
63
- return {
64
- "id": self.id,
65
- "name": self.name,
66
- "distribution": self.distribution,
67
- "install": self.install,
68
- "version": self.version,
69
- "summary": self.summary,
70
- "homepage": self.homepage,
71
- "license_class": self.license_class,
72
- "source": self.source,
73
- }
74
-
75
-
76
- def fetch_catalog(
77
- url: str = DEFAULT_CATALOG_URL,
78
- *,
79
- force: bool = False,
80
- offline: bool = False,
81
- ) -> dict[str, Any]:
82
- """Fetch the plugin discovery catalogue with a small local cache.
83
-
84
- The cache is only for discovery. It is never consulted at install time.
85
- """
86
-
87
- cache = _catalog_cache_path()
88
- if offline:
89
- if cache.is_file():
90
- try:
91
- return json.loads(cache.read_text(encoding="utf-8"))
92
- except (OSError, json.JSONDecodeError):
93
- return {"schema_version": 2, "plugins": []}
94
- return {"schema_version": 2, "plugins": []}
95
-
96
- if not force and cache.is_file():
97
- try:
98
- if time.time() - cache.stat().st_mtime < CATALOG_CACHE_TTL_SECONDS:
99
- return json.loads(cache.read_text(encoding="utf-8"))
100
- except (OSError, json.JSONDecodeError):
101
- pass
102
-
103
- try:
104
- with urllib.request.urlopen(url, timeout=10) as resp:
105
- data = resp.read().decode("utf-8")
106
- parsed = json.loads(data)
107
- except Exception: # noqa: BLE001 - discovery should degrade gracefully
108
- if cache.is_file():
109
- try:
110
- return json.loads(cache.read_text(encoding="utf-8"))
111
- except (OSError, json.JSONDecodeError):
112
- pass
113
- return {"schema_version": 2, "plugins": []}
114
-
115
- cache.parent.mkdir(parents=True, exist_ok=True)
116
- cache.write_text(data, encoding="utf-8")
117
- return parsed
118
-
119
-
120
- def _legacy_install_string(raw: dict[str, Any]) -> tuple[str, str]:
121
- """Derive (install, distribution) from a v1 catalogue entry.
122
-
123
- v1 entries had ``package`` / ``latest_version`` / ``latest_wheel_url`` /
124
- ``git`` instead of a single ``install`` string. Order of preference:
125
- pinned wheel URL → PyPI package spec → git URL → bare package name.
126
- """
127
- package = str(raw.get("package") or raw.get("pypi_package") or "").strip()
128
- version = str(raw.get("latest_version") or raw.get("version") or "").strip()
129
- wheel_url = str(raw.get("latest_wheel_url") or "").strip()
130
- git_url = str(raw.get("git") or "").strip()
131
-
132
- if wheel_url:
133
- return wheel_url, "wheel"
134
- if package and version:
135
- return f"{package}=={version}", "pypi"
136
- if package:
137
- return package, "pypi"
138
- if git_url:
139
- return f"git+{git_url}", "git"
140
- return "", ""
141
-
142
-
143
- def _entry_from_mapping(raw: dict[str, Any], *, source: str) -> CatalogEntry | None:
144
- # Slug: prefer v2 `id`, fall back to v1 `name`.
145
- slug = str(raw.get("id") or raw.get("name") or "").strip()
146
- if not slug:
147
- return None
148
-
149
- # Display name: prefer explicit `name`, fall back to slug.
150
- display = str(raw.get("name") or slug).strip()
151
- # If both `id` and `name` were absent we used `name` as slug — re-derive
152
- # display from the slug to avoid showing the raw key as both fields.
153
- if not raw.get("id") and raw.get("name"):
154
- display = str(raw["name"]).strip()
155
-
156
- distribution = str(raw.get("distribution") or "").strip()
157
- install = str(raw.get("install") or "").strip()
158
- version = str(raw.get("version") or raw.get("latest_version") or "").strip()
159
-
160
- # v1 fallback: synthesize install + distribution from legacy fields.
161
- if not install:
162
- install, legacy_dist = _legacy_install_string(raw)
163
- if not distribution:
164
- distribution = legacy_dist
165
-
166
- return CatalogEntry(
167
- id=slug,
168
- name=display,
169
- distribution=distribution,
170
- install=install,
171
- version=version,
172
- summary=str(raw.get("summary") or raw.get("description") or ""),
173
- homepage=str(raw.get("homepage") or raw.get("url") or raw.get("git") or ""),
174
- license_class=str(raw.get("license_class") or raw.get("license") or ""),
175
- source=source,
176
- )
177
-
178
-
179
- def normalize_catalog(raw: dict[str, Any], *, source: str = "catalog") -> list[CatalogEntry]:
180
- """Normalize current and legacy catalogue shapes into ``CatalogEntry`` rows."""
181
-
182
- plugins = raw.get("plugins", [])
183
- if isinstance(plugins, dict):
184
- iterable = []
185
- for slug, info in plugins.items():
186
- if isinstance(info, dict):
187
- # If the value already carries `id` we trust it; otherwise
188
- # promote the dict key to the slug.
189
- item = {"id": slug, **info} if "id" not in info else dict(info)
190
- else:
191
- item = {"id": slug}
192
- iterable.append(item)
193
- elif isinstance(plugins, list):
194
- iterable = [p for p in plugins if isinstance(p, dict)]
195
- else:
196
- iterable = []
197
-
198
- rows = []
199
- for item in iterable:
200
- row = _entry_from_mapping(item, source=source)
201
- if row is not None:
202
- rows.append(row)
203
- return sorted(rows, key=lambda r: r.id.lower())
204
-
205
-
206
- def list_catalog(
207
- *,
208
- query: str | None = None,
209
- url: str = DEFAULT_CATALOG_URL,
210
- offline: bool = False,
211
- force: bool = False,
212
- ) -> list[CatalogEntry]:
213
- """List available plugins from the discovery catalogue.
214
-
215
- ``query`` is an optional case-insensitive substring filter over
216
- ``id``/``name``/``summary``/``homepage``. Kept as a helper-level option for
217
- callers that want to filter the same data; the CLI exposes only the full
218
- listing (``sim plugin catalog``).
219
- """
220
-
221
- raw = fetch_catalog(url=url, offline=offline, force=force)
222
- rows = normalize_catalog(raw, source=url)
223
- if not query:
224
- return rows
225
- q = query.lower()
226
- return [
227
- row for row in rows
228
- if q in row.id.lower()
229
- or q in row.name.lower()
230
- or q in row.summary.lower()
231
- or q in row.homepage.lower()
232
- ]
@@ -1,362 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: sim-cli-core
3
- Version: 0.3.4
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 — the container runtime for physics simulations" width="820">
45
-
46
- <br>
47
-
48
- **Make every engineering tool agent-native.**
49
-
50
- *Today's CAD and CAE software was built for engineers clicking through GUIs.*
51
- *Tomorrow's user is an LLM agent — and it needs a way in.*
52
-
53
- <p align="center">
54
- <a href="#-quick-start"><img src="https://img.shields.io/badge/Quick_Start-2_min-3b82f6?style=for-the-badge" alt="Quick Start"></a>
55
- <a href="#-solver-registry"><img src="https://img.shields.io/badge/Solvers-growing_registry-22c55e?style=for-the-badge" alt="Growing solver registry"></a>
56
- <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>
57
- <a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache_2.0-eab308?style=for-the-badge" alt="License"></a>
58
- </p>
59
-
60
- <p align="center">
61
- <img src="https://img.shields.io/badge/python-3.10--3.12-3776AB?logo=python&logoColor=white" alt="Python">
62
- <img src="https://img.shields.io/badge/CLI-Click_8-blue" alt="Click">
63
- <img src="https://img.shields.io/badge/server-FastAPI-009688?logo=fastapi&logoColor=white" alt="FastAPI">
64
- <img src="https://img.shields.io/badge/transport-HTTP%2FJSON-orange" alt="HTTP/JSON">
65
- <img src="https://img.shields.io/badge/status-alpha-f97316" alt="Status: alpha">
66
- </p>
67
-
68
- **English** · [Deutsch](docs/README.de.md) · [日本語](docs/README.ja.md) · [中文](docs/README.zh.md)
69
-
70
- [Why sim](#-why-sim) · [Quick Start](#-quick-start) · [Solvers](#-solver-registry) · [Commands](#-commands) · [Skills](https://github.com/svd-ai-lab/sim-skills)
71
-
72
- </div>
73
-
74
- ---
75
-
76
- ## 🤔 Why sim?
77
-
78
- 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.
79
-
80
- Today, the choices are awful:
81
-
82
- - **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.
83
- - **Bespoke wrappers per solver** — every team rebuilds the same launch / exec / inspect / teardown loop in a different shape.
84
- - **Closed proprietary glue** — vendor SDKs that don't compose, don't share a vocabulary, and don't speak HTTP.
85
-
86
- `sim` is the missing layer:
87
-
88
- - **One CLI**, one HTTP protocol, **a growing driver registry** spanning CFD, multiphysics, thermal, pre-processing, and beyond.
89
- - **Persistent sessions** the agent introspects between every step.
90
- - **Remote-by-default** — the CLI client and the live solver can sit on different machines (LAN, Tailscale, HPC head node).
91
- - **Companion agent skills** that teach an LLM how to drive each backend safely.
92
-
93
- > Like a container runtime standardized how Kubernetes talks to containers, **sim** standardizes how agents talk to solvers.
94
-
95
- ---
96
-
97
- ## 🏛 Architecture
98
-
99
- <div align="center">
100
- <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">
101
- </div>
102
-
103
- Two execution modes from the same CLI, sharing the same `DriverProtocol`:
104
-
105
- | Mode | Command | When to use it |
106
- |---|---|---|
107
- | **Persistent session** | `sim serve` + `sim connect / exec / inspect` | Long, stateful workflows the agent inspects between steps |
108
- | **One-shot** | `sim run script.py --solver X` | Whole-script jobs you want stored as a numbered run in `.sim/runs/` |
109
-
110
- For the full driver protocol, server endpoints, and execution pipeline see [CLAUDE.md](CLAUDE.md).
111
-
112
- ---
113
-
114
- ## 🚀 Quick Start
115
-
116
- > **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.
117
-
118
- 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).
119
-
120
- **macOS / Linux:**
121
-
122
- ```bash
123
- # 1. On the host that has the solver installed, install sim core only
124
- # — no driver choice yet:
125
- uv pip install sim-cli-core
126
-
127
- # 2. Install the plugin for the solver you actually want:
128
- sim plugin install sim-plugin-ltspice
129
-
130
- # 3. Tell sim to look at this machine and pick the right SDK profile:
131
- sim check <solver>
132
- # → reports detected installs of <solver> and the profile they resolve to
133
-
134
- # 4. Bootstrap that profile env (creates .sim/envs/<profile>/ with the
135
- # pinned SDK; or pass --auto-install to step 5 to do it inline):
136
- sim env install <profile>
137
-
138
- # 5. Start the server (only needed for remote / cross-machine workflows):
139
- sim serve --host 0.0.0.0 # FastAPI on :7600
140
-
141
- # 6. From the agent / your laptop / anywhere on the network:
142
- sim --host <server-ip> connect --solver <solver> --mode solver --ui-mode gui
143
- sim --host <server-ip> inspect session.versions # ← always do this first
144
- sim --host <server-ip> exec "<solver-specific snippet>"
145
- sim --host <server-ip> screenshot -o shot.png
146
- sim --host <server-ip> disconnect
147
- ```
148
-
149
- **Windows (PowerShell):**
150
-
151
- ```powershell
152
- # 1. On the host that has the solver installed, install sim core only
153
- # — no driver choice yet:
154
- uv pip install sim-cli-core
155
-
156
- # 2. Install the plugin for the solver you actually want:
157
- sim plugin install sim-plugin-ltspice
158
-
159
- # 3. Tell sim to look at this machine and pick the right SDK profile:
160
- sim check <solver>
161
-
162
- # 4. Bootstrap that profile env (or pass --auto-install to step 5):
163
- sim env install <profile>
164
-
165
- # 5. Start the server (only needed for remote / cross-machine workflows):
166
- sim serve --host 0.0.0.0 # FastAPI on :7600
167
-
168
- # 6. From the agent / your laptop / anywhere on the network:
169
- sim --host <server-ip> connect --solver <solver> --mode solver --ui-mode gui
170
- sim --host <server-ip> inspect session.versions # ← always do this first
171
- sim --host <server-ip> exec "<solver-specific snippet>"
172
- sim --host <server-ip> screenshot -o shot.png
173
- sim --host <server-ip> disconnect
174
- ```
175
-
176
- That's the full loop: **detect → bootstrap → launch → drive → observe → tear down** — with the engineer optionally watching the solver GUI in real time.
177
-
178
- > **Why the bootstrap step?** Each `(solver, SDK, driver, skill)` combo is
179
- > its own compatibility universe — different solver releases may want
180
- > different SDK versions, and those SDK versions can't always coexist in
181
- > one Python env. sim treats each combo as an isolated "profile env" so
182
- > you can keep multiple versions on one machine without dependency
183
- > conflicts. The contract is in
184
- > [`docs/architecture/version-compat.md`](docs/architecture/version-compat.md).
185
-
186
- ---
187
-
188
- ## 📦 Plugin sources
189
-
190
- `sim plugin install <source>` accepts explicit install sources only:
191
-
192
- - Exact package specs, such as `sim-plugin-ltspice` or `sim-plugin-ltspice==0.2.3`
193
- - Package specs plus private indexes, such as `sim-plugin-mechanical --extra-index-url https://example.com/simple/`
194
- - Direct wheel/sdist URLs, such as `https://example.com/sim_plugin_ltspice-0.2.3-py3-none-any.whl`
195
- - Git URLs, such as `git+https://github.com/<org>/sim-plugin-<name>`
196
- - Local plugin directories, wheels, and sdists
197
-
198
- Discovery is separate from installation:
199
-
200
- ```bash
201
- sim plugin catalog # official plugins (display + copy-paste install string)
202
- sim plugin list # installed/registered plugins on this machine
203
- ```
204
-
205
- 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`.
206
-
207
- ---
208
-
209
- ## 🧪 Solver registry
210
-
211
- `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.
212
-
213
- `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.
214
-
215
- Install from a discovered package, then list what is installed locally:
216
-
217
- ```bash
218
- sim plugin catalog # discover what's available + install strings
219
- sim plugin install sim-plugin-ltspice
220
- sim plugin list # show installed plugins
221
- ```
222
-
223
- Reference implementation to read for shape: [`sim-plugin-ltspice`](https://github.com/svd-ai-lab/sim-plugin-ltspice).
224
-
225
- **Private plugins** (vendor-IP-sensitive backends) install through explicit URLs, private repos, or private Python indexes — same `sim plugin install` flow:
226
-
227
- ```bash
228
- sim plugin install git+https://github.com/<org>/sim-plugin-<name>
229
- # (you need read-access to the repo; without it, git clone returns 401)
230
-
231
- sim plugin install sim-plugin-mechanical --extra-index-url https://example.com/simple/
232
- # standard PEP 503/private-index path for commercial wrappers
233
- ```
234
-
235
- Per-solver protocols, snippets, and demo workflows live in [`sim-skills`](https://github.com/svd-ai-lab/sim-skills) and the per-plugin repos.
236
-
237
- ---
238
-
239
- ## ✨ Features
240
-
241
- ### 🧠 Built for agents
242
- - **Persistent sessions** that survive across snippets — never restart the solver mid-task
243
- - **Step-by-step introspection** with `sim inspect` between every action
244
- - **Pre-flight `sim lint`** catches missing imports and unsupported APIs before launch
245
- - **Numbered run history** in `.sim/runs/` for one-shot jobs, browsable via `sim logs`
246
-
247
- ### 🔌 Solver-agnostic
248
- - **One protocol** (`DriverProtocol`) — every driver is ~200 LOC, shipped as its own `sim-plugin-<name>` package via Python entry points
249
- - **Persistent + one-shot** from the same CLI — no separate client per mode
250
- - **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
251
- - **Companion skills** in [`sim-skills`](https://github.com/svd-ai-lab/sim-skills) so an LLM picks up each new backend without prior context
252
-
253
- ### 🌐 Remote-friendly
254
- - **HTTP/JSON transport** — runs anywhere `httpx` runs
255
- - **Client / server split** — agent on a laptop, solver on an HPC node, GUI on a workstation
256
- - **Tailscale-ready** — designed for cross-network mesh deployments
257
-
258
- ---
259
-
260
- ## ⚙️ Commands
261
-
262
- | Command | What it does | Analogy |
263
- |---|---|---|
264
- | `sim plugin catalog` | Discover available solver plugins | `npm search` |
265
- | `sim plugin list / install / uninstall` | Manage installed plugins from explicit install sources | `npm install` |
266
- | `sim check <solver>` | Detect installations + resolve a profile | `docker info` |
267
- | `sim env install <profile>` | Bootstrap a profile env (venv + pinned SDK) | `pyenv install` |
268
- | `sim env list [--catalogue]` | Show bootstrapped envs (and the full catalogue) | `pyenv versions` |
269
- | `sim env remove <profile>` | Tear down a profile env | `pyenv uninstall` |
270
- | `sim serve` | Start the HTTP server (for cross-machine use) | `ollama serve` |
271
- | `sim connect` | Launch a solver, open a session | `docker start` |
272
- | `sim exec` | Run a Python snippet inside the live session | `docker exec` |
273
- | `sim inspect` | Query live session state (incl. `session.versions`) | `docker inspect` |
274
- | `sim ps` | Show the active session and its profile | `docker ps` |
275
- | `sim screenshot` | Grab a PNG of the solver GUI | — |
276
- | `sim disconnect` | Tear down the session | `docker stop` |
277
- | `sim stop` | Stop the sim-server process | `docker rm -f` |
278
- | `sim run` | One-shot script execution | `docker run` |
279
- | `sim lint` | Pre-flight static check on a script | `ruff check` |
280
- | `sim logs` | Browse stored run history | `docker logs` |
281
-
282
- 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.
283
-
284
- Environment: `SIM_HOST`, `SIM_PORT` for the client; `SIM_DIR` (default `.sim/`) for run storage and profile envs.
285
-
286
- ### Choosing a profile
287
-
288
- 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:
289
-
290
- - **Pin a specific profile:** `sim connect --solver <solver> --profile <profile>`
291
- - **Skip the profile env entirely (legacy / tests):** `sim connect --solver <solver> --inline`
292
- - **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.
293
-
294
- The full design is in [`docs/architecture/version-compat.md`](docs/architecture/version-compat.md).
295
-
296
- ---
297
-
298
- ## 🆚 Why not just run scripts?
299
-
300
- | Fire-and-forget script | sim |
301
- |---|---|
302
- | Write the whole thing, run, hope it converges | Connect → execute → observe → decide next step |
303
- | An error at step 2 surfaces at step 12 | Each step verified before the next is sent |
304
- | Agent has no view of solver state | `sim inspect` between every action |
305
- | Solver restarts on every iteration | One persistent session, snippets at will |
306
- | GUI invisible to the human | Engineer watches the GUI while the agent drives |
307
- | Output parsing reinvented per project | `driver.parse_output()` returns structured fields |
308
-
309
- ---
310
-
311
- ## 🛠 Development
312
-
313
- See [`docs/DEVELOPMENT.md`](docs/DEVELOPMENT.md) for setup, project layout, adding drivers, dev flags, and the layered skill system.
314
-
315
- ---
316
-
317
- ## 🌐 Remote deployment
318
-
319
- 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.
320
-
321
- ```bash
322
- # On the solver host (the machine with the solver installed)
323
- ssh user@solver-host
324
- pip install sim-cli-core
325
- sim serve --host 0.0.0.0 --port 7600 # bind to all interfaces
326
-
327
- # On your local control machine
328
- sim --host <solver-host-ip> connect --solver <solver> --mode <mode>
329
- sim --host <solver-host-ip> exec "<solver-specific snippet>"
330
- sim --host <solver-host-ip> inspect session.summary
331
- sim --host <solver-host-ip> disconnect
332
- sim --host <solver-host-ip> stop # shut down the remote server when done
333
- ```
334
-
335
- 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.
336
-
337
- ---
338
-
339
- ## 🔗 Related projects
340
-
341
- - **[`sim-skills`](https://github.com/svd-ai-lab/sim-skills)** — agent skills, snippets, and demo workflows for each supported solver
342
- - **[`sim-ltspice`](https://github.com/svd-ai-lab/sim-ltspice)** — standalone Python API for LTspice file formats (used by `sim-plugin-ltspice`)
343
-
344
- ---
345
-
346
- ## 📄 License
347
-
348
- Apache-2.0 — see [LICENSE](LICENSE).
349
-
350
- ### Third-party solver SDKs
351
-
352
- `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.
353
-
354
- 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.
355
-
356
- ### Trademarks
357
-
358
- `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:
359
-
360
- - **OpenFOAM®** is a registered trademark of **OpenCFD Ltd.**
361
- - **ParaView®** is a trademark of **Kitware, Inc.**
362
- - All other solver and product names are trademarks of their respective owners.