chore(cli): save screenshots to tmp dir when no path provided (#247)

* fix(cli): save screenshots to tmp dir when no path provided

Instead of outputting base64 to stdout (which is not useful for most CLI use cases),
screenshots without a path now save to ~/.agent-browser/tmp/screenshots/ with a
generated filename and return the path.

This makes the behavior more ergonomic for AI agents and CLI users alike.

* cleanup

* cleanup

* just revert the cargo.lock version for now

* refactor: extract getAppDir() from getSocketDir()

* docs: improve screenshot help text consistency
This commit is contained in:
Li Yang
2026-01-26 09:08:39 -06:00
committed by GitHub
parent 12abdbd671
commit e831b07f47
6 changed files with 33 additions and 26 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ agent-browser snapshot # Get accessibility tree with refs
agent-browser click @e2 # Click by ref from snapshot
agent-browser fill @e3 "test@example.com" # Fill by ref
agent-browser get text @e1 # Get text by ref
agent-browser screenshot # Base64 png to stdout
agent-browser screenshot page.png # Save to file
agent-browser screenshot # Save to a temporary directory
agent-browser screenshot page.png # Save to a specific path
agent-browser close`} />
<h2>Traditional selectors</h2>