doctl harness-runtime prompt

Generated on 6 Oct 2026 from doctl version v1.178.0

Usage

doctl harness-runtime prompt <session> <prompt>... [flags]

Aliases

ask

Description

Send one prompt to an existing session, wait for the agent to finish, and print its answer. Headless execution: no TUI, no keyboard input.

The prompt is everything after the session, so it need not be quoted. Pass - to read it from stdin instead.

Only the agent’s answer goes to stdout, so it can be captured directly (ANSWER=$(doctl harness-runtime prompt my-session 'What changed?')). Progress, tool calls, and the closing token and cost summary go to stderr, where they stay visible on a terminal without corrupting a pipe. Add --include-reasoning to also emit the model’s thinking on stderr, or --quiet to silence stderr entirely. With -o json the answer, run ID, status, and usage are emitted as one object instead.

The exit code reports the run: 0 when it completed, 1 when it failed (including a cancel sent from elsewhere, which -o json reports as status cancelled), 130 when this command’s Ctrl-C cancelled it, and 124 when --timeout expired, so this composes in && chains and if tests.

Ctrl-C cancels the run — the session stays up for the next prompt — and waits for it to stop, reporting status cancelled. Press Ctrl-C again to stop waiting at once. Agents that cannot cancel a run say so, and the run keeps going. A timeout, a second Ctrl-C, or SIGTERM only stop waiting locally and do not stop the agent — the run continues and its output stays readable with doctl harness-runtime logs.

A paused session is resumed on the way in. Because nothing here can ask a human, an approval request stops the command unless --on-hitl says how to answer.

Example

doctl harness-runtime prompt my-session What is the capital of France?;

Flags

Option Description
--format Columns for output in a comma-separated list. Possible values: SessionID, RunID, Status, Text.
--help, -h Help for this command
--include-reasoning Also print the model’s reasoning to stderr, not just its answer
Default: false
--no-header Return raw data with no headers
Default: false
--on-hitl Resolve every approval request this way (approve|reject|defer). Without it, an approval request stops the command, since nothing here can ask a human.
--quiet, -q Suppress progress on stderr; stdout still carries the answer
Default: false
--timeout Maximum seconds to wait for the run to finish, exiting 124 if it does not (0 waits indefinitely). A timeout does not stop the agent; Ctrl-C does.
Default: 0
Command Description
doctl harness-runtime Managed Agents Runtime Services (M.A.R.S)

Global Flags

Option Description
--access-token, -t API V2 access token
--api-url, -u Override default API endpoint
--config, -c Specify a custom config file
Default:
    --context Specify a custom authentication context name
    --http-retry-max Set maximum number of retries for requests that fail with a 429 or 500-level error
    Default: 5
    --http-retry-wait-max Set the minimum number of seconds to wait before retrying a failed request
    Default: 30
    --http-retry-wait-min Set the maximum number of seconds to wait before retrying a failed request
    Default: 1
    --interactive Enable interactive behavior. Defaults to true if the terminal supports it (default false)
    Default: false
    --output, -o Desired output format [text|json]
    Default: text
    --trace Show a log of network activity while performing a command
    Default: false
    --verbose, -v Enable verbose output
    Default: false

    We can't find any results for your search.

    Try using different keywords or simplifying your search terms.