newton-cli: Agent-native CLI wrapper — drive Newton simulations with JSON #2418
Terry-cyx
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Newton team and community 👋
I built newton-cli — a CLI wrapper that lets AI agents (Claude, GPT, etc.) drive Newton physics simulations through typed commands and JSON envelopes, without writing Python.
Why
LLM agents are good at generating structured data (JSON) but struggle with complex Python involving Warp arrays, CUDA device management, and Newton's builder pattern. newton-cli bridges that gap:
recipe.jsondescribingModelBuildercalls → CLI builds the model, runs the solver, outputsstate.npz+render.png. No Python generated. 25 Newton examples work this way.@wp.kernel, torch policies, autograd), the agent writes a script and the CLI runs it in a subprocess with structured exit envelopes. 33 more examples work this way.58 / 65 Newton examples driven end-to-end through the CLI.
Quick demo
Every command outputs
{"schema":"newton-cli/v1","data":...}with--json. Exit codes are deterministic (0/2/3/4/5).Gallery
All renders produced by
newton-cli viewer render:Solvers covered
SolverXPBD, SolverVBD, SolverMuJoCo, SolverImplicitMPM, SolverStyle3D, SolverSemiImplicit — plus custom
@wp.kernelvia Route B.Links
Feedback, issues, and PRs welcome. Would love to hear from the Newton team if there are API patterns that could make the CLI integration smoother (e.g.,
Modelserialization, headless viewer improvements).Thanks for building such a great engine! 🙏
Beta Was this translation helpful? Give feedback.
All reactions