abstractcore-console
A keyboard-first terminal console for configuring
AbstractCore — the
abstractcore --config wizard's job with browse-anywhere freedom,
honest live state, and validation. Rendered by
AbstractTUI.
It also browses, downloads and deletes local models and installs local engines (Ollama, LM Studio, MLX, llama.cpp), and it is a Rust library: the same Models and Engines screens run inside the AbstractGateway console.
Install
Run
The console reads ~/.abstractcore/config/abstractcore.json directly
(honoring ABSTRACTCORE_CONFIG_FILE / ABSTRACTCORE_CONFIG_DIR) and
shells out to the abstractcore CLI for the derived views (routes
coverage, redacted profiles). The header always names the file being
shown and the CLI being used.
How the console finds abstractcore
The first match wins:
$ABSTRACTCORE_CLI: an explicit path (or name) to the binary. It is used as given; a wrong value fails loudly, naming it.$ABSTRACTCORE_BINstill works as a legacy alias.abstractcoreonPATH.~/.local/bin/abstractcore: the shimuv tool install abstractcorecreates, which is often not onPATHin a fresh shell../.venv/bin/abstractcore, relative to the directory you start the console from (a project virtualenv).
If none is found, the config mirror still works, and every screen that
needs the CLI says so and names $ABSTRACTCORE_CLI as the fix.
What it does
- Browse (digits 1-9, then 0 for the tenth screen;
←/→orCtrl+P/Ctrl+Nfor the previous / next screen, wrapping — a text field keeps the arrows for its caret, and a dialog keeps every key): every section's honest state — set / default / broken, secrets fingerprinted, unknown keys flagged. - Providers (3): ONE list, the AbstractGateway console's columns —
provider | family | base URL | API key | models | enabled | origin— with every stored endpoint profile inline as itsendpoint:<id>row.aadds a connection (as many as you need; it lands in this file'sprovider_profiles),econfigures the selected row,ddeletes a connection,mlists its models,tprobes it,kedits a builtin provider's key.originsays where a row comes from:config·env·auto(a local server that answered) ·registry(known, nothing configured yet). - Edit (Enter/e, x clears): typed editors per field; coupled
fields go through the
abstractcoreCLI setters; CLI-less fields through unknown-key-preserving direct writes. Every write is verified against a fresh re-read before it is reported done. - Wizard (w; the default on a machine with no config): a guided walk over the CLI wizard's 8 phases. Browse stays free.
- Test (t on Providers/Routes; g anywhere): live model discovery
per provider (
config test-provider), route-model membership checks, and one cheap generation over YOUR configured default route (abstractcore-chat --prompt). Verdicts are honest three-state: proven / NOT PROVEN / failed — the CLI'sok:true, count:0answer for a dead server is never presented as success (a TCP reachability check on known local endpoints names the actual cause). Evidence lands on Review (8). Note:gtests the GLOBAL default (default_models.global_*— the library's fallback route);abstractcore-chat's own CLI default isapp_defaults.cli, a different slot. - Models (9): the model catalog fitted to this machine (host
profile on top; fit
fits / tight / too large / partial offload / needs GPU limit / unknown; weightsinstalled / not downloaded / unknown / remote). A model that fits once macOS lets the GPU use more memory shows the exactsudo sysctl iogpu.wired_limit_mb=…command on its detail line.wdownloads the selected artifact with live progress (several at once),ddeletes after a confirm that names what blocks it (a loaded model, a cache another engine shares — forcing is a separate answer),/filters,tpicks the model type (text, thinking, tools, vision, audio, embedding, voice, image, video — the web console's chips),fshows only what fits,epicks the engine,hsearches Hugging Face,umakes an installed text model the default text model,vcycles catalog → installed → downloads,ccancels a download (asks first). - Engines (0): which engines are installed and running.
iinstalls the selected one after a confirm that shows the exact command, the host it runs on and whether it needs sudo/UAC (or answers with a dry run);oopens the vendor's download page (LM Studio is a desktop app);rprobes the local servers. An engine this computer cannot run says why in plain words (vLLM without an NVIDIA GPU readsremote only: use a vLLM server on another machine). - Routes: a configured route reads
engine not installedwhen this computer can run it but its engine is missing here; the detail line gives the exact install command.
o never launches a browser on a machine without a display — an SSH
session, or Linux/BSD with neither DISPLAY nor WAYLAND_DISPLAY. The
notice prints the link for you to open on your own computer instead, and
library hosts receive OpenError::NoDisplay from ScreensCtx::open_url
(see display_available / display_from).
Every Models/Engines action is an abstractcore CLI call you can run
yourself — the job strip shows its CLI equivalent
(abstractcore models download ollama qwen3:8b,
abstractcore engines install ollama).
Safety posture
- Never writes on open; a corrupt config file is a hard stop that
points at the timestamped backups, never a silent reset. A file that
parses here but that PYTHON's loader refuses (e.g. a profile row
with an unknown field) is flagged loudly — both from the mirror's
own fold and from the CLI's
#FALLBACKstderr. - Writes refuse structurally: corrupt/unreadable files refuse all writes; Python-refused files refuse CLI setters (which would reset the file) while direct preserving writes stay allowed; a drift guard (mtime+ino+size) refuses when another writer landed in between.
- Secrets render as
set · fp <sha256[:8]>— the same fingerprint convention the Python side uses. Values are never logged or echoed. - Tests only reach endpoints the config names (profile base_url) or a provider's documented LOCAL default (ollama/lmstudio); never https, never cloud endpoints — those get CLI-only verdicts.
Use as a library
The Models and Engines screens are backend-agnostic: they talk to a
ConsoleTransport, which returns the JSON documents of the shared
contracts (host_profile_v1, engines_status_v1, model_catalog_v1,
models_installed_v1, host_job_v1). This binary uses CliTransport
(abstractcore … --json subprocesses); the gateway console implements
the trait over its HTTP client and mounts the same screens:
[]
= "0.4"
= "0.3.6" # the same engine version: one reactive runtime
use Arc;
use ;
use ;
use Value;
// In your mount closure (UI thread), once. `access` is YOUR signal: keep
// it current from the signed-in principal (Access::Admin, or
// Access::ReadOnly("signed in as ana, not an admin")); the admin-only
// verbs (w d u c on Models, i s a c on Engines) follow it.
let access = cx.signal;
let sctx = new;
// …then as two more PageHost pages:
// .page("catalog", "Models", move |pcx| screens::catalog(pcx, &sctx_a))
// .page("engines", "Engines", move |pcx| screens::engines(pcx, &sctx_b))
Each screen loads its data on first entry and binds its own keys
(w d / t f e v r c h u on Models, i o r c s a y on Engines);
screens::catalog::hints(caps, &access) and
screens::engines::hints(caps, &access) are the footer pairs to show
(a verb the backend lacks says "not here", an admin-only verb for a
read-only person says "admin only"). Full API:
https://docs.rs/abstractcore-console.
Layout
src/
lib.rs arg parsing, headless guard, mount, worker spawn, boot load
schema.rs the DISPLAY schema (sections/fields/defaults/validation) — never a write schema
config.rs config path resolution, parse, fold to a redacted display model
cli.rs the abstractcore(-chat) CLI subprocess client + error taxonomy
store.rs signals per domain; Loadable<T> honest states
worker.rs ONE background thread owning all file/subprocess/socket I/O
writes.rs the write vocabulary: specs, verbs, verified expectations
probes.rs the test vocabulary: probe specs + pure verdict folds
transport.rs ConsoleTransport + TransportError (the Models/Engines seam)
transport/cli.rs CliTransport: abstractcore … --json, child jobs
screens/ the shared Models/Engines screens (library): store, worker, confirms
ui/ one module per screen over a PageHost shell
tests/
headless_ui.rs CaptureTerm+Driver harness; fixtures; the chrome matrix;
Models/Engines over a MockTransport
cli_transport.rs CliTransport against a fake `abstractcore` on PATH
fixtures/ contract A–E JSON documents
Test
See LAUNCH-PROMPT.md for the full charter and
docs/config-surface-inventory.md for the config surface this console
mirrors.