Choose your provider
niral di setupInteractive provider setup. Saves settings and the credential variable name, never the key. No API request is made.
DEVELOPER INTELLIGENCE / BUILT INTO NIRAL
Your project. Your model.
Your call.
Developer Intelligence in your terminal. Understand a codebase, make reviewed changes, and start a Niral app with your chosen provider. Every workspace tool waits for your approval.
01 / THE WORKFLOW
A bounded tool loop connects your selected model to a small set of workspace operations. Approval is required for reads, not just writes.
An explicit prompt, workspace root, provider and model.
A structured tool call with validated arguments.
Review each call. Only y approves; Enter denies.
Check paths and hashes, back up originals, then write.
Settings reference a credential variable. Originals are backed up before approved writes. No local transcript is written.
Approved file content can reach your provider. Its retention policy and charges apply. Local tooling does not mean local inference.
02 / GET STARTED
Use your existing Niral installation and Node 22 or newer. No separate DI package or Niral Cloud account is required.
Run setup. Choose OpenAI, Claude, Azure OpenAI or Custom, then enter your exact model or deployment.
Enter the environment variable name, never the key. Supply its value privately through your terminal or credential manager. DI does not load .env files.
Status runs offline. Begin with a read-only question to understand the project and review each requested read.
Configure the provider
niral di setupCheck settings without an API request
niral di statusAsk about an existing app
niral di ask "Explain this project's routes" --root ./myapp --read-onlyAlready installed through npm? The existing launcher also accepts npx niral di setup.
https://api.openai.com/v1The preset supplies the protocol, API base and authentication. You choose the model and credential variable.
No endpoint probing, model fallback or automatic provisioning. Compatible endpoints must support the chosen protocol and function calling. Amazon Bedrock is not currently supported.
03 / COMMAND REFERENCE
Five commands, with workspace, read-only and prompt-only modes. DI never starts a server, installs dependencies or deploys your app.
niral di setupInteractive provider setup. Saves settings and the credential variable name, never the key. No API request is made.
niral di statusOffline configuration and credential-availability checks, without printing the credential.
niral di ask "Explain this project's routes" --root ./myapp --read-onlyOne bounded run with listing and reading tools only. Every tool still requires your approval.
niral di ask "Add a contact page" --root ./myappInspect files, review proposed full contents, and approve individual writes. Existing files are checked for changes before replacement.
niral di chat --root ./myappRetains up to eight user/assistant exchanges and 32 KiB of text context in memory. /clear resets context; /exit leaves the session.
niral di new myblog "Customize the home page" --template blogConfirms before scaffolding a new or empty directory. Templates: minimal, blog and dashboard. The scaffold survives a later model failure.
niral di ask "Explain server blocks" --no-toolsSends only your explicit prompt. This is the supported noninteractive mode; no workspace content is attached automatically.
04 / ACCESS AND CONTROL
There is no auto-approve option, shell execution or delete tool. Every requested operation is validated, authorized and executed sequentially.
list_filesOne visible directory at a time. No recursive workspace scan.
read_fileUTF-8 source/text content and its SHA-256 hash, only after approval.
write_fileFull-content create or replace. Existing files require the current read hash.
Paths outside the workspace, dot paths, conventional data, dependency, build, backup and secret paths, symlinks, hard-linked reads/writes, binary files and unsupported extensions. NIRAL_HOME is excluded too.
Supported: .niral, .js, .mjs, .cjs, .ts, .jsx, .tsx, .css, .html, .md, .json, .txt and .sql.
Gitignore rules are not interpreted. Secrets embedded in ordinary source can still be disclosed through an approved read. Path and hash checks are guardrails, not an OS sandbox or a prompt-injection defense.
Approval shows full replacement content, not a computed diff. Cancellation stops pending work; it does not undo completed edits.
05 / THE DETAILS
Settings live in NIRAL_HOME/di.json, defaulting to ~/.niral/di.json, with mode 0600. Only provider settings and the credential variable name are stored. App-side NIRAL_AI_* settings are separate.
Before a write, original content, absolute path and hash are saved under NIRAL_HOME/di-backups/<run-id>/. New files have a null original. Backups are retained without pruning; restore manually after reviewing subsequent changes.
Yes. Supply explicit settings. Replace these endpoint and model placeholders with your provider's exact values; the credential itself stays out of arguments.
niral di setup --protocol responses --base-url https://your-provider.example/v1 --model YOUR_EXACT_MODEL --auth bearer --key-env NIRAL_DI_API_KEYThe API base excludes the final /responses, /chat/completions or /messages operation path and query parameters. Use --api-version VERSION when needed. Existing configuration requires --replace. Ctrl-C or end-of-input cancels interactive setup without saving.
No. Review changes, then run niral check, niral test and niral build yourself. There is no automatic test run, dependency installation, rollback, deployment or retry. A failed or cancelled run may already have completed approved edits.
Responses are completed, non-streaming responses. Chat keeps a bounded text history in memory; file results are not automatically retained across runs. No local transcript is written. Provider retention and charges follow your chosen provider's policies; Responses store:false is not a general retention guarantee.
Deterministic mocked tests cover protocols, approvals, filesystem boundaries and the CLI. A separate live Azure Responses smoke test verified a basic two-turn, authorized tool round trip on one selected deployment. That is not proof of every model, provider or protocol feature. Streaming and broader live-provider checks remain future work.
The agent defaults to 8 turns, 32 tool calls, 64 KiB of tool results and a 300-second whole-run timeout. Denied calls still consume the budget. The last allowed turn cannot execute tools because no turn would remain to interpret the results.
Provider defaults are 4,096 output tokens, a 120-second request/body timeout, a 2 MiB serialized request limit and a 4 MiB response limit. Truncated, malformed or unsupported responses are errors, not executable tool requests. There are no automatic retries.
The framework exposes createProvider in src/di/provider.js and runAgent in src/di/agent.js. Providers accept explicit configuration and return content, structured tool calls, usage and protocol-specific continuation state. Preserve that state intact between requests within the same protocol.
A host supplies tool schemas, mandatory validators and executors. Authorization must return exactly true. The loop validates the whole batch before executing any call; unknown tools, repeated IDs, malformed arguments and exceeded budgets stop the run. Schemas are not permissions.
Custom hosts must provide their own confinement, backups and disclosure controls. Cancellation is cooperative; in-process work cannot be forcibly rolled back. The CLI model is instructed to inspect applicable AGENTS.md files, but instructions never replace approval.
Provider and host API referenceExplore the full CLI reference and start with a project you know.