<@U070UP4FW3F> question regarding the flag `--outp...
# dev-help
q
@elegant-branch-54423 question regarding the flag
--output json
in https://github.com/OpenHands/OpenHands-CLI/issues/147 Is this a type of headless mode but instead of a rich TUI we output json? So
--headless --output json
is the same
--output json
Or should
--headless
mean we never emit any events?
e
My original thinking was
--output json
would emit a json representation of the conversation once it completed. It wouldn't render the rich TUI UX; it would emit the json on the command line in case a downstream system wanted the output of the conversation.
acknowledged 1
👍 1
Its how claude -p --output json works
q
got it! and do we for sure want it once the conversation has completed, or should we stream the events?
i guess streaming would be harder to pipe outputs to a file thonk
e
i think claude also supports streaming. For now, I think we can just wait until we get more feedback. We might want to ask the question in this ticket to get feedback: https://github.com/OpenHands/OpenHands-CLI/issues/147
👍 1
A user,
@bartlettroscoe
looks interested in this, so they may have feedback 🙂 Do you want to ask the question?
q
Yep went for it!
👌 1
m
should
--headless
mean we never emit any events?
I am against this. I find the event logs very useful for debugging/auditing. I care less about
--output json
or whatever other output it generates.
q
Makes sense! Perhaps we can use
-v
or
-vv
flags for emitting logs and keep
--headless
silenced as the default behavior wdyt?
👍 1
m
Sorry, I didn’t realize we are talking about
--headless
mode of CLI but I guess whatever we just discussed still holds. Aside, I have been using openhands v0 headless mode. Should I use CLI v1 in the future with
--headless
flag?
q
Once its released for sure! Should happen sometime tmrw (its still experimental though, for info to come in the release notes)
🔥 1
c
To note, I just had GPT-5.2 in codex use
openhands -t
via a tmux session, and it noted for itself in agents.md:
Copy code
Pitfalls we hit:
You must pass the task with -t (positional args are treated as subcommands).
--exp UI is noisy to log/copy (ANSI); --headless is easier for paste-back to Mail.
The first is due to human error 😇, the second may be interesting here
So it uses
--headless
, to ask
openhands
for a "review roasted". During this interaction, it reads output from
openhands
, it sends it further instructions if needed, asks for a re-review if needed, and then closes the tmux session.
👀 1