OPEN SOURCE · GO · LOCAL LLM AGENT

Konsolai

A local coding agent that lives in your terminal.

It routes every request to one of four intents, plans before it writes, and refuses what it should never run, on any OpenAI-compatible model you host yourself.

$konsolai ""
Konsolai welcome screen with models, session and a streamed answer
0
intents
0
slash commands
0
test files
0
welcome goldens

01 / THE TERMINAL

SEE IT RUN

Real captures from a session: the welcome screen, a build turn that recovers from a failed compile, the command palette and the theme picker.

Six palettes. Try one.

/theme opens a live picker in the REPL. These are the exact dark-mode colours from Konsolai's theme package, and this page follows whichever one you pick.

kns · /theme amber

now: /set theme

✓ applied now

02 / ROUTING

ONE REQUEST, FOUR INTENTS

A small, fast model classifies the request before anything runs. The intent decides which tools exist for the turn and whether a plan has to be approved first.

kns · router

› what is a goroutine

router → answer

◆ answer

A goroutine is a function running concurrently with the rest

of the program, scheduled by the Go runtime onto OS threads.

0.1s · 619 → 84 tok

tools

none

plan

never

03 / SAFETY MODEL

IT ASKS BEFORE IT TOUCHES

Build turns are gated on an approved plan. Anything outside that plan is confirmed again, some commands are never run at all, and secrets are masked before they reach the database.

Plan gate

Writes must be in the approved plan.

  1. ▸ propose_plan

    required before any write

  2. [y]es [n]o [a]ll [q]uit → y

    you approve once

  3. ▸ write src/index.ts (in plan)

    runs, no second prompt

  4. ▸ run: npm run build (in plan)

    matches safety.MatchPlan

  5. ⚠ outside plan: npx tsc --version

    asks again

Denylist

Refused outright, even under --yes.

sudorm -rf ~mkfswipefsdd of=/dev/sdacurl … | sh:(){ :|:& };:shutdown

✗ refused · safety.extra_command_deny adds more

Redaction

Masked before a message is stored.

OPENAI_API_KEYraw

sk-proj-7f3Kq9xL2mVb8nRt

GITHUB_TOKENraw

ghp_Xr72LmQa9vBn3kTz0pWd

DATABASE_URLraw

postgres://app:hunter2@db

finish

sudo, doas, su and pkexec are refused. The model lists them for you instead: Run these yourself:

04 / UNDER THE HOOD

ARCHITECTURE

One Go binary, about 38k lines outside tests. Packages are layered so the parts that talk to the terminal, the model and the database stay apart.

TTY

uibannerreplshellmodecommandscmd/konsolai

Turn

intentturnagenttools

Persistence

storememoryragwelcome

Leaves

ui/themeconfigllmsafetyredactreposysctxdiffdocrenderembedclip

RULES THAT MUST NOT REGRESS

  • ✓tools, agent and ui never import pgx
  • ✓agent never imports memory or store
  • ✓the first store error disables memory for the process
  • ✓UI checks run on a real PTY, not a pipe

STACK

GoPostgreSQLpgvectorpgxTEI embeddingsRerankervLLM · llama.cpp · OllamagoldmarkHeadless ChromiumMermaidDocker
/help/copy/history/show/resume/new/clear/cd/cmd/yes/trace/think/model/compact/undo/diff/run/output/status/config/set/models/theme/index/recall/remember/facts/forget/prune/stats/doctor/save/pdf/explain/help/copy/history/show/resume/new/clear/cd/cmd/yes/trace/think/model/compact/undo/diff/run/output/status/config/set/models/theme/index/recall/remember/facts/forget/prune/stats/doctor/save/pdf/explain
/explain/pdf/save/doctor/stats/prune/forget/facts/remember/recall/index/theme/models/set/config/status/output/run/diff/undo/compact/model/think/trace/yes/cmd/cd/clear/new/resume/show/history/copy/help/explain/pdf/save/doctor/stats/prune/forget/facts/remember/recall/index/theme/models/set/config/status/output/run/diff/undo/compact/model/think/trace/yes/cmd/cd/clear/new/resume/show/history/copy/help

05 / TRY IT

RUN IT LOCALLY

Point it at vLLM, llama.cpp or Ollama. Add Postgres with pgvector when you want memory and RAG.

$go install github.com/SniksaX/Konsolai/cmd/konsolai@latest