Skip to content

feat: standalone CLI mode for browser-based Pixel Agents#63

Open
TimpiaAI wants to merge 1 commit intopablodelucca:mainfrom
TimpiaAI:feat/standalone-cli
Open

feat: standalone CLI mode for browser-based Pixel Agents#63
TimpiaAI wants to merge 1 commit intopablodelucca:mainfrom
TimpiaAI:feat/standalone-cli

Conversation

@TimpiaAI
Copy link

@TimpiaAI TimpiaAI commented Mar 2, 2026

Summary

  • Adds a standalone CLI that serves the pixel office in a browser, removing the VS Code requirement
  • Auto-detects running Claude Code sessions by scanning ~/.claude/projects/ for new JSONL files every 2s
  • Replaces the VS Code postMessage bridge with WebSocket, with runtime detection so the VS Code extension continues working unchanged

Usage

npm run build:cli && npm run build:webview && npm start
# or: node dist/cli.js --port 7842

New files

File Purpose
cli/main.ts CLI entry point (--port, auto-open browser, SIGINT)
cli/server.ts HTTP static server + WebSocket on /ws
cli/cliOrchestrator.ts Replaces PixelAgentsViewProvider for CLI mode
cli/sessionScanner.ts Polls ~/.claude/projects/ for new sessions
cli/persistence.ts JSON file storage for seats/settings
cli/vscode-stub.ts Minimal vscode shim for CLI builds

Modified files

  • webview-ui/src/vscodeApi.ts — runtime detection: VS Code API or WebSocket bridge with auto-reconnect
  • webview-ui/src/components/BottomToolbar.tsx — shows hint instead of "+ Agent" in CLI mode
  • webview-ui/src/components/SettingsModal.tsx — browser file handling for export/import layout
  • esbuild.js--cli flag for CLI build target
  • package.jsonws dependency, build:cli/start scripts, bin entry
  • src/types.tsterminalRef now optional (CLI agents have no terminal)

Test plan

  • npm run build — VS Code extension still builds clean
  • node dist/cli.js — server starts, browser opens pixel office
  • Run claude in a separate terminal — character appears in the office
  • Layout editor save/load works
  • Export/import layout works via browser file dialogs
  • Multiple Claude sessions spawn multiple characters

🤖 Generated with Claude Code

Replace the VS Code-only requirement with an optional standalone CLI that
serves the pixel office in a browser and auto-detects running Claude Code
sessions by scanning ~/.claude/projects/ for new JSONL files.

New files:
- cli/main.ts — CLI entry point (--port flag, auto-open browser, SIGINT)
- cli/server.ts — HTTP static server + WebSocket on /ws
- cli/cliOrchestrator.ts — replaces PixelAgentsViewProvider for CLI mode
- cli/sessionScanner.ts — polls ~/.claude/projects/ every 2s for new sessions
- cli/persistence.ts — JSON file storage for seats/settings
- cli/vscode-stub.ts — minimal vscode shim for CLI builds

Modified:
- vscodeApi.ts — runtime detection: VS Code API or WebSocket bridge
- BottomToolbar.tsx — shows hint instead of "+ Agent" in CLI mode
- SettingsModal.tsx — browser file handling for export/import, hides
  "Open Sessions Folder" in CLI mode
- esbuild.js — --cli flag builds cli/main.ts → dist/cli.js with vscode alias
- package.json — ws dep, build:cli/start scripts, bin entry
- types.ts — terminalRef now optional (CLI agents have no terminal)

Usage: npm run build:cli && npm run build:webview && npm start

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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