Skip to content

Desktop Base

Not part of the hosted product

G6 is hosted: you reach it over MCP by pointing Claude Code (or any MCP client) at the server. There is no desktop app to install and no self-hosted deployment. This page documents a surface that exists in the repository but is not part of the hosted product today — it is kept as engineering reference, not as instructions for customers.

The Desktop base bundles the G6 TUI, browser GUI, FastMCP server and license activation into a single binary entry point.


Overview

The desktop binary (g6) wraps the CLI TUI, browser GUI, and MCP server with production features: Stripe-based licensing and diagnostics. It is distributed as a wheel (g6_desktop-1.0.0.whl) or standalone binary.

# Launch the browser GUI (default mode)
g6 --gui

# Launch the TUI (same interface as g6 --tui)
g6 --tui

# Start the embedded MCP server (262 tools)
g6 --mcp

# Start the REST API server locally (binds 127.0.0.1:8010)
g6 --rest

# Activate a license
g6 --activate

In a development source checkout, the same launcher is available as a module — e.g. python -m mvp.desktop --gui (see Installation → From source).

Modes

Flag Mode Description
--gui GUI Browser-based desktop workbench (starts API sidecar + static server)
--tui TUI Full 11-tab Textual interface (identical to g6 --tui)
--mcp MCP Server FastMCP server with 262 tools across 15 categories
--gui-api GUI API FastAPI backend only (no frontend or browser)
--rest REST API Local REST server on 127.0.0.1:8010 (loopback dev mode; --host/--port to override)
--activate Activation Interactive Stripe-based license activation
--diagnostics Diagnostics Create a diagnostic bundle

Exactly one mode flag is required.

Relationship to other bases

The desktop binary reuses existing bases rather than reimplementing them:

  • --gui starts bases/mvp/gui_api/ (FastAPI sidecar) + serves projects/g6_gui/out/ (static export) + opens browser
  • --tui imports G6App from bases/mvp/cli/ -- the same 11-tab TUI documented in CLI Base
  • --mcp imports create_server() from bases/mvp/mcp/ -- the same FastMCP server documented in MCP Base
  • --gui-api starts the FastAPI backend only (for custom frontend setups)
  • --rest runs main() from bases/mvp/rest/ -- the same FastAPI server documented in REST Base, bound to loopback by default
  • --activate and --diagnostics are desktop-only features
g6_desktop
  ├── --gui      ──>  bases/mvp/gui_api/ + projects/g6_gui/out/ (browser)
  ├── --tui      ──>  bases/mvp/cli/  (G6App)
  ├── --mcp      ──>  bases/mvp/mcp/  (FastMCP server)
  ├── --gui-api  ──>  bases/mvp/gui_api/  (FastAPI sidecar only)
  ├── --rest     ──>  bases/mvp/rest/  (FastAPI REST server, loopback)
  ├── --activate    (desktop only)
  └── --diagnostics (desktop only)

GUI mode

When started with --gui, the desktop launcher:

  1. Selects available ports for the API (default 8001) and frontend (default 3002)
  2. Generates a session token via secrets.token_urlsafe(32)
  3. Starts the GUI API as a subprocess with the token
  4. Starts a static file server for the GUI frontend export
  5. Opens the browser with the token appended as a query parameter
Flag Description
--host API bind host (default: 127.0.0.1)
--port API bind port (default: 8001)
--frontend-port Static server port (default: 3002)
--frontend-url Use existing frontend URL (skip static server)
--no-browser Don't auto-open browser

Port fallbacks: if the preferred port is busy, the launcher tries alternatives (8001-8003, 8080, 3001 for API; 3002-3003, 3010-3012 for frontend).

Desktop mode also loads local runtime settings from ~/.g6/.env. The GUI Settings view can save or clear OPENROUTER_API_KEY there, so non-technical users can add their own OpenRouter key without editing shell profiles or project .env files.

See GUI documentation for full details on the browser workbench.

License activation

The --activate flow:

  1. Prompts for API key and passphrase
  2. Collects hardware fingerprint (CPU, hostname, MAC, OS)
  3. Derives an encryption key via PBKDF2 (100k iterations)
  4. Validates with the licensing server
  5. Encrypts and persists the license locally (~/.g6/license.enc)
g6 --activate
# Enter API key: g6_live_...
# Enter passphrase: ********
# License activated: premium tier, expires 2027-04-22

Tiers control which MCP tools are available when running in --mcp mode (see MCP middleware).

Installation

pip install dist/g6_desktop-1.0.0.whl
g6 --tui
# Windows PowerShell
$env:PYTHONPATH="components;bases"; python -m mvp.desktop --tui

# Bash
PYTHONPATH="components;bases" python -m mvp.desktop --tui

Extra dependencies

Beyond the core CLI, the desktop base requires:

Package Purpose
stripe Payment processing for license activation
cryptography License encryption (Fernet + PBKDF2)
apsw SQLite bindings for local license storage
pyjwt JWT token validation

These are included in the g6_desktop wheel but must be installed separately when running from source.

Source files

File Purpose
bases/mvp/desktop/__init__.py Package marker
bases/mvp/desktop/__main__.py python -m mvp.desktop support
bases/mvp/desktop/main.py Entry point, mode dispatch, GUI launcher
bases/mvp/desktop/activation.py License activation flow
bases/mvp/desktop/diagnostics.py Health check and diagnostic bundle

See also