How to run one prompt through Pi, OpenCode and Hermes from the command line

One command each, no window to open, and the trap that makes Hermes look as if it has hung.

You can run Pi, OpenCode and Hermes from the command line. Each has a way to take one prompt, do the work and exit, with no window to open. That makes it possible to give all three the same task and compare what comes back. This is how we ran our own test, including the one trap that makes Hermes look as if it has hung.

How do I run Pi, OpenCode and Hermes from the command line with the same task?

Put the task in a file, not in the prompt. We wrote the steps in a file called PROCESS.md, put it in a folder with the files the task needs, and made a copy of that folder for each agent. The prompt is then one line that is the same for all of them: read the process file and follow it. A separate folder each keeps one agent from finding another’s work.

How do I run Pi without opening it?

Use print mode. From inside the folder:

pi -p -a -nc -ns "Read PROCESS.md in this folder and follow it exactly, step by step."

-p runs the prompt and exits. -a trusts the files in the folder for this run. -nc and -ns switch off context files and skills, so the process file is the only instruction. Pi prints the final reply and nothing else. The options are listed in Pi’s package page.

How do I run OpenCode from the command line?

Use the run command:

opencode run --auto -m lmstudio/google/gemma-4-31b-qat "Read PROCESS.md in this folder and follow it exactly, step by step."

-m names the model. --auto approves every permission the agent asks for, so use it only in a folder you are happy for it to change. OpenCode prints each step as it goes, which is the most any of the three shows. See OpenCode’s command line documentation.

How do I run Hermes in one shot mode?

Use -z, and give it a terminal:

script -q run.log hermes -z "Read PROCESS.md in the folder $PWD and follow it exactly, step by step." --in "$PWD"

In our earlier runs, Hermes in one shot mode produced no output at all when its output was sent straight to a file. Wrapping it in the script command, which comes with macOS, gives it the terminal it expects. --in sets the folder it works in. The project is on GitHub.

Why does Hermes look as if it has hung?

Because it prints nothing until it has finished. Our run took 15 min 55 s and the first line appeared at the end. To see whether it is alive, watch the model, not the agent: LM Studio’s server log shows the prompt being read and the tokens being written.

What should I check before a local run?

  1. The context window the model is loaded with. Run lms ps and read the context column. Ours was 65,536 tokens. An agent’s own instructions can take many thousands of tokens before your task begins, and a model loaded with a small window will fail on the first turn. The command is part of LM Studio’s command line tool.
  2. That each agent is set to the model you mean to test. All three keep that in their own settings.
  3. The time. Note the clock before and after, since none of the three reports how long it took.

How long does a local agent run take?

Longer than a chat. On a Mac with an M4 Pro chip and 48 GB of memory, with Gemma 4 31B, one small task took Pi 22 min 04 s, OpenCode 15 min 13 s and Hermes 15 min 55 s. What they made of it is in our drawing test, and how the three differed is in our comparison.

Sources

  1. Pi coding agent package page
  2. OpenCode command line documentation
Cite this page

"How to run one prompt through Pi, OpenCode and Hermes from the command line". Onticpost, published 4 October 2026. https://onticpost.com/run-pi-opencode-hermes-one-prompt-command-line/

Updated 4 October 2026. This address stays the same when the piece is updated.

Share this