gloocode run sends one task to Gloo Code, prints the result, and exits. There is no terminal UI and no one to click Approve, so it suits scripts, one-off tasks, and anything you want to chain with other commands.
Gloo Code signs in with your Gloo account in the browser, and a run uses the profile you are signed in with. Install and sign in first: see Installation & Setup.
Use it when you want to:
- Fire off a single task without opening the TUI.
- Pipe a file or command output into Gloo Code.
- Call Gloo Code from a shell script or a Makefile.
- Read the results as JSON from another program.
Run your first task
Pass your message afterrun:
Choose where it runs
By default the run happens in your current folder. Use--dir to point it somewhere else:
--file are resolved from that folder.
Choose a model and an agent
Gloo Code picks a model for you. To choose one yourself, pass-m (or --model) with a gloo/<model-key> name:
gloocode models --verbose.
Use --agent to run as a specific primary agent, such as plan:
Continue or fork a session
Each run starts a new session unless you ask it to pick one up:Attach files
Use-f (or --file) to attach files to your message. Repeat it for more than one:
Pipe in input
When something is piped intogloocode run, it is appended to your message:
Run a saved command
Use--command to run one of your saved slash commands. Whatever you put in the message is passed to the command as its arguments:
Read the output as JSON
By default,gloocode run prints formatted, human-readable output. Add --format json and it prints a stream of JSON events, one per line, which is easy to read from a script:
set -o pipefail, a failed run can still leave the pipeline with exit status 0, because the shell reports the status of jq.
Every line carries type, timestamp, and sessionID, plus a payload that depends on the type.
These event types appear in the stream:
Exit codes
A tool call that fails partway through doesn’t make the run fail on its own, because the agent can recover and carry on. With
--format json, failed tool calls show up as tool_use events with part.state.status set to "error", and failed turns show up as error events.
Permission prompts in a run
A script can’t answer a prompt, sogloocode run answers for you: by default it rejects any permission request and keeps going. Work that stays inside your project mostly doesn’t ask for permission in the first place, so many tasks run fine as they are. A request that does come up appears as a warning line, or as permission_asked and permission_replied events with --format json.
For a task that needs those requests approved, add --unleashed and gloocode run allows every prompt that no deny rule blocks:
--unleashed applies to that one run only. There is no setting to leave it on, so each run that skips prompts says so on its command line. Rules that deny still deny, because those are part of how the agent is set up.
If a safety setting turns an action down, the run prints the setting that would allow it. See Safety settings.
From Claude Code and Codex
If you already script another coding agent, the move is one command:
Both pages cover the rest of the move: From Claude Code and From Codex.

