Scripting and automation
Print mode, JSON output, exit codes, CI and budgets.
- Can I pipe text into Line CLI?Put the text in the prompt, for example line -p "summarize: $(cat notes.txt)". Line reads the prompt from its arguments, not stdin.FAQ
- Can I run Line CLI on a schedule?Yes. Call line -p from cron or another scheduler on a signed-in machine, with dont-ask permissions, a turn limit and JSON output.How-to
- Can print mode edit files without approving every change?Yes. --permission-mode accept-edits lets file edits run while commands are declined; --yes or auto lets everything run.FAQ
- How do I allow or block tools for one Line CLI run?Use --allowed-tools for rules that run without asking and --disallowed-tools for rules that are denied. A bare tool name removes the tool.How-to
- How do I limit how many steps a Line CLI run takes?Pass --max-turns N in print mode. Line stops after N model steps, exits with code 2 and saves the session so you can continue.How-to
- How do I read Line CLI's JSON output from a script?Run line -p with --output-format json, parse the final line as JSON, and check subtype, is_error and result.How-to
- How do I run Line CLI in print mode for scripts?line -p "prompt" answers once and exits: the answer on stdout, tool activity on stderr, with a usage line and an exit code.How-to
- How do I use Line CLI in GitHub Actions or another CI system?Install Line in a step, run print mode with JSON output, limit permissions and turns, and read the exit code. Sign-in needs care on CI.How-to
- How does --output-format stream-json work?stream-json prints one JSON event per line as Line works: init, text, tool_use, tool_result, usage, retry, note, permission_denied, then result.Reference
- My Line CLI print-mode run failed. How do I continue it?Print-mode runs are saved as sessions. Continue with line -c -p "continue" in the same folder, or line --resume <id> -p "continue".How-to
- What does Line CLI's JSON output look like?With --output-format json, print mode ends with one result object: result, session id, steps, duration, tokens, cost, edits and status.Reference
- What exit codes does Line CLI return?Line exits 0 on success, 1 on error, 2 when --max-turns stopped it, and 130 when interrupted with Ctrl+C. Sessions are saved in every case.Reference
Still need help?
Tried the steps above and still stuck? Email us. We usually reply within the first hour, and always within 24 hours. A full support team is with you.
Infrastructure questions, or permanent deletion of your data
infrastructure@clatterlabs.xyzFor deleting your whole account or the data of one service.