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?
- The context window the model is loaded with. Run
lms psand 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. - That each agent is set to the model you mean to test. All three keep that in their own settings.
- The time. Note the clock before and after, since none of the three reports how long it took.
How much does each agent send to the model before my task?
A great deal more than the one line you typed. We read LM Studio’s server log for our three runs and counted the tokens in each request.
Pi made 10 calls with a largest request of 10,243 tokens, OpenCode 8 calls with a largest of 34,666 and Hermes 8 calls with a largest of 30,030, and how that shaped each run is in our Pi vs OpenCode vs Hermes comparison.
Pi’s first request was 1,663 tokens. OpenCode’s was 31,034 and Hermes’s was 24,388. The difference is each agent’s own instructions and the descriptions of its tools, which go to the model on every call. We ran Pi with its skills and context files switched off, which is part of why it is so small. Other programs on this Mac share the same server, so treat the counts as close, not exact.
What context window do I need to run an agent on a local model?
Larger than its biggest request, with room for the reply. On those figures Pi would fit in a small window, and the other two need well over 32,000 tokens. LM Studio loads a model at 8,192 tokens when nothing tells it otherwise, which is too small for any of the three once the work begins. Hermes checks for this and refuses to start: when our model was loaded at 8,192 it stopped with a message that it needs at least 64,000. We loaded the model at 65,536 for every run.
How long will I wait before the agent does anything?
Longer for a heavy agent, because the model has to read all of that first. Our model read at about 82 tokens a second. At that rate a first request of 31,034 tokens takes about 6 minutes to read before a word is written, and one of 1,663 tokens takes about 20 seconds. Later calls are quicker, since the server keeps what it has already read. This is arithmetic from our measured reading speed, not a separate timing.
What happens if the local model is a thinking model?
It can use the whole reply on thinking and never act. We repeated the test with Qwen 3.8 27B. Pi ran for 17 min 41 s and ended with a single turn of 8,192 tokens, the most the agent allows, and no file. OpenCode read the four files, then did the same over 25 min 33 s. Neither agent turned the model’s thinking down, and neither told us anything was wrong.
How do I know a one shot run really worked?
Check for the result, not the exit code. All three of those failed runs exited with code 0, the code for success. The only sign of failure was that the file the task should have written was not there. So end every scripted run with a check that the output exists and is not empty, and keep the agent’s log beside it.
How do I keep the runs comparable?
- Run one agent at a time. Two at once share the model and both slow down.
- Check which model is loaded, and at what context, before each run.
- Give each agent its own copy of the folder.
- Use the same prompt, word for word.
- Note which of the agent’s own instructions were on. They are part of what you are testing.
What should I record from each run?
Four things, at the least: the clock time at the start and the end, the model and context window that were loaded, the agent’s version, and whether the output file exists. With those you can repeat the run later and know whether a change in the result came from the agent, the model or the setup.
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. We ran Pi 0.99.1, OpenCode 1.18.31 and Hermes 0.21.5 on 4 October 2026. What they made of it is in our drawing test, and how the three differed is in our comparison.
Sources
Cite this page
Hill. "Run Pi, OpenCode and Hermes from the command line". Onticpost, published 4 October 2026, updated 24 October 2026. https://onticpost.com/run-pi-opencode-hermes-one-prompt-command-line/
Updated 24 October 2026. This address stays the same when the piece is updated.