console

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2026 License: AGPL-3.0

README

Console

A modular, self-hostable control plane for the apps you build — feature flags + status monitoring in one small binary.

Quickstart · Concepts · CLI · HTTP API · Onboarding · Docs


Console is a one-stop control plane for your application: ship features safely behind feature flags, and watch your services with status checks — from a single dashboard, a JSON API, and a CLI. It runs as one static Go binary with an embedded SQLite database, so getting started is ./console serve.

It ships with two ways to get an app set up:

  • Human mode — an interactive wizard walks you through what to monitor and which flags to create.
  • AI-Assisted mode — describe your app in a sentence and an LLM (Claude by default) drafts the plan for you.

Status: early / v0.1. The core engine, API, dashboard, CLI, and onboarding are working and tested. Interfaces may still change before v1.

Why Console

  • One binary, no dependencies. Pure-Go SQLite (no cgo) means a truly static binary you can drop on any host. Point it at Postgres later when you outgrow a single node.
  • Modular by design. Storage, status providers, and LLM providers all sit behind small Go interfaces — swap or extend them without touching the core.
  • API-first. The dashboard is just a client of the same HTTP API your apps and SDKs use.
  • Deterministic flag evaluation. The same (flag, subject) always resolves the same way, with a stable percentage rollout you can reason about.

Screenshots

Overview Flags Status
Overview Flags Status

Quickstart

# 1. Build (needs Go 1.22+)
make build            # or: go build -o console ./cmd/console

# 2. Create a flag and evaluate it for a user
./console flag create new-dashboard -desc "New dashboard UI" -scope beta -rollout 50 -enabled
./console flag eval   new-dashboard -subject user-123 -attr audience=beta

# 3. Add a service to monitor and check it
./console status add api -url https://example.com/health -name "Public API"
./console status check api

# 4. Start the dashboard + API
./console serve       # http://localhost:8080

Concepts

Feature flags

A flag has a scope (the audience it applies to) and a rollout (the % of in-scope subjects who get it). Evaluation is deterministic per subject.

Scope In scope when…
all always
beta / alpha subject attribute audience equals the scope, or attribute beta/alpha == "true"
cohort subject attribute cohort equals the flag's cohort
experiment always in scope; the linked experiment is analysis metadata

Boolean flags resolve to on/off. Multivariate flags carry weighted variants and resolve to one of them, deterministically by weight.

Status

A component is a monitored part of your app (an API, a worker, a database), checked by a named provider. The built-in http provider probes a URL:

  • 2xx (or a configured expect_status) → operational
  • any other HTTP response → degraded
  • connection error / timeout → down

Providers are pluggable. Beyond the built-in http provider, the console-plugin-cloudflare plugin adds a cloudflare-workers provider that reads a Worker's recent invocation analytics (Cloudflare GraphQL API) and maps its error rate to operational/degraded/down — config keys account_id, worker, optional api_token (falls back to CLOUDFLARE_API_TOKEN), window, degraded_pct, down_pct.

A snapshot aggregates the latest check per component into one overall health state (worst-wins; a not-yet-checked component never masks a real outage).

Notifications

Console emits events on meaningful changes — a component going down, degraded, or recovered, and any flag change — and fans them out to notifier plugins. Slack ships as the console-plugin-slack plugin (posts to an Incoming Webhook, no bot token): point CONSOLE_NOTIFY_PLUGINS at it and set CONSOLE_SLACK_WEBHOOK_URL, and you'll get alerts when a monitored service breaks or a flag is toggled. A webhook or email sink is just another notify.Notifier served as a plugin.

CLI

console serve       Start the HTTP server (dashboard + API)
console flag        list | get | create | enable | disable | delete | eval
console status      list | add | check | snapshot | delete
console onboard     Onboard an app (Human or AI-Assisted mode)
console version
# Flags
console flag create checkout-v2 -desc "New checkout" -scope cohort -cohort power_users -rollout 100 -enabled
console flag eval   checkout-v2 -subject u-42 -attr cohort=power_users
console flag disable checkout-v2

# Status
console status add web -url https://example.com -name "Web app"
console status snapshot

HTTP API

