An agentic terminal REPL and single-process engine built for energy systems research and governed software development. nehanda-cli connects to local and cloud models (Ollama, LM Studio, OpenRouter, Anthropic Claude, ZhipuAI, OpenAI-compatible APIs), normalizes multi-OEM energy telemetry through the ODSE protocol, and enforces a deterministic, verifiable SDLC across the entire research-to-production lifecycle.
Every turn, tool call, phase transition, and safety check is persisted in a local, queryable SQLite database you own.
📖 Full Documentation & Architectural Reference: For exhaustive guides on Jev-Mem, Laya System-1, ODSE energy normalization, MCP servers, sandboxing, and schema contracts, visit the official documentation portal: 👉 https://code.asoba.co/nehanda-cli
- Node.js:
v22.0.0or higher - Python:
3.10or higher (powers the Laya System-1 control plane) - SQLite: Local SQLite runtime support
Choose your preferred installation method:
Global npm install (Recommended):
npm install -g @asobacloud/nehandaDuring installation, npm automatically provisions a dedicated Python virtual environment and downloads the Laya checkpoint (~808 MB) once — subsequent startups are instant.
Single-line curl installer:
curl -fsSL https://asoba.co/releases/install.sh | shThe installer downloads nehanda-cli-latest.tar.gz and automatically validates its SHA-256 digest against SHA256SUMS before unpacking into ~/.nehanda. Prebuilt distribution artifacts (.tar.gz, .bin, .dmg) and cryptographic checksums are hosted at:
👉 https://asoba.co/releases/SHA256SUMS
From source:
git clone https://github.com/AsobaCloud/nehanda-cli.git
cd nehanda-cli
npm installLaunch the REPL:
nehanda
# or use the bundled aliases: ona, ona-codeNehanda is fully model-agnostic. Bring your own keys for cloud providers or connect directly to local inference backends. Run the interactive /model wizard:
❯ /model
◆ Which provider?
│ ● OpenRouter
└
◆ API key
│ sk-or-v1-… (input masked)
└
◆ API host
│ https://openrouter.ai/api/v1
└
Fetching models from provider…
◆ Model
│ ● openai/gpt-4o
└
✓ Provider / host / model saved — session active
Quick configuration shortcuts:
/key openrouter sk-or-v1-...— save provider API key and immediately discover models./key zhipu sk-zai-...— configure ZhipuAI (GLM) backend./config— view current provider, active model, endpoint latency, and masked key status.- Local models (Ollama, LM Studio): select local provider in
/model, accept default host (http://localhost:11434), and select from your downloaded models.
Nehanda enforces an 11-phase governed development lifecycle that ensures every code change is backed by an issue, proven with behavioral tests, and validated through safety checkers before commit:
Here is how you complete a full governed cycle in 5 minutes:
-
Start with a task (
idle → explore): Type your requirement or bug description:❯ Fix: energy-huawei tool fails when inverter state is missing run_stateNehanda initiates graph-first retrieval, reads target code with duplicate caching, and inspects repository architecture.
-
Diagnose with evidence (
diagnose): Nehanda evaluates observed vs. expected behavior with dual citations (code symbol + doc contract), identifying the root cause without speculative guesses. -
Track local issue (
create_issue): Nehanda creates a structured local issue artifact in.issues/capturing the diagnosis, root cause, and concrete acceptance criteria. -
Author behavioral tests first (
create_tests): In strict adherence to TDD, behavioral tests (*_behavioral.pyor*.mjs) are authored and executed against current code. They must fail (RED) for the diagnosed defect before proceeding. -
Review & approve technical plan (
planning): Nehanda presents a line-accurate plan specifying exact files, diffs, and risk mitigations. Review and approve the plan (/plan approve) to authorize code modifications. -
Implement & verify GREEN (
implement → verify): Nehanda applies the approved surgical changes and immediately re-executes the regression suite to confirm tests pass (GREEN). -
Pass safety checkers & finalize (
safety → confirm_fix → done): Automated safety checkers (JavaScript syntax/duplicates, Shell script hazards, Python bandit/lint) run alongside production branch coverage checks ($\ge 70%$ ). Once confirmed, Nehanda creates a clean Git commit referencing the issue (fix: description (#issue)).
For detailed architectural references, configuration manuals, and API contracts, explore the official documentation:
- 🌐 Documentation Home
- 🧠 Jev-Mem System-1 & Laya: 421M non-autoregressive decision model, multi-relational memory graph, and pinned domain invariants.
- ⚡ ODSE Energy Normalization: Automatic OEM fingerprinting (Huawei, Enphase, SolarEdge, Sungrow, SMA) and SCADA table formatting.
- 🛡️ OS-Primitives Sandboxing: Zero-container isolated execution using macOS Seatbelt (
sandbox-exec) and Linux Bubblewrap (bwrap). - 🔌 MCP Servers & Declarative Tools: Zero-code tool registry (
lib/tools/),mcp.jsonclient configuration, and JupyterLab connectivity. - 🗄️ Database Schema & Auditing: SQLite session persistence, transcript auditability, and queryable memory planes.
- 🛠️ Dynamic Tool Rescue (
[TOOL_CALL]): Stop-token bypass for endpoints stripping OpenAI tool schemas.
Run the test suites locally to verify runtime integrity:
npm run acceptance # Run full SDLC acceptance suite
npm run test:unit # Run behavioral unit test suite
npm run test:sandbox # Run OS-primitives sandbox test suite
npm run verify # Verify SDLC hook execution orderPublished under the Apache-2.0 License.