Skip to main content
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. A run uses the profile you are signed in with, so 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.
For interactive work, start the terminal UI instead.

Run your first task

Pass your message after run:
Gloo Code works on the task, prints its replies as it goes, and exits when the turn is finished. Quote the message so your shell passes it as one argument.

Choose where it runs

By default the run happens in your current folder. Use --dir to point it somewhere else:
Paths you pass to --file are resolved from that folder.

Project setup in a run

A folder can bring its own setup: instructions such as AGENTS.md and CLAUDE.md, a gloocode.json config, skills, plugins, and MCP servers. gloocode run uses that setup only if you trusted the folder in Gloo Code, and only as it was when you trusted it. Each MCP server the folder defines also needs your approval. When the run leaves something out, it says so before it starts and lists what it left out, then carries on without it. To trust a folder, open it in the desktop app or the terminal UI and say yes when Gloo Code asks, or type /trust.
In CI (the CI environment variable is set to anything other than empty, 0 or false), a run that left out project setup you haven’t trusted exits with code 1. Pass --trust-project if the run should use the repository’s setup, or --without-project-setup if it shouldn’t.

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:
If the name isn’t a supported Gloo model, the run stops with an error before it starts. List the available models with gloocode models --verbose. Use --agent to run as a specific primary agent, such as plan:
If the agent name doesn’t exist, or it is a subagent rather than a primary agent, the run prints a warning and falls back to the default agent.

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:
If a file doesn’t exist, the run exits with an error before sending anything.

Pipe in input

When something is piped into gloocode run, it is appended to your message:
You can also send only piped input with no message. If there is no message and nothing is piped in, the run exits with an error.

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 human-readable output. Add --format json for a stream of JSON events, one per line, that a script can read:
Without 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 (except trust_skipped, which comes before the session starts), plus a payload that depends on the type. The stream includes these events:

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, so gloocode run answers for you: by default it rejects any permission request and keeps going. Work inside your project rarely asks for permission, 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.
--unleashed allows every prompt that no deny rule blocks, except the safety prompts that follow outside content: gloocode run still refuses those unless you allow them in Settings ▸ Safety. The agent can change or delete files and run commands without asking. Use it only in a scratch folder, a container, or a throwaway checkout, not on work you haven’t committed. You are responsible for what it runs.For a first try, copy the project into a scratch folder and run there with --dir. You can look at the result, then keep it or throw it away.
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.

Next steps

Migrate to Gloo Code

What carries over from other coding agents.

Install Gloo Code

Install the CLI and sign in.

Billing & Plans

Tiers, seats, monthly allowance, and top-ups.