Method Path Description
GET /api/health Aggregate health snapshot
GET /api/flags List flags
POST /api/flags Create a flag
GET/PUT/DELETE /api/flags/{key} Get / update / delete a flag
POST /api/flags/{key}/evaluate Evaluate for a subject (body: {"key","attributes":{}})
GET /api/components List components
POST /api/components Create a component
GET/PUT/DELETE /api/components/{key} Get / update / delete a component
POST /api/components/{key}/check Run a check now
curl -X POST localhost:8080/api/flags/new-dashboard/evaluate \
  -d '{"key":"user-123","attributes":{"audience":"beta"}}'
# → {"flag_key":"new-dashboard","enabled":true,"variant":"on","reason":"rollout_included"}

Onboarding (Human + AI-Assisted)

# Human mode — interactive wizard
console onboard

# AI-Assisted mode — Claude drafts the plan (needs the anthropic LLM plugin)
export CONSOLE_LLM_PLUGIN=$PWD/bin/console-plugin-anthropic
export ANTHROPIC_API_KEY=sk-ant-...
console onboard -ai -name "Acme" -desc "A Rails store with a Sidekiq worker and a Postgres DB" \
  -guide acme-setup.md

Both modes produce a plan (components + flags), let you apply it, and can emit a Markdown setup guide.

Configuration

All configuration is via environment variables (CLI flags override per-command):

Core:

Variable Default Purpose
CONSOLE_ADDR :8080 HTTP listen address
CONSOLE_DB console.db SQLite path / DSN ("" for in-memory)

Plugin selection (each points at a console-plugin-* binary; unset = built-in default):

Variable Selects
CONSOLE_STORE_PLUGIN storage backend (e.g. console-plugin-postgres); replaces built-in SQLite
CONSOLE_STATUS_PLUGINS status providers (comma/space list, e.g. console-plugin-cloudflare); http is built-in
CONSOLE_NOTIFY_PLUGINS notifier sinks (comma/space list, e.g. console-plugin-slack)
CONSOLE_LLM_PLUGIN LLM for AI-Assisted onboarding (e.g. console-plugin-anthropic); unset = AI mode off

Read by plugins (inherited from the host environment):

Variable Used by
CONSOLE_SLACK_WEBHOOK_URL console-plugin-slack
CLOUDFLARE_API_TOKEN console-plugin-cloudflare
ANTHROPIC_API_KEY, CONSOLE_MODEL console-plugin-anthropic
Plugins

Console is extended with out-of-process plugins — separate executables the host launches and talks to over gRPC (the Terraform model), so you add a capability by dropping a binary, with no core recompile. All four seams (storage, status, notify, LLM) are plugins; the core ships with sensible built-in defaults (SQLite storage, the http status provider) so it runs with zero plugins.

make build && make plugins                 # ./console + ./bin/console-plugin-*

# Postgres store backend:
export CONSOLE_STORE_PLUGIN=$PWD/bin/console-plugin-postgres
export CONSOLE_DB="postgres://user:pass@host:5432/console?sslmode=require"

# Cloudflare Worker health (status provider):
export CONSOLE_STATUS_PLUGINS=$PWD/bin/console-plugin-cloudflare
export CLOUDFLARE_API_TOKEN=...

# Slack notifications:
export CONSOLE_NOTIFY_PLUGINS=$PWD/bin/console-plugin-slack
export CONSOLE_SLACK_WEBHOOK_URL="https://hooks.slack.com/services/..."

# AI-Assisted onboarding (Anthropic):
export CONSOLE_LLM_PLUGIN=$PWD/bin/console-plugin-anthropic
export ANTHROPIC_API_KEY=sk-ant-...

./console serve

See docs/plugins-architecture.md for the full design.

Architecture

cmd/console/        CLI (serve, flag, status, onboard)
internal/core/      domain types (Flag, Subject, Component, Health)
internal/store/     Store interface + sqlite backend (pluggable)
internal/flags/     flag engine + deterministic evaluation
internal/status/    status engine + http provider (pluggable)
internal/llm/        LLM provider interface + Anthropic (pluggable)
internal/onboard/   Human + AI-Assisted onboarding
internal/server/    HTTP API + server-rendered htmx dashboard
internal/app/       composition root
docs/               documentation site (GitHub Pages)

See docs/architecture.md for the full design.

Documentation

A full docs site lives in docs/ (served via GitHub Pages from docs/index.html):

Development

make build   # build the binary
make test    # run all tests
make vet     # go vet
make fmt     # gofmt

Contributing

Console is built to be extended — new storage backends, status providers, and LLM providers all plug in behind interfaces. See CONTRIBUTING.md.

License

Console is licensed under the GNU AGPL-3.0 © MooseQuest LLC.

The AGPL keeps Console and its network-hosted derivatives open: if you modify Console and run it as a service, you must offer your users the modified source. Contributions are accepted under a Contributor License Agreement so the project can be sustainably maintained and dual-licensed. If the AGPL doesn't fit your use case, a commercial license may be available — open an issue to ask.

Directories

Path Synopsis
cmd
console command
Command console is the Console CLI: a single static binary that serves the dashboard + API, manages feature flags and status components, and runs the onboarding assistant (Human and AI-Assisted modes).
Command console is the Console CLI: a single static binary that serves the dashboard + API, manages feature flags and status components, and runs the onboarding assistant (Human and AI-Assisted modes).
console-plugin-anthropic command
Command console-plugin-anthropic is a Console LLM plugin backed by Anthropic's Claude Messages API, served over gRPC (hashicorp/go-plugin).
Command console-plugin-anthropic is a Console LLM plugin backed by Anthropic's Claude Messages API, served over gRPC (hashicorp/go-plugin).
console-plugin-cloudflare command
Command console-plugin-cloudflare is a Console status-provider plugin that reports the health of Cloudflare Workers from their invocation analytics, served over gRPC (hashicorp/go-plugin).
Command console-plugin-cloudflare is a Console status-provider plugin that reports the health of Cloudflare Workers from their invocation analytics, served over gRPC (hashicorp/go-plugin).
console-plugin-postgres command
Command console-plugin-postgres is a Console storage-backend plugin that serves a Postgres-backed store.Store over gRPC (hashicorp/go-plugin).
Command console-plugin-postgres is a Console storage-backend plugin that serves a Postgres-backed store.Store over gRPC (hashicorp/go-plugin).
console-plugin-slack command
Command console-plugin-slack is a Console notifier plugin that delivers events to Slack via an Incoming Webhook, served over gRPC (hashicorp/go-plugin).
Command console-plugin-slack is a Console notifier plugin that delivers events to Slack via an Incoming Webhook, served over gRPC (hashicorp/go-plugin).
internal
app
Package app is Console's composition root.
Package app is Console's composition root.
config
Package config holds Console's runtime configuration.
Package config holds Console's runtime configuration.
core
Package core defines Console's domain types: the vocabulary shared by every other package.
Package core defines Console's domain types: the vocabulary shared by every other package.
flags
Package flags implements Console's feature-flag evaluation engine.
Package flags implements Console's feature-flag evaluation engine.
llm
Package llm defines the provider seam for AI-Assisted onboarding.
Package llm defines the provider seam for AI-Assisted onboarding.
llm/anthropic
Package anthropic provides an llm.Provider backed by Anthropic's Claude Messages API.
Package anthropic provides an llm.Provider backed by Anthropic's Claude Messages API.
notify
Package notify is Console's alerting seam.
Package notify is Console's alerting seam.
notify/slack
Package slack delivers Console events to a Slack channel via an Incoming Webhook URL.
Package slack delivers Console events to a Slack channel via an Incoming Webhook URL.
onboard
Package onboard implements Console's onboarding subsystem: helping an operator register their application into Console — which components to monitor and which feature flags to create.
Package onboard implements Console's onboarding subsystem: helping an operator register their application into Console — which components to monitor and which feature flags to create.
plugin
Package plugin implements Console's out-of-process plugin system using hashicorp/go-plugin over gRPC.
Package plugin implements Console's out-of-process plugin system using hashicorp/go-plugin over gRPC.
server
Package server is Console's HTTP layer.
Package server is Console's HTTP layer.
status
Package status evaluates the health of monitored components.
Package status evaluates the health of monitored components.
status/cloudflare
Package cloudflare provides Console status providers backed by Cloudflare's APIs.
Package cloudflare provides Console status providers backed by Cloudflare's APIs.
store
Package store defines the persistence seam for Console.
Package store defines the persistence seam for Console.
store/postgres
Package postgres provides a Postgres-backed implementation of store.Store.
Package postgres provides a Postgres-backed implementation of store.Store.
store/sqlite
Package sqlite provides a SQLite-backed implementation of store.Store.
Package sqlite provides a SQLite-backed implementation of store.Store.
web
Package web holds the embedded server-rendered dashboard assets: the HTML templates and the static CSS/JS served alongside them.
Package web holds the embedded server-rendered dashboard assets: the HTML templates and the static CSS/JS served alongside them.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL