npm package: @arka-ai/code
Description: ARKA Code - AI-powered coding assistant (Pro)
Author: ARKA AI
Latest version: 2.0.17

<div align="center">

# ARKA Code

### Your AI Pair Programmer in the Terminal

<br />

<img src="https://arka-ai.com/images/cli/welcome.png" alt="ARKA Code CLI" width="700" />

<br />
<br />

[![npm version](https://img.shields.io/npm/v/@arka-ai/code.svg?style=for-the-badge&color=F97316&labelColor=000000)](https://www.npmjs.com/package/@arka-ai/code)
[![npm downloads](https://img.shields.io/npm/dm/@arka-ai/code.svg?style=for-the-badge&color=F97316&labelColor=000000)](https://www.npmjs.com/package/@arka-ai/code)
[![Pro](https://img.shields.io/badge/ARKA_AI-Pro-8B5CF6?style=for-the-badge&labelColor=000000)](https://arka-ai.com/pricing)

<br />

[Documentation](https://arka-ai.com/docs/guides/arka-code-cli) · [Get Started](https://arka-ai.com/docs/guides/arka-code-cli/authentication) · [Feedback](https://arka-ai.com/feedback)

</div>

<br />

## What is ARKA Code?

ARKA Code is a **terminal-based agentic coding assistant** that lives in your command line. It understands your codebase, executes tasks autonomously, and helps you build faster — all through natural language.

**Just type naturally.** No special syntax, no quotes, no prefixes.

<br />

## Quick Start

```bash
# Install globally
npm install -g @arka-ai/code

# Login with your ARKA AI account
arka login

# Start coding!
arka
```

<br />

## What's New in v2.0.16

- **Reduced Flicker** - 32ms throttled streaming updates (~90% fewer re-renders)
- **Static Message History** - Completed messages frozen from reconciliation cycle
- **zod Validation** - Runtime schema validation for configs and API responses
- **execa Integration** - Modern process execution with better error handling
- **Compare Mode** - Multi-model comparison working with proper API routing
- **Actions Panel** (`Ctrl+A`) - Unified panel showing all available shortcuts

<br />

## Powered by ARKAbrain

Unlike single-model tools, ARKA Code uses **ARKAbrain** — our intelligent routing system that automatically selects the best AI model for each task:

| Task Type | Model Selection |
|-----------|-----------------|
| Complex refactoring | Claude Sonnet |
| Quick explanations | GPT-4o-mini |
| Code generation | Claude / GPT-4o |
| Bug fixing | Best available |

You get the **best model for every task** without manual switching.

<br />

## Features

<table>
<tr>
<td width="50%">

### Agentic Coding
Read, write, edit files and execute commands autonomously. ARKA Code understands context and takes action.

### Intelligent Routing
ARKAbrain automatically selects the optimal AI model based on your task complexity and type.

### Beautiful Terminal UI
Modern Ink-based interface with syntax highlighting, markdown rendering, and real-time streaming.

### Multi-Model Compare
Compare responses from multiple AI models side-by-side to find the best solution.

</td>
<td width="50%">

### Session Memory
Remembers your preferences, coding conventions, and project decisions across sessions.

### Tool Execution
Built-in tools for file operations, shell commands, git, and codebase exploration.

### Keyboard-Driven
Efficient Ctrl+ shortcuts for power users. Toggle layouts, switch models, and navigate with ease.

### Permission Control
Choose how ARKA handles actions: ask every time, auto-approve edits, or full autonomy.

</td>
</tr>
</table>

<br />

## Usage

```
Usage: arka [options] [command] [prompt...]

Arguments:
  prompt                     Initial prompt to send

Options:
  -V, --version              Output version number
  -k, --api-key <key>        API key (overrides config)
  -u, --api-url <url>        API URL (overrides config)
  -r, --resume               Resume previous session
  -p, --permission <mode>    Permission mode: ask, auto-edit, auto-all
  --read-only                Read-only mode (no file writes or commands)
  -h, --help                 Display help

Commands:
  login                      Authenticate with ARKA AI
  logout                     Log out and clear credentials
  compare [prompt...]        Multi-model comparison mode
```

<br />

## Keyboard Shortcuts

**Quick access:** Press `Ctrl+A` to open the **Actions Panel** showing all available shortcuts.

| Shortcut | Action |
|----------|--------|
| `Ctrl+A` | **Actions Panel** (all shortcuts) |
| `Ctrl+M` | Model selector |
| `Ctrl+T` | Tools panel |
| `Ctrl+L` | Toggle layout |
| `Ctrl+Y` | Copy last response |
| `Ctrl+Q` | Quit |
| `?` | Help |
| `Esc` | Close panel |

<br />

## Compare Mode

Compare responses from multiple AI models side-by-side:

```bash
# Default models
arka compare "write a function to parse JSON"

# Specify models
arka compare -m gpt-4o,claude-3.5-sonnet,deepseek-chat "explain recursion"
```

<br />

## Natural Language Interface

Just describe what you want — no commands, no syntax:

```
You: fix the type errors in src/utils.ts
You: add validation to the user registration form
You: write unit tests for the payment module
You: refactor this function to use async/await
You: explain how the auth middleware works
```

<br />

## Permission Modes

Control how ARKA Code handles file and command permissions:

| Mode | Behavior |
|------|----------|
| `ask` (default) | Prompt for permission before each action |
| `auto-edit` | Auto-approve file edits, ask for commands |
| `auto-all` | Auto-approve all actions (use with caution) |

```bash
arka -p auto-edit "refactor this file"
```

<br />

## Configuration

**Environment Variables:**
```bash
export ARKA_API_KEY=arka_xxxxx
```

**Config File** (`~/.arka/config.json`):
```json
{
  "provider": "arka",
  "model": "auto",
  "tone": "concise",
  "layoutEnabled": true
}
```

<br />

## Authentication

ARKA Code requires an **ARKA AI Pro** subscription.

1. Visit [arka-ai.com](https://arka-ai.com) and sign up
2. Run `arka login` to authenticate
3. Start coding!

See the [Authentication Guide](https://arka-ai.com/docs/guides/arka-code-cli/authentication) for details.

<br />

## Requirements

- **Node.js 18+**
- **[ARKA AI Pro](https://arka-ai.com/pricing)** subscription
- Terminal with Unicode support

<br />

---

<div align="center">

**[Documentation](https://arka-ai.com/docs/guides/arka-code-cli)** · **[ARKA AI](https://arka-ai.com)** · **[Feedback](https://arka-ai.com/feedback)**

<br />

MIT © [ARKA AI](https://arka-ai.com)

</div>