Skip to content

Write screenshots where the CLI was told to (#119) - #286

Merged
hugs merged 1 commit into
mainfrom
fix/119-screenshot-output-path
Aug 3, 2026
Merged

Write screenshots where the CLI was told to (#119)#286
hugs merged 1 commit into
mainfrom
fix/119-screenshot-output-path

Conversation

@hugs

@hugs hugs commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

vibium screenshot reduced -o to its basename and joined it with the screenshot dir, so any path you typed was discarded:

vibium screenshot -o /tmp/abs-shot.png
# before: Screenshot saved to /Users/you/Pictures/Vibium/abs-shot.png
# after:  Screenshot saved to /tmp/abs-shot.png

Why it could not just be fixed in the daemon

The daemon is a separate long-lived process started from some other directory, so it cannot resolve a relative path against the user's shell. The CLI resolves -o itself and sends an absolute path; the daemon writes an absolute path as given and creates missing parent directories. Same pattern storage restore already uses.

The default changed too, on purpose

vibium screenshot with no -o now writes ./screenshot.png instead of ~/Pictures/Vibium/screenshot.png.

The old default predates the CLI. It was designed for MCP, where the caller has no working directory the user can see, so a fixed findable location is the only sensible answer. A developer typing into a terminal does have one, and expects it to be used.

MCP behavior is unchanged. A bare filename still lands in the screenshot dir, and MCP only ever sends bare filenames, so ~/Pictures/Vibium remains the agent default and --screenshot-dir still works.

Verified

vibium screenshot                  ->  ./screenshot.png
vibium screenshot -o shot.png      ->  ./shot.png
vibium screenshot -o sub/deep.png  ->  ./sub/deep.png   (sub/ created)
vibium screenshot -o /tmp/x.png    ->  /tmp/x.png

New regression test in tests/cli/navigation.test.js fails against the pre-fix binary and passes after. Full make test passes.

Docs

  • docs/how-to-guides/screenshots.md (new) covers CLI paths, capture options, and the MCP default.
  • docs/tutorials/getting-started-mcp.md now says why the MCP default differs from the CLI.

Supersedes #119, which reported this and fixed the daemon half.

vibium screenshot reduced -o to its basename and joined it with the
screenshot dir, so every path the user typed was discarded: -o /tmp/x.png
landed in ~/Pictures/Vibium/x.png.

The daemon is a separate long-lived process, so it cannot resolve a
relative path against the user's shell. The CLI now resolves -o itself
and sends an absolute path; the daemon writes an absolute path as given
and creates any missing parent directories.

A bare filename still goes to the screenshot dir, which keeps the MCP
default (~/Pictures/Vibium) intact. That default exists because an agent
has no working directory the user can see; a developer typing into a
terminal does, so the CLI now writes there.

Adds docs/how-to-guides/screenshots.md.
@hugs
hugs merged commit c349fcd into main Aug 3, 2026
1 check passed
@hugs
hugs deleted the fix/119-screenshot-output-path branch August 3, 2026 15:04
hugs added a commit that referenced this pull request Aug 4, 2026
vibium pdf -o and vibium record stop -o hand the path to the daemon, whose
working directory is not the caller's, so a relative path landed wherever
the daemon happened to be started while the command reported success.

#286 fixed this for screenshot and stopped there. These are the same bug in
the two sibling commands. storage -o was already fine: it writes the file
client-side.

pdf also now creates missing parent directories, which screenshot and
record already did.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant