OwnwareDocs
View source
reference

CLI

Loom ships a CLI for running an agent without writing a script.

bash
npx loom "What is 2+2?"
npx loom --model openai:gpt-4o "Explain quantum computing"
npx loom --tools "Read package.json and explain this project"
npx loom --system "You are a poet" "Write a haiku about TypeScript"
npx loom --tools --max-tokens 32000 "Fix the bug in src/index.ts"
npx loom --json "Hello" | jq '.type'

Flags

Flag Purpose
-m, --model Model string. Default: auto-selected — the first provider with a key in your env, else local Ollama.
-t, --tools Enable built-in tools (filesystem + shell).
-s, --system Custom system prompt.
--max-turns Max model calls (default: 50).
--max-tokens Max output tokens per turn (default: 16384).
--mode Permission mode (ask / auto). Note: parsed but not yet wired into the run — the CLI currently runs unattended regardless; use the library API for real permission control.
-v, --verbose Show sessions, turns, permissions, compaction.
--json Emit events as JSONL.
-h, --help Show usage.

--json streams the same event vocabulary as JSONL — pipe it into jq or any consumer to script on top of the agent.

Next steps