Skip to documentation
Pro 2.1.2
SquidSolver Pro / CLI reference

Scripts and AI

Drive SquidSolver Pro from a Python script or an AI assistant: a starter prompt, a complete walkthrough script, and a JSON Lines session over stdin and stdout.

Pro 2.1.2Updated Read as text
On this page

A starting prompt for an AI

Use an AI assistant that can run commands on your computer. Tell it the game, pot, stacks, board, ranges and bet sizes you want to study. Use the prompt below to get started.

Prompt
Use the installed SquidSolver Pro CLI. Read --help, guide, config examples and config schema first.

Create a new solve for the spot I describe. Use the correct purchased solver: nlh or plo4. Start from its bundled example, then edit the configuration. Ask me about missing game details.

Run solve estimate and show me the configuration and memory estimate before a large solve. Use a new solve ID and new output filenames. Do not delete or overwrite existing work.

Run commands sequentially, inspect exit status and stderr, and check readout availability. Do not treat missing values as zero. Save the result, export the requested streets and board, and report the actual iteration count and output path. A short run is not proof of convergence.

You can also give it the plain-text manual, CLI page and configuration examples. Keep credentials out of prompts and shared transcripts.

A complete Python walkthrough

Download first-solve.py. It reads the example from the installed CLI, estimates memory, creates and solves a new study, reads the starting decision and exports the result. It uses a new ID and directory for each run and stops on a failed command.

Shell
python3 first-solve.py --solver nlh
python3 first-solve.py --solver plo4

On Windows, use python instead of python3 if that is how Python is installed. For a different app location, add --exe followed by the installed executable’s full path. The script requires Python 3.9 or later and uses only the standard library.

Prepare the purchased solver in the app and quit it first. The example uses 100,000 iterations to demonstrate the workflow; adjust --iterations for the run you intend. Check the estimate printed by the script before using it as the basis for a larger study.

Keep one session open

Start squid serve, or squid --solver plo4 serve, with stdin and stdout pipes. Send one JSON object per line and flush after each request. Keep stdin open until the work is finished and saved. Read stderr concurrently to prevent a full pipe from stopping progress.

JSON Lines
{"id":1,"argv":["solve","list"]}
{"id":2,"argv":["solve","open","my_river"]}
{"id":3,"argv":["node","show","my_river"]}
{"id":4,"argv":["solve","close"]}

Match the response ID to the request and inspect ok on every response. The solver is selected when starting serve; do not include --solver or the executable name inside argv.

JSON
{"id":1,"ok":true,"result":{}}
{"id":2,"ok":false,"error":{"code":"not_found","message":"..."}}

These response examples show the envelope; each command’s result has its own fields. For create --config -, put the actual configuration object in the request’s config field. In a one-shot command, --config - instead reads the configuration JSON directly from stdin.

Detached runs and saving

  1. In serve, create or open the solve you want to run.
  2. Run solve run <id> --add <N> --detach.
  3. Poll solve status <id> until backgroundRunning is false, or use solve pause <id>.
  4. Run solve save <id>, then export or close the solve.

EOF or Ctrl-C stops the current work and attempts to save pending progress before exiting. Closing stdin early can stop a detached run before its target. Read the final diagnostics and exit code. Forced termination cannot guarantee a save.

serve uses local standard input and output. It does not start a network API. Use subprocess pipes when integrating it with a script or AI tool.

Need help with a setup? support@squidsolver.com