whale code

AI agent CLI for retail operations. Manage inventory, orders, customers, and analytics from your terminal — or let Claude, Gemini, or any MCP client do it for you.

AI Agent CLIBuilt-in MCP ServerClaude · Gemini · Any MCP Client
~
$npm install -g @whale-code/cli
$whale
◆ whale code v4.7.0sonnet · 16 server tools
────────────────────────────────────────────────────────────────────────────────
# Get 30-day sales analytics
or add the MCP server to Claude Code · Gemini · Cursor

Tools

Each tool is loaded dynamically from your database. Ask Claude to do any of this in natural language.

Analytics

Sales analytics with flexible date ranges

Inventory

Adjust quantities, set stock, transfer between locations

Customers

Find, create, update customer records

Orders

Find orders, get details, manage purchase orders

Products

Find, create, update products and pricing

Purchase Orders

Create, approve, receive, cancel POs

Transfers

Move inventory between locations

Email

Send emails, manage inbox

Alerts

Low stock and pending order alerts

Documents

Generate COAs and documents

Suppliers

Find and list suppliers

Audit Trail

View audit logs for any operation

Setup

Install the package, set your credentials, add it to Claude.

setupbash
1# Install
2npm install -g @whale-code/cli
3
4# Add to Claude Code (~/.claude/settings.json)
5{
6 "mcpServers": {
7 "whale": {
8 "command": "whale-code",
9 "env": {
10 "SUPABASE_URL": "https://your-project.supabase.co",
11 "SUPABASE_SERVICE_ROLE_KEY": "your-key",
12 "DEFAULT_STORE_ID": "your-store-uuid"
13 }
14 }
15 }
16}
claude-desktop-configjson
1# Or for Claude Desktop
2{
3 "mcpServers": {
4 "whale": {
5 "command": "npx",
6 "args": ["@whale-code/cli"],
7 "env": {
8 "SUPABASE_URL": "https://your-project.supabase.co",
9 "SUPABASE_SERVICE_ROLE_KEY": "your-key",
10 "DEFAULT_STORE_ID": "your-store-uuid"
11 }
12 }
13 }
14}

Two ways to use it

whalestandalone CLI

Its own AI agent. Run whale and you get an interactive terminal with the full agent loop — reads/writes files, runs commands, manages inventory, processes orders. Same workflow as Claude Code, but purpose-built for retail ops.

$ npm i -g @whale-code/cli
$ whale login
$ whale
◆ whale code v4.7.0 sonnet · 16 tools
────────────────────────────────────────────────────────────
check what's running low and reorder
MCP serverplug into anything

The same tools are exposed as an MCP server. Add it to Claude Code, Claude Desktop, Gemini, Cursor — any client that speaks MCP gets full access to your inventory, orders, customers, and analytics.

// ~/.claude/settings.json
{
"mcpServers": {
"whale": {
"command": "whale-code"
}
}
}
You
natural language
Agent
picks the tool
MCP
tool registry
Edge Fn
validates
Database
your data
Database-driven tools

Tool definitions live in ai_tool_registry. Add a row, the MCP server picks it up on next refresh. No rebuild.

Agent-agnostic

whale code has its own agent loop, but the MCP server works with any client. Same tools, same backend, different frontends.

Local-first

The CLI runs on your machine. File access, command execution, code editing — all local. Server tools proxy through edge functions to your database.

Full observability

Every action — CLI or MCP — is logged with W3C trace context. See exactly what happened, when, and how much it cost.

──audit_logs────────────────────────────────────────
tool.inventory142ms$0.004
tool.analytics89ms$0.006
claude_api2.1s$0.031
tool.orders167ms$0.005
Trace context

W3C trace_id + span_id on every call. Correlate across CLI sessions, MCP calls, and edge functions.

Token & cost tracking

Input/output tokens and dollar cost logged per turn. Track spend across conversations and agents.

Conversation history

Every conversation gets a UUID. Every turn is numbered. Full replay from audit_logs.

Fire-and-forget

Telemetry never blocks the agent. Async inserts to audit_logs — zero impact on response time.

Need something built?

We build the same things we use — and we'll build them for you.

Apps & Sites

Next.js web apps, storefronts, admin dashboards, landing pages. Deployed and maintained.

AI Agents & MCP Servers

Custom AI agents for your workflow. MCP servers that connect Claude, Gemini, or any client to your backend.

Backend & Infrastructure

Database design, edge functions, auth, CI/CD. We set it up and keep it running.

Observability & Monitoring

Telemetry pipelines, audit logs, cost tracking, alerting. Know what your AI is doing and what it costs.

whale code

Websites, apps, and automations for your business. Powered by AI.

Built with MCP • Powered by Claude • MIT Licensed