Skip to content

Build your own extensions

viewbus runs a small HTTP API on your machine while it's open. Read the resources it has indexed and drive the app from your own tools — no SDK, just HTTP.

Launcher commands

Search your queues from Raycast, Alfred, or PowerToys Run and jump straight to one.

Editor & CLI scripts

Wire viewbus into a VS Code task or a shell script in a few lines.

Status widgets

Ping it from a taskbar or menu-bar script to show if viewbus is running.

Looking to give an AI assistant access instead? That's the built-in MCP server, which is a separate interface from this one.

How it works

  1. 1

    Discover

    On launch viewbus writes a discovery file with the port and a fresh token.

    Windows
    %APPDATA%\viewbus\local-api.json
    macOS
    ~/Library/Application Support/viewbus/local-api.json
    Linux
    ~/.local/share/viewbus/local-api.json
  2. 2

    Authenticate

    Send the token as Authorization: Bearer <token>. The server binds 127.0.0.1, requires that token, and rejects any request carrying an Origin header — so it's reachable only from your machine, never the network or a web page.

  3. 3

    Call

    Base URL is http://127.0.0.1:<port>. Each endpoint is listed below.

Full example cURL · TypeScript · Python · C# · Rust
# read the discovery file (Windows path shown)
PORT=$(jq -r .port "$APPDATA/viewbus/local-api.json")
TOKEN=$(jq -r .token "$APPDATA/viewbus/local-api.json")
BASE="http://127.0.0.1:$PORT"
AUTH="Authorization: Bearer $TOKEN"

curl -H "$AUTH" "$BASE/v1/status"

curl -H "$AUTH" "$BASE/v1/search?q=orders&limit=10"

curl -X POST -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"id":"/subscriptions/…/queues/orders-dead"}' \
  "$BASE/v1/focus"

Endpoints

GET /v1/status # Check the app is running and read its version.
curl -H "$AUTH" "$BASE/v1/status"
Response · 200
{ "app": "viewbus", "apiVersion": 1, "version": "0.8.x", "hasSelection": true }

hasSelection is true only when a tenant and subscription are both selected. Search works without it.

POST /v1/focus # Bring viewbus to the front, on a specific resource.
id
required · body field — an id from /v1/search
curl -X POST -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"id":"/subscriptions/…/queues/orders-dead"}' \
  "$BASE/v1/focus"
Response · 200
{ "ok": true }

An unknown id returns 404.

Errors

Every error uses one shape; the HTTP status matches the code.

Error
{ "error": { "code": "unauthorized", "message": "invalid token" } }
codestatusmeaning
bad_request400Missing q, malformed body
unauthorized401Missing or wrong bearer token
forbidden403Origin header present, or non-loopback Host
not_found404Unknown endpoint, or a focus id that doesn't exist
internal500Unexpected server-side error

Enabled by default — disable with localApi.enabled: false in settings.json, then restart.

/v1 is stable: fields are only added, never removed or renamed. Breaking changes ship under /v2.