# dinocode

> A terminal AI coding assistant powered by Dinoiki and OpenAI-compatible providers.

Latest version **0.1.3** (published 2026-09-24) · 0 weekly downloads

## Install

```sh
npm install dinocode
pnpm add dinocode
yarn add dinocode
bun add dinocode
```

Provides the command `dinocode`.

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2026-09-24 |
| First published | 2026-09-24 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM |
| Node | >=22 |
| Dependencies | 0 |
| Unpacked size | 85.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | angga.elven |
| Keywords | ai, coding, cli, dinoiki, agent |

## Links

- npm: https://www.npmjs.com/package/dinocode
- npm.io page: https://npm.io/package/dinocode

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2026-09-24
- 0.1.2 — 2026-09-24
- 0.1.1 — 2026-09-24
- 0.1.0 — 2026-09-24

## README

# Dinocode

A terminal AI coding assistant powered by Dinoiki, with support for other OpenAI-compatible APIs.

Dinocode helps you understand projects, find code, make changes, and run commands through conversation. File edits and shell commands require your approval.

[Dinoiki website](https://dinoiki.com) · [npm package](https://www.npmjs.com/package/dinocode)

## Features

- A DINOCODE welcome screen, a framed input area, and the active model above every prompt.
- Interactive conversations with streaming responses.
- Searchable model and command menus with keyboard navigation.
- Model discovery directly from your provider, without a hardcoded model catalog.
- Tools for listing directories, reading and searching files, creating files, and editing text.
- Approval before file changes and shell execution.
- Read-only mode for exploring projects without edits or shell commands.
- Local session storage and conversation resumption.
- One-shot tasks and piped input for noninteractive use.
- Configurable OpenAI-compatible API endpoints.

## Requirements

- **Node.js 22 or later** and **npm**.
- An internet connection and a Dinoiki API key with access and quota for your chosen model.
- An interactive terminal for login, conversations, and action approvals.
- `curl` and a POSIX shell for script-based installation, such as on macOS or Linux.

The installer does not install Node.js or npm automatically. On Windows, use npm; shell examples in this README use macOS/Linux syntax.

## Installation

Choose one method to avoid maintaining multiple installations in different locations.

### Using npm

```bash
npm install -g dinocode
```

### Using the installer

```bash
curl -fsSL https://dinoiki.com/install.sh | sh
```

The installer downloads the package from npm and installs it under the `$HOME/.local` prefix by default, without `sudo` or changes to your shell profile. If the `dinocode` command is not found, run:

```bash
export PATH="$HOME/.local/bin:$PATH"
```

To keep this setting in new terminals, add that line to your shell configuration, such as `~/.zshrc` or `~/.bashrc`.

The installer supports the following optional settings. Pass these variables to the `sh` process, not just to `curl`:

```bash
curl -fsSL https://dinoiki.com/install.sh | DINOCODE_VERSION=0.1.0 sh
curl -fsSL https://dinoiki.com/install.sh | DINOCODE_INSTALL_PREFIX="$HOME/.local" sh
```

`DINOCODE_VERSION` defaults to `latest`. `DINOCODE_INSTALL_PREFIX` must be an absolute path; choose a directory owned by your user.

The `curl | sh` command immediately executes the downloaded script. To review it first, download it and inspect its contents before running it:

```bash
curl -fsSL https://dinoiki.com/install.sh -o install.sh
```

After reviewing the file:

```bash
sh install.sh
```

### Verify the installation

```bash
dinocode --version
dinocode --help
```

## Quick start

### 1. Save your API key

```bash
dinocode auth login
```

Enter your Dinoiki API key when prompted. Input is hidden, and the key is saved in your local configuration rather than inside the project.

Default endpoint:

```text
https://ai.dinoiki.com/v1
```

Login saves the key but does not verify that it can make chat requests. Depending on the provider, listing models may not require authentication either.

### 2. Start from your project directory

```bash
cd /path/to/project
dinocode --read-only
```

Replace `/path/to/project` with the directory you want to explore. The welcome screen displays the DINOCODE logo and your workspace. If no default model is configured, a searchable model picker opens: type to filter by model name or provider, use the arrow keys to navigate, and press Enter to select.

The active model is displayed above every input prompt, next to the BUILD or READ ONLY mode label.

Example prompt:

```text
Explain this project's structure and the purpose of its main components.
```

To allow the assistant to request file edits and shell commands, launch without `--read-only`:

```bash
dinocode
```

Example prompt:

```text
Read the form validation code, then help fix how empty input is handled.
```

Review each action preview before approving it with `y`. Press Enter or type `n` to deny the action.

## Models

List available models:

```bash
dinocode models
```

Replace `MODEL_ID` in the following examples with an exact ID from your provider's model list:

```bash
dinocode config set model MODEL_ID
dinocode --model MODEL_ID
```

`config set model` saves a default; `--model` selects a model for that session. During a conversation, `/model` and `/models` open the searchable picker. The current model is marked `[active]`. Use `/model MODEL_ID` to switch directly, or `/model SEARCH_TEXT` to open a filtered picker when the text does not match an exact ID.

Use ↑/↓ to navigate, Enter to select, and Esc or Ctrl+C to cancel without changing the model. Changes apply to the current session and are saved for resumption; they do not overwrite your default model. The active-model indicator updates immediately.

Model availability, pricing, and capabilities depend on the provider. For coding tools, choose a model that supports **tool calling/function calling**; an OpenAI-compatible endpoint does not guarantee that every model supports tools.

## CLI usage

### Choose a workspace

```bash
dinocode --cwd /path/to/project
```

The workspace defaults to the directory where you run the command.

### Run a single task

```bash
dinocode run "Explain the scripts available in package.json" --read-only --model MODEL_ID
```

You can omit `--model` if a model is already configured. The `run` command does not open a model picker automatically.

### Pipe input

```bash
printf '%s\n' 'Find the application entry point and explain its execution flow.' | dinocode run --read-only --model MODEL_ID
```

In noninteractive mode, file changes and shell commands are denied because approval requires an interactive terminal. There is no option to automatically approve all actions.

### Set a step limit

```bash
dinocode run "Analyze the authentication flow" --read-only --model MODEL_ID --max-steps 30
```

The default limit is 20 model calls per turn, configurable from 1 to 100. Increasing the limit may increase API usage.

### Resume a session

```bash
dinocode sessions
dinocode --resume SESSION_ID --cwd /path/to/project
```

Replace `SESSION_ID` with an ID from the session list. Sessions can only be resumed with the same workspace and provider URL. Add `--read-only` if needed, since the permission mode is selected each time you launch the CLI.

### Conversation commands

| Command | Purpose |
| --- | --- |
| `/` | Open the searchable command menu. |
| `/help` | Show a short command reference. |
| `/model` or `/models` | Search and select models, with the current model marked active. |
| `/model MODEL_ID` | Switch directly to an exact model ID for this session. |
| `/model SEARCH_TEXT` | Open the picker filtered by model name or provider. |
| `/status` | Show the model, provider, workspace, and session details. |
| `/clear` | Start a new session without deleting previous sessions. |
| `/exit` or `/quit` | Exit the conversation. |

Type `/` and press Enter to browse commands, or use **Tab** to complete a slash command. Menus support typing to search, arrow-key navigation, Enter to select, and Esc to return to the conversation. The standalone `dinocode models` command still prints a plain model list.

Press **Ctrl+C** to cancel a running turn. When waiting for a new prompt, Ctrl+C exits the conversation. Cancellation does not undo changes already made.

## Configuration

Show the active configuration without displaying the API key value:

```bash
dinocode config
```

Default location:

```text
~/.config/dinocode/
├── config.json
└── sessions/
```

If `XDG_CONFIG_HOME` is set, the location becomes `$XDG_CONFIG_HOME/dinocode`. Set `DINOCODE_CONFIG_DIR` to an absolute path to override that location entirely.

### Environment variables

| Variable | Purpose |
| --- | --- |
| `DINOIKI_API_KEY` | API key for the default Dinoiki endpoint. |
| `DINOCODE_API_KEY` | API key for the active provider; takes precedence over `DINOIKI_API_KEY`. |
| `DINOCODE_MODEL` | Override the saved default model. |
| `DINOCODE_BASE_URL` | Override the saved API URL. |
| `DINOCODE_CONFIG_DIR` | Absolute directory path for configuration and sessions. |
| `XDG_CONFIG_HOME` | Base configuration directory when `DINOCODE_CONFIG_DIR` is not set. |
| `NO_COLOR` | Disable terminal colors when this variable is present. |

Environment variables take precedence over saved settings. When resuming a session, model selection follows this order: `--model`, `DINOCODE_MODEL`, the session's model, then the saved default model.

For automation, provide keys through a secret manager or the process environment. Do not put real keys in shared scripts, shell history, or your repository. Dinocode does not automatically load `.env` files.

Remove the saved key:

```bash
dinocode auth logout
```

Logging out does not remove environment-provided keys, revoke keys at the provider, or delete session history.

### Other OpenAI-compatible providers

Dinoiki remains the default. To use another provider, configure its API base URL, including a version path such as `/v1` when required:

```bash
dinocode config set base-url "$PROVIDER_BASE_URL"
dinocode auth login
dinocode models
dinocode config set model MODEL_ID
```

Set `PROVIDER_BASE_URL` to your provider's URL first, without appending `/chat/completions`. The provider should expose `/models` and `/chat/completions` under that base URL.

Changing the URL with `config set base-url` clears the previously saved key and model to prevent reuse with a different provider. A saved key is also not forwarded when `DINOCODE_BASE_URL` points to a different URL, but `DINOCODE_API_KEY` explicitly applies to the active provider.

URLs must use HTTPS; HTTP is allowed only for `localhost`, `127.0.0.1`, or `::1`. URLs cannot include credentials, a query, or a fragment.

## Security and privacy

- Prompts, file contents read by tools, tool results, and the conversation history used for requests are sent to the active provider. Do not include information you are not allowed to share with that provider.
- File tools restrict access to the workspace and block certain sensitive file and directory names, such as `.env`, `.git`, `.ssh`, `.npmrc`, and some key files. This is not a comprehensive secret detector; credentials embedded in ordinary files may still be read.
- File edits and shell commands require approval. Approved shell commands **are not sandboxed** and run with your user access, including access outside the workspace. Review each command before approving it.
- `--read-only` disables edits and shell commands, but code read by tools may still be sent to the provider, and sessions are still saved locally.
- API keys are stored as plaintext in `config.json`, not encrypted or stored in a keychain. Configuration and session files are created with owner-only permissions (`0600`) on POSIX systems; actual protection depends on your operating system and filesystem.
- Session history can contain code and command output. Protect your configuration directory and its backups; `/clear` does not delete previous history.
- Review changes and run tests before relying on AI-generated results. There is no automatic rollback feature.

## Updating Dinocode

Updates are currently manual. Use the same method you chose for installation.

**npm installation:**

```bash
npm install -g dinocode@latest
```

**Script-based installation:**

```bash
curl -fsSL https://dinoiki.com/install.sh | sh
```

If you previously set `DINOCODE_INSTALL_PREFIX`, use the same prefix when updating. Unset a pinned `DINOCODE_VERSION` or set it to `latest` to get the newest release.

After updating, restart Dinocode and check the installed version:

```bash
dinocode --version
```

Updating the package does not delete API key configuration or sessions stored separately.

## Troubleshooting

| Issue | What to check |
| --- | --- |
| `dinocode: command not found` | For the default installer, add `$HOME/.local/bin` to `PATH`. For npm, make sure the executable directory for your global npm prefix is in `PATH`. |
| Outdated Node.js version | Check `node --version`, then use Node.js 22 or later. |
| `No API key configured` | Run `dinocode auth login`, then check `dinocode config`. |
| API 401 or 403 | Check your key, permissions, and active provider; an environment key may override a newly saved key. |
| API 429 | Check the provider's quota or rate limits; try again once the limit allows further requests. |
| `No model selected` | Run `dinocode models`, then set a default or pass `--model MODEL_ID`. |
| Model does not use tools | Make sure the selected model supports tool calling and is available through the router. |
| Edits denied in a pipe or automation | Use an interactive terminal to approve actions; noninteractive mode cannot approve edits or shell commands. |
| Unable to resume a session | Use the same workspace and provider base URL as the original session. |
| Version unchanged after an update | Check `command -v dinocode` and your installation location; multiple installations may exist in `PATH`. |

## Local development

From the Dinocode source directory:

```bash
npm ci
npm run build
node dist/cli.js auth login
node dist/cli.js --read-only
```

To run the local version against another project:

```bash
node dist/cli.js --cwd /path/to/project --read-only
```

Development commands:

| Command | Purpose |
| --- | --- |
| `npm run dev` | Build and start the interactive CLI. |
| `npm run build` | Compile TypeScript into `dist/`. |
| `npm run check` | Check types without generating build output. |
| `npm test` | Build and run unit and integration tests against local mock providers. |
| `npm run test:terminal` | Test pseudo-terminal interactions; requires Python 3 and a POSIX environment. |
| `npm pack --dry-run` | Inspect the package contents before distribution. |

Tests use local fixtures and do not require a Dinoiki API key. The `prepack` script runs the build automatically before `npm pack` or `npm publish`.

---
_Source: https://npm.io/package/dinocode · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
