Skip to content

Web Interface

CodexA ships an optional lightweight web interface that provides a browser-based search UI and REST API on a single port.

Quick Start

bash
codex web
# Opens at http://127.0.0.1:8080

codex web --port 9000 --host 0.0.0.0

No external frameworks — the server uses Python's built-in http.server.

Web UI

The browser interface provides four pages:

PathPageDescription
/SearchSemantic search with live results
/symbolsSymbol BrowserBrowse all extracted symbols
/workspaceProject OverviewLanguage stats, file counts
/vizVisualizationInteractive Mermaid diagrams

The UI uses server-rendered HTML with inline CSS (dark theme) and vanilla JavaScript — no build step required.

REST API

MethodPathDescription
GET/healthServer health and project metadata
GET/api/search?q=&top_k=&threshold=Semantic code search
GET/api/symbols?file=&kind=Symbol table browser
GET/api/deps?file=File dependency graph
GET/api/callgraph?symbol=Call graph edges
GET/api/summaryProject summary
POST/api/askNatural language question
POST/api/analyzeCode validation/explanation

POST /api/ask

json
{
  "question": "How does authentication work?",
  "top_k": 5
}

POST /api/analyze

json
{
  "code": "def hello(): ...",
  "mode": "validate"
}

Visualization

Generate Mermaid diagrams from the CLI or API:

bash
codex viz callgraph               # Function call flowchart
codex viz deps --target main.py   # Dependency graph
codex viz symbols --target auth.py # Class diagram
codex viz workspace               # Project map

Diagram Types

KindDescription
callgraphCaller → callee flowchart
depsFile dependency flowchart
symbolsClass diagram of symbols
workspaceHub-and-spoke project map

Output example:

mermaid
flowchart LR
    main["main"] --> auth["auth"]
    auth["auth"] --> db["db"]

Configuration

bash
codex web [options]

Options:
  --host, -h TEXT     Host to bind (default: 127.0.0.1)
  --port, -p INTEGER  Port to bind (default: 8080)
  --path DIRECTORY    Project root path

Released under the MIT License.