Web Chat — Server Setup

Launch the PKA CODE web server and chat with AI instantly. One command does everything.

1. Launch Web Chat

Install the CLI globally, then run:
pkacodeweb
The server starts on http://localhost:3721 and your browser opens automatically.

2. Chat Instantly

The chat opens at:
http://localhost:3721/chat
Start chatting with DeepSeek V4 Flash immediately — no API key needed.

3. Instant Mode (No Key)

Chat instantly with up to 20 messages per hour. The server uses its own API key for instant access.

4. Unlimited Mode (Your Key)

For unlimited usage, add your own OpenRouter API key in Settings. One free key gives access to all providers.

Manual Start (Alternative)

You can also start the server manually:
cd server && node index.js
Then open http://localhost:3721/chat in your browser.

Phone Access

The server broadcasts on your local network. Access from your phone at:
http://<your-ip>:3721/chat
Both devices must be on the same WiFi.

Installation

Install globally via npm. Node.js 18+ required.

Install globally npm
npm install -g pkacode-cli
Start interactive mode terminal
pkacode
Single prompt mode terminal
pkacode -p "explain this function"
pkacode "build a todo app"
pkacode -p "read package.json and explain it"
Node ≥ 18.0.0 Windows Linux macOS

System requirements

Minimal dependencies. Runs on any modern terminal.

Platform Requirement Notes
All Node.js 18+ LTS recommended
Windows 10+ Windows Terminal (recommended) Clipboard built-in via clip
Linux Any modern distro Install xclip or wl-clipboard
macOS 12+ Intel & Apple Silicon Clipboard built-in via pbcopy

Authentication

Set your FREE API key from any supported provider.

Login to a provider terminal
pkacode auth login gemini
pkacode auth login groq
pkacode auth login openrouter
Switch provider terminal
pkacode provider set gemini
pkacode provider set groq
pkacode provider set openrouter

CLI commands

All available commands for the pkacode CLI.

Command Description
pkacodeStart interactive chat mode
pkacode "prompt"Single-prompt mode
pkacode -p "prompt"Headless print mode
pkacode --helpShow help
pkacode --versionShow version
pkacodewebStart web server and open chat in browser
pkacode theme [dark|light]Switch color theme
pkacode auth login <provider>Set API key
pkacode provider set <name>Switch provider
pkacode model set <name>Switch model
pkacode models listList all models
pkacode configShow config
pkacode config set <key> <value>Set config value
pkacode permissionsShow permission rules
pkacode permissions resetReset to defaults
pkacode sessions listList saved sessions
pkacode resume [session]Resume a session
pkacode sandboxToggle sandbox mode

In-chat commands

Slash commands available during interactive chat.

Command Alias Description
/themeSwitch color theme
/session/infoShow session ID, model, turns, tokens
/newStart a fresh session
/resumeInteractive picker to continue a session
/sessionsList all saved sessions
/permissions/permView and change permission mode
/exit/quitExit the assistant
/clearClear conversation history
/helpShow help
/commandsShow all PKA CLI commands
/modelShow or switch active model
/modelsList available models
/providerShow or switch AI provider
/authLogin/logout from providers
/tokensShow token usage
/configShow current configuration
/resetReset configuration to defaults
/sandboxToggle sandbox preference
/multilineEnter multi-line input mode

Configuration

Config is stored as JSON. Accessible and editable.

Config paths

  • Windows: %APPDATA%\pka\config.json
  • Linux / macOS: ~/.config/pka/config.json
Example config.json JSON
{
  "provider": "gemini",
  "model": "gemini-2.0-flash",
  "apiKeys": {
    "gemini": "AIzaSy...",
    "groq": "gsk_...",
    "openrouter": "sk-or-..."
  },
  "permissionMode": "default",
  "enabledTools": ["bash", "fs"],
  "sandbox": false,
  "maxTokens": 4096,
  "temperature": 0.3,
  "stream": true
}

Config keys

  • provider — Active AI provider
  • model — Active model name
  • apiKeys — Stored API keys
  • permissionMode — default, auto-edit, plan, or yolo
  • enabledTools — Allowed tool categories
  • sandbox — Sandbox toggle
  • maxTokens — Max response tokens
  • temperature — Model temperature (0.0–1.0)
  • stream — Streaming responses

Development

Build from source and contribute to the project.

Clone and build bash
git clone https://github.com/Pisethz/pkacode-cli.git
cd pkacode-cli
npm install
npm run build
npm link
pkacode
Dev mode with hot reload bash
npm run dev
TypeScript Commander.js Chalk Execa Ora MIT License