npm.io
0.1.3 • Published 10h agoCLI

dinocode

Licence
Version
0.1.3
Deps
0
Size
86 kB
Vulns
0
Weekly
0

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 · npm package

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
npm install -g dinocode
Using the installer
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:

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:

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:

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

After reviewing the file:

sh install.sh
Verify the installation
dinocode --version
dinocode --help

Quick start

1. Save your API key
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:

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

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:

dinocode

Example prompt:

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:

dinocode models

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

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
dinocode --cwd /path/to/project

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

Run a single task
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
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
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
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:

dinocode config

Default location:

~/.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:

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:

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:

npm install -g dinocode@latest

Script-based installation:

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:

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:

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:

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.

Keywords