Skip to main content

Module open_file

Module open_file 

Source
Expand description

open_file tool — launch a local file in the user’s default GUI application (browser for HTML, viewer for PDF / image / SVG, etc.).

This is a thin cross-platform wrapper that picks the right opener by inspecting OS + environment variables. The LLM gets one uniform tool to call; the environment-disambiguation logic lives here so the model never has to reason about whether open vs xdg-open vs start is correct for the current host.

Headless / SSH / CI sessions can’t show a window, so the tool refuses with a human-readable reason in those cases — the LLM can repeat it to the user instead of pretending a window opened.

Structs§

OpenFileTool