JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4325
  • Score
    100M100P100Q112828F
  • License SEE LICENSE IN LICENSE

Zelari Code โ€” AI Council coding agent CLI. Multi-agent orchestration (Caronte, Nettuno, Gerione, Plutone, Minosse, Lucifero) with slash commands, provider-agnostic LLM streaming, and self-update.

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 Studio

AI Council coding agent CLI โ€” multi-agent orchestration with slash commands, provider-agnostic LLM streaming, and self-update.

Version License Node

๐Ÿ“– 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-code

Requires 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 ~/.bashrc

Verify 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:

  1. Welcome โ€” overview + how to quit.
  2. Provider โ€” pick from grok, minimax, glm, openai-compatible (โ†‘/โ†“ + Enter).
  3. Model โ€” type a model name or accept the default (Enter).
  4. API key โ€” choose env (use GROK_API_KEY etc.), keystore (save locally), or skip (set later via /login).
  5. 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-code

Slash 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 json

See 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+tab toggles 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/-removed per file, refreshed every 4s; auto-hidden on narrow terminals)
  • โฑ๏ธ Execution timer โ€” elapsed time of the in-flight turn in the status line (โฑ 12s), frozen as last 34s when 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.md from .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 โ€” /update slash 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 banners

AgentHarness 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:

  1. Manual blocks (free-form, preserved verbatim across updates) โ€” write anything you want here.
  2. 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 from package.json)
  • decisions โ€” accepted ADRs (newest first, capped)
  • conventions โ€” code conventions observed in source tree
  • build โ€” build/test/lint commands
  • open-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-code

Run tests

npm test

Typecheck

npm run typecheck
  • AnathemaBrain โ€” the Electron desktop GUI that shares the agent runtime + council system with this CLI
  • Zelari Coder originated as the npm run coder script inside AnathemaBrain
  • @zelari/core on npm โ€” reusable agent runtime (MIT)

License

Proprietary ยฉ 2026 N-THEM Studio. See LICENSE.