Package Exports
- zelari-code
- zelari-code/dist/cli/main.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (zelari-code) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Zelari Code
-#%=
.*%%%@#:
=%%%%%%%@*
+%%%%%%%%%%#.
+%%%@@@@@@@%@#.
.*%@@@@@@@@@@@@@%-
.#%@@@@@@@@@@@@@@@@-
*%@@@@@@@@@@@@@@@@@%.
:@%%@@@@@@%:+%@@@@@%@=
=@%%@@@@@%.=-+%@%%@*
.=@@%@@@@%.*@*-+@@*.
-*%@@@@@@@@%.*@@@+:#@@#=.
*%%%%%%@@@@@@.*#%#=-:+@@@%
:@%%%%%%@@@@@@.:=.*:*@@@@@@=
*@%%@%%@@@@@@@*%@*:-:%@@@@@%.
:@@@%@@@@@@@@@@@@@@#%@@@@@@@@=
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
Z E L A R I C O D E
N-THEM StudioAI Council coding agent CLI โ multi-agent orchestration with slash commands, provider-agnostic LLM streaming, and self-update.
๐ Guida completa all'uso (IT) โ installazione, TUI, comandi slash, council, skills, workspace, headless, MCP.
Zelari Code is a standalone CLI extracted from AnathemaBrain. It brings the multi-agent council (Caronte, Nettuno, Gerione, Plutone, Minosse, Lucifero) directly into your terminal with a rich TUI (Ink + React), slash command system, and provider-agnostic LLM streaming (OpenAI-compatible, xAI Grok with OAuth, GLM/Z.AI).
Upgrading from โค 0.4.x? See MIGRATION.md โ the internal
src/main/core/,src/agents/,src/shared/,src/types/paths no longer exist. The published core package is@zelari/core(MIT). 9 subpath exports.
Install
npm install -g zelari-code
zelari-codeRequires Node.js โฅ 20.
zelari-code: command not found (Windows)
After npm install -g, the zelari-code command may not be on your PATH. Fix:
PowerShell (run as admin, then restart your terminal):
$npmPrefix = npm config get prefix
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$npmPrefix", "User")Git Bash / WSL:
echo 'export PATH="$(npm config get prefix):$PATH"' >> ~/.bashrc
source ~/.bashrcVerify the fix: where zelari-code (CMD) or which zelari-code (Bash) should print a path.
First Run
The first time you run zelari-code (or whenever your provider config
is missing), the CLI launches a 5-step onboarding wizard instead of
the regular TUI:
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ zelari-code v0.6.0 โ first-time setup โ
โ 1/welcome 2/provider 3/model 4/apikey 5/...โ
โ โ
โ Welcome! Let's get you coding in under 2 min. โ
โ Press [Enter] to continue, [Q] to quit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏThe wizard walks you through:
- Welcome โ overview + how to quit.
- Provider โ pick from
grok,minimax,glm,openai-compatible(โ/โ + Enter). - Model โ type a model name or accept the default (Enter).
- API key โ choose
env(useGROK_API_KEYetc.),keystore(save locally), orskip(set later via/login). - Confirm โ review + Enter to commit.
When you press Enter on confirm, the wizard writes ~/.tmp/zelari-code/provider.json (and keys.json if you chose keystore), shows a brief "โ Setup complete!" banner, then transparently transitions into the regular TUI โ no need to re-launch.
Skipping / re-running
zelari-code --no-wizard # skip wizard even on first run
zelari-code --reset-config # force re-run wizard (clears provider.json)
ZELARI_NO_WIZARD=1 zelari-code # env equivalent of --no-wizard
zelari-code --version # print version + exit (no TUI)
zelari-code --help # print help + exit (no TUI)The wizard re-runs automatically if provider.json is missing on the next launch.
Quick Start
# Set your OpenAI-compatible API key (OpenAI, Together, Groq, custom endpoint, etc.)
export OPENAI_API_KEY=sk-...
# Or use Grok via OAuth (Device Authorization Grant โ RFC 8628)
zelari-code
# Inside the TUI: /login grok
# โ A code + verification URL appears; open the URL, enter the code, authorize.
# Or use GLM/Z.AI
export GLM_API_KEY=...
# Run zelari-code from any directory
zelari-codeSlash Commands
Full reference: docs/GUIDA.md (all flags, examples, skill IDs).
| Command | Description |
|---|---|
/help |
List all commands + loaded skills |
/exit |
Exit the CLI |
/login <provider> [key] |
Set API key; /login grok starts OAuth |
/provider, /provider <id> |
Show / switch LLM provider |
/provider custom <url> |
Self-hosted endpoint (Ollama, LM Studio, โฆ) |
/model <name>, /models |
Set model / list discovered models |
/skill <id> [input] |
Invoke a coding skill (23 built-in + SKILL.md) |
/skill-stats [id] |
Skill invocation stats |
/skill-compare <id1> <id2> |
Compare two skills' stats |
/council <input> |
Run the 6-member council pipeline |
/council-feedback <id> <1-5> |
Rate a council member |
/promote-member <id> |
Promote a council member to a skill |
/sessions, /resume <id>, /new |
Session management |
/branch <name>, /branches, /checkout <name> |
Session branches |
/compact, /clear |
Compact / clear transcript |
/diff [--staged], /undo --yes |
Git diff / revert (destructive) |
/steer <text>, /steer --interrupt <text> |
Queue follow-up during a run |
/workspace โฆ |
.zelari/ artifacts + AGENTS.MD |
/update, /update --yes |
Check / install CLI updates |
TUI: shift+tab toggles agent โ council mode for free-form prompts.
Headless Mode
Run a single task without the TUI (CI/scripts):
zelari-code --headless --task "Explain src/cli/main.ts" --output plain
zelari-code --headless --task "Design a REST API" --council --output jsonSee docs/GUIDA.md for exit codes and all flags.
Self-Update
Zelari Code includes a built-in update mechanism:
# Inside the TUI:
/update # check for updates (prints current vs latest)
/update --yes # apply update (runs npm install -g zelari-code@latest)On startup, the CLI silently checks the npm registry. If a newer version is available, it prints a one-line hint to stderr.
Disable auto-check: ANATHEMA_DEV=1 zelari-code
Features
- ๐ค Multi-agent council โ 6 roles (Caronte, Nettuno, Gerione, Plutone, Minosse, Lucifero) with feedback loops and member promotion
- โงโฅ Agent/council mode switch โ
shift+tabtoggles free-form prompts between the single agent and the full council pipeline (mode shown in the status line) - ๐จ Rich TUI โ Ink + React: native-scrollback chat stream, input bar with status line below it (mode ยท provider ยท model ยท session ยท cwd ยท execution timer)
- ๐๏ธ Live git sidebar โ right-hand panel with the N-THEM emblem and the working-tree changes (
+added/-removedper file, refreshed every 4s; auto-hidden on narrow terminals) - โฑ๏ธ Execution timer โ elapsed time of the in-flight turn in the status line (
โฑ 12s), frozen aslast 34swhen the run completes - ๐ง Provider-agnostic โ OpenAI-compatible APIs (OpenAI, Together, Groq, custom), xAI Grok with OAuth refresh, GLM/Z.AI
- ๐ ๏ธ Built-in tools โ filesystem (read/write/edit), shell (bash), search (grep), web fetch/search
- ๐ 23 coding skills (+ user
SKILL.mdfrom.zelari/skills/,.claude/skills/, โฆ) - ๐ Cross-provider failover โ automatic retry with provider swap on transient errors
- ๐ Metrics + skill history โ fire-and-forget logging to
~/.tmp/zelari-code/ - ๐๏ธ Session management โ JSONL transcripts, resume across restarts, compaction
- ๐ฟ Branch isolation โ session snapshots per branch
- ๐ MCP โ external MCP servers via
.zelari/mcp.json - ๐ Self-update โ
/updateslash command + silent registry check on startup
Architecture
zelari-code (CLI, proprietary)
โโโ src/cli/ # Ink TUI, provider config, workspace, wizard, MCP
โ โโโ components/ # ChatStream, InputBar, Sidebar, StatusBar, โฆ
โ โโโ slashHandlers/ # /provider, /workspace, /update, โฆ
โ โโโ workspace/ # .zelari/ persistence + AGENTS.MD curation
โโโ packages/core/ # @zelari/core (MIT, npm)
โโโ core/ # AgentHarness โ provider-neutral agent loop
โโโ agents/ # Council API, roles, 23 skills, tool schemas
โโโ harness/tools/ # Tool registry + filesystem/shell/search/web
โโโ events/ # BrainEvent contract
โโโ council/ # Run mode, tier bannersAgentHarness takes (model, provider, messages, tools) + a streaming function and yields AsyncIterable<BrainEvent>. The CLI subscribes and renders via eventsToMessages(). See MIGRATION.md for the v0.5+ package boundary.
Environment Variables
| Variable | Description |
|---|---|
OPENAI_API_KEY |
OpenAI API key |
OPENAI_MODEL |
Default model (default: grok-4) |
OPENAI_BASE_URL |
Custom OpenAI-compatible endpoint |
GLM_API_KEY |
GLM/Z.AI API key |
GROK_API_KEY |
xAI Grok API key (alternative to OAuth) |
ANATHEMA_DEV=1 |
Disable silent update check on startup |
ZELARI_NO_WIZARD=1 |
Skip first-run wizard |
ZELARI_COUNCIL_TIER=lite |
Council with 3 members instead of 6 |
ZELARI_MCP=0 |
Disable MCP servers |
ANATHEMA_FAILOVER=0 |
Disable cross-provider failover |
See docs/GUIDA.md for the full list.
Council Workspace
The CLI persists council output (decisions, risks, docs, plan, reviews) into a project-local .zelari/ directory and auto-curates an AGENTS.MD at the project root.
Layout
.zelari/ # auto-gitignored, per-project
โโโ plan.md # phases / tasks / milestones (Markdown + YAML frontmatter)
โโโ risks.md # risk register (live, ordered by severity)
โโโ decisions/ # ADRs (Architecture Decision Records) โ 001-<slug>.md
โโโ reviews/ # Minosse verdict per council run
โโโ docs/ # doc drafts produced by the council
AGENTS.MD # committed at project root, auto-curated from .zelari/Slash commands
| Command | Effect |
|---|---|
/workspace |
List all artifacts + usage hint |
/workspace show plan |
Render .zelari/plan.md |
/workspace show decisions |
List all ADRs (id, status, title) |
/workspace show risks |
Render .zelari/risks.md |
/workspace show agents |
Render AGENTS.MD (project root) |
/workspace show docs |
List .zelari/docs/ drafts |
/workspace sync |
Re-run AGENTS.MD auto-curation (idempotent โ no-op if unchanged) |
/workspace reset --yes |
Delete .zelari/ (destructive โ requires confirmation) |
AGENTS.MD format
AGENTS.MD is partitioned into:
- Manual blocks (free-form, preserved verbatim across updates) โ write anything you want here.
- Auto-managed sections delimited by
<!-- zelari:auto:start section="..." -->/<!-- zelari:auto:end -->markers โ overwritten each sync.
Auto-managed sections:
tech-stackโ languages, frameworks, build tools (derived frompackage.json)decisionsโ accepted ADRs (newest first, capped)conventionsโ code conventions observed in source treebuildโ build/test/lint commandsopen-questionsโ info-level risks + unsolved questions
Set ZELARI_AGENTS_MD=0 to disable AGENTS.MD auto-curation.
Storage layout internals
- Frontmatter: subset YAML (scalars, flow/sequence/block-sequence arrays, flow/block maps) โ no external deps.
- Concurrency: per-key mutex (filesystem writes are serialized per artifact).
- Idempotency: hash comparison โ AGENTS.MD write is skipped when no section changed (clean git diff).
See docs/plans/2026-07-01-council-workspace-cli-stubs.md for the full schema.
Documentation
| Doc | Description |
|---|---|
| docs/GUIDA.md | Guida utente completa (IT) |
| docs/TOOLS.md | Tool builtin, workspace, MCP |
| MIGRATION.md | Upgrade from โค 0.4.x |
| docs/decisions/ | ADRs (monorepo, npm publish, API policy) |
Development
git clone https://github.com/N-THEM-Studio/zelari-code.git
cd zelari-code
npm install
npm run build:cli
npm link
zelari-codeRun tests
npm testTypecheck
npm run typecheckRelated Projects
- AnathemaBrain โ the Electron desktop GUI that shares the agent runtime + council system with this CLI
- Zelari Coder originated as the
npm run coderscript inside AnathemaBrain - @zelari/core on npm โ reusable agent runtime (MIT)
License
Proprietary ยฉ 2026 N-THEM Studio. See LICENSE.