WorkspacesLocal Browser Workspace

Local Browser Workspace

Bahulam can open a browser-based local workspace for a folder or document on your machine. The browser UI gives you the Cloud IDE-style file tree, tabs, preview pane, chat, tool trace, uploads, and approvals while the CLI remains the local bridge.

This is not a hosted microVM. The selected files stay on the machine where you run the CLI. The agent route is:

browser -> localhost service -> CLI-authenticated remote agent -> local tools

The browser and CLI service must run on the same machine. The service binds to 127.0.0.1 and every browser request must include the session token printed in the opened URL.

Open a Workspace

# Open the current folder
bahulam workspace open .
 
# Open a specific folder or file
bahulam workspace open ~/Documents/reports
bahulam workspace open ~/Documents/report.docx
 
# Use a fixed localhost port
bahulam workspace open ~/Documents/reports --port 8787

Short alias:

bahulam local open ~/Documents/reports

Useful options:

OptionDescription
--port <n>Bind a specific localhost port
--kind <name>Override inferred workspace kind: coding, documents, or workspace
--no-openStart the local service without opening a browser
--jsonPrint session JSON and the workspace URL

The opened URL looks like:

http://127.0.0.1:8787/workspace/lws_...?token=...

Use the URL from the current command output. A stale tab or copied URL without the token will return 401 Unauthorized.

What the Browser Shows

The local browser workspace mirrors the Bahulam Cloud IDE interaction model:

  • Bahulam header and workspace controls for Dashboard, Bahulam, Pricing, Subscriptions, Account/Login, workspace state, and panel toggles.
  • File explorer rooted at the selected file or folder grant.
  • Editor tabs for opened files.
  • Preview pane with formatted viewers instead of raw binary dumps.
  • Agent chat for natural follow-ups and live intervention.
  • Trace tab for tool calls, file events, approvals, and backend relay events.
  • Inline approvals in the chat/tool flow, with approve and deny actions.

When a turn is running, a follow-up typed in chat is sent as a live user intervention. If the active task has already passed its delivery point, the message is queued as the next normal user turn.

Session Resume

Local browser workspace metadata is stored under:

~/.bahulam/local-service/sessions/

Agent transcripts still use the CLI conversation store. When the browser starts, it asks the local relay for previous transcripts that match the same workspace root and shows a chat-session picker. Choose a previous chat to hydrate the message history, or start a new chat for the same folder.

This means the same folder can have multiple chats. They share the same file grant, but history only continues when you explicitly resume that chat.

From the terminal, list recent local browser workspace sessions with:

bahulam workspace list

Terminal bahulam --resume continues CLI conversations. The browser session picker is the local browser equivalent for a selected folder.

File Viewing and Editing

The browser preview is meant for human-readable views of what the agent is working on. Binary files are not shown as raw bytes.

Supported viewers today:

File typeBrowser behavior
Code and textMonaco editor when available, with language detection and line numbers
Markdown and MDXRendered markdown preview; source editing is available
MermaidRendered diagram preview
Draw.ioXML/source preview for now, with agent inspection available
ImagesRendered image preview, maximize, and open-in-new-tab controls
PDFInline PDF preview
CSV and TSVTable preview
JSON, YAML, TOML, INI, XML, HTML, logs, SQL, shellSyntax-aware source preview
Jupyter notebooks (.ipynb)Notebook-formatted cell preview plus source editing
Excel and OpenDocument spreadsheetsWorkbook grid preview using SheetJS
Word and OpenDocument documentsLocal conversion to PDF when LibreOffice is available
PowerPoint and OpenDocument presentationsLocal conversion to PDF when LibreOffice is available

Text-backed files can be saved from the browser preview when the preview is not truncated. Large previews and converted/binary formats are read-only in the browser, but the local agent can still inspect or transform them with tools.

The workspace supports uploads through the chat composer. Uploaded files are written into the selected local workspace and then passed to the agent as local attachments.

Office Conversion

DOCX, DOC, ODT, PPTX, PPT, and ODP previews use LibreOffice locally to create a cached PDF preview. Bahulam searches common soffice locations and these env vars:

VariableDescription
BAHULAM_LIBREOFFICE_PATHPreferred path to the LibreOffice soffice executable
LIBREOFFICE_PATHCompatibility fallback

If the preview says LibreOffice was not found, install LibreOffice or set:

export BAHULAM_LIBREOFFICE_PATH=/Applications/LibreOffice.app/Contents/MacOS/soffice

LibreOffice is open source and can be distributed separately according to its license. The CLI does not currently bundle it; it uses the local installation when present.

Approvals and Auto Mode

The browser uses the same risk-tier approval model as the CLI. Approval requests appear inline in the chat/tool flow, and decisions are sent back through the local relay.

The top bar has an Auto toggle for routine approvals in the browser session. You can also type:

/auto on
/auto off
/auto status

These commands are handled locally by the browser workspace. They do not create a chat bubble and are not sent as agent follow-ups. Full autopilot remains a terminal-only control.

Limits and Knobs

SettingDefaultDescription
BAHULAM_LOCAL_SAVE_MAX_BYTES2 MBMaximum text-backed browser save size
BAHULAM_LOCAL_SAVE_MAX_BODY_BYTESSave cap plus overheadMaximum save request body size
BAHULAM_LOCAL_UPLOAD_MAX_BODY_BYTES140 MBMaximum upload request body size

The local service reads regular Bahulam auth from ~/.bahulam/ and follows TARANG_ENV for backend environment selection, the same as the terminal CLI.

Troubleshooting

Browser shows 401 Unauthorized. Use the URL printed by the running bahulam workspace open process. Restart the command if the tab is stale.

Port is already in use. Pass --port <n> or omit --port to let Bahulam choose a free port.

Office preview cannot convert. Install LibreOffice or set BAHULAM_LIBREOFFICE_PATH.

The browser did not open. Re-run with --json or copy the printed localhost URL from the terminal.