Skip to content
clai

v5.1.2· released yesterday

Ships code. Lands vulns.
No key required.

The free, open-source AI coding agent and authorized pentesting CLI for your terminal. 38 providers, keyless by default.

npm i -g @pentoshi/clai

MIT · ★ 16 stars · 52.1K downloads/mo · macOS, Linux, Windows

claiAGENT MODEFULL-ACCESS
workdir~/projects/apiproviderfreeeffortoffversionv5.1.2
  • Free
  • Google Gemini
  • OpenRouter
  • OpenAI
  • Anthropic
  • Mistral
  • Hinoki
  • River
  • NVIDIA NIM
  • AgentRouter
  • Constellation Gate
  • AWS Mantle
  • Ollama
  • Bynara
  • Qwen Cloud
  • Modal
  • Lightning AI
  • TokenRouter
  • Meta Model API
  • Fireworks
  • Hetzner
  • OrcaRouter
  • Merge Gateway
  • ExpLabs
  • Vercel AI Gateway
  • DeepSeek
  • Kimi · Moonshot
  • Xiaomi MiMo
  • GLM · Zhipu
  • MiniMax
  • Freebuff
  • Cline
  • ChatGPT · Codex
  • GitHub Copilot
  • Kiro
  • OmniRush
  • Token Harbor
  • Qoder

Why clai

Built for the work after the prompt.

Most agents stop at a suggestion. clai stays through the edit, the test run, and the failure it has to explain.

FREE

Free by default

The built-in Free provider runs without an account or a key. Stack free tiers from account sign-ins, APIs, and gateways behind it.

EVIDENCE

Shows its work

Every edit is a reviewable diff. clai runs the tests, reads the output, and reports a failure instead of calling it done.

CONTINUITY

Keeps going

Detach with /minimise and the agent keeps working. Reattach from any terminal or over SSH, and rotate keys when a provider rate-limits you.

Features

One terminal, the whole toolchain.

The parts you reach for all day: diffs, tests, jobs, sessions, and a provider pool that does not fall over at the first rate limit.

Any model, one CLI

Switch provider and model mid-session. Account sign-ins, API keys, gateways, and local Ollama share one interface.

37 providers · /model

Multi-key rotation

Store up to ten keys per provider. On a rate limit clai retries, then moves to the next key and tries the last working one first.

switching free key [2/3] (rate limited)key 2/3 · retry ok

Persistent sessions

Detach with /minimise and the agent keeps running. Reattach from another terminal, over SSH, or share one live session.

clai --resume · /minimise

Real tools

Reviewable diffs, shell commands, background jobs, interactive SSH and REPLs, MCP servers, Agent Skills, and parallel subagents.

fs.edit · shell.exec · terminal.start

Long sessions

Compact context without losing the thread, review every change, and reuse the prompts that worked.

/compact · /changes · /prompts

Native and self-updating

Checksum-verified binaries for macOS, Linux, and Windows on x64 and ARM64. One command updates whichever install you run.

clai update · SHA256 verified

Providers

Bring your own model. Or none.

The free provider is the default. Add account sign-ins, free-tier keys, gateways, or a local model and clai turns them into one pool with rotation.

Last working key first

clai remembers which key succeeded and tries it first next time, so a healthy key stays in front.

Retry-After aware

On a rate limit it honours the provider's hint, retries, then moves to the next key instead of stalling.

/fallback on

Cross-provider fallback when a whole provider is down, with the same retry discipline.

/freeonly

Keeps paid providers out of rotation and fallback, so a free-only setup stays free.

Provider directory

38 integrations

Keyless

1
  • Free

Account

7
  • Freebuff
  • Cline
  • ChatGPT · Codex
  • GitHub Copilot
  • Kiro
  • OmniRush
  • Qoder

Local

1
  • Ollama

API

13
  • Google Gemini
  • OpenRouter
  • OpenAI
  • Anthropic
  • Mistral
  • River
  • NVIDIA NIM
  • Qwen Cloud
  • DeepSeek
  • Kimi · Moonshot
  • Xiaomi MiMo
  • GLM · Zhipu
  • MiniMax

Gateways

15
  • AgentRouter
  • Constellation Gate
  • AWS Mantle
  • Bynara
  • Modal
  • Lightning AI
  • TokenRouter
  • Meta Model API
  • Fireworks
  • Hetzner
  • OrcaRouter
  • Merge Gateway
  • ExpLabs
  • Vercel AI Gateway
  • Token Harbor

Other

1
  • Hinoki

Modes

Read, act, or plan it first.

The same agent, three levels of trust. Switch mid-session with /ask, /agent, /plan, or Shift+Tab.

read-only

Questions, explanations, and read-only investigation. The default for new setups, with no edits and no side effects.

Permission policies govern clai's own tools and are not an OS sandbox.

ask mode

$clai "explain this repository and identify its entrypoint"

One-shot

$ clai "fix the failing auth test"

Pipeline

$ git diff | clai --quiet "review this diff for bugs"

Security

Authorized testing, with the scope in the loop.

The same agent that ships code can run a scoped engagement: authorization first, targets and exclusions second, then evidence you can report.

  1. Authorize

    Record the acknowledgement once with clai authorize-pentest AGREE. clai will not run a security engagement without it.

    clai authorize-pentest AGREE
  2. Scope

    Set authorized targets, exclusions, phases, and limits with clai scope or /scope before any traffic leaves the machine.

    clai scope
  3. Recon

    Enumerate inside scope with the tools you already have. Every URL, command, and interactive session is checked against the scope.

  4. Plan from evidence

    Turn confirmed observations into a plan. Plan mode keeps evidence gathering separate from exploitation and asks before the next phase.

  5. Report

    Write up severity, affected asset, evidence, reproduction, impact, and remediation, then close with the residual surface that was not tested.

Scope guardrails

  • Authorized targets and exclusions checked on every action
  • Phase, port, HTTP method, and path allowlists
  • Redirect destinations and resolved DNS addresses re-checked against scope
  • Engagement time window and expiry enforced
  • Token-bucket rate limit and concurrency cap per engagement
  • Local loopback probes exempt unless resolution escapes to a remote host

Test only systems you're authorized to assess.

Use cases

One agent for the whole day.

A prompt, a diff, a test run, a session you can leave and rejoin. These are the jobs clai is built to finish.

$ clai "add a /health endpoint and run the tests"

Ship a feature

Reads the repo, edits with a reviewable diff, runs the suite, and reports the result.

$ clai "find why the auth test flakes and fix it"

Fix a flaky test

Reproduces the failure, follows the evidence, and verifies the fix instead of guessing.

$ clai "migrate the API from Express to Fastify"

Migrate a stack

Plans the change, works file by file, and keeps the build green between steps.

$ clai "scope staging.example.com and enumerate it"

Authorized pentest

Recon, findings, and a structured report inside the scope you configured.

$ clai --resume

Resume over SSH

Reattach to a live session from another terminal, laptop, or phone.

$ clai "read the last 500 lines and find the 500s"

Triage logs

Follows the stack traces, groups the failures, and points at the likely cause.

Install

One command. Then it is running.

Native installers for macOS, Linux, and Windows, plus Homebrew and npm. The native builds bundle the runtime; only npm needs Node.js.

curl -fsSL https://downloads.clai.aniketpandey.website/install/install.sh | sh

Native binary. The installer verifies its SHA256 checksum before install.

clai

Launch the agent console on the free provider. No account, no key.

clai auth chatgpt

Sign in to an account provider. Add up to ten keys or accounts per provider.

clai --resume

Reopen the latest live or saved session from any terminal or SSH.

FAQ

Questions, answered.

The short version of what clai is, what it costs, and what it will not do without your say-so.

What is clai?

clai is a free, open-source AI coding agent and authorized pentesting CLI for the terminal. It runs keyless by default, edits files with reviewable diffs, runs commands and tests, and can run scoped security engagements across 38 providers. Use it as a coding agent, a pentesting assistant, or both in the same session — a free coding agent and pentesting CLI in one terminal.

Is clai really free to run?

Yes. A fresh install runs keyless on the built-in Free provider — no account, no API key, no config. From there you can add account sign-ins, free-tier API keys, gateways, or a local Ollama model, and clai rotates through your keys when one hits a rate limit so capacity stacks into one uninterrupted session. Paid providers are optional, and free-only mode keeps them out of the fallback chain.

Do I need an API key to get started?

No. The default Free provider is keyless. When you want more capacity, sign in with an account provider or add a key with clai set <provider> — up to 10 keys per provider, rotated automatically. Inside a session, /set manages the same credentials.

Which providers does clai support?

38 provider integrations in total, including 7 account sign-ins — ChatGPT (Codex), GitHub Copilot, Cline, Kiro, OmniRush, Qoder, and Freebuff — plus the keyless Free provider, local Ollama, direct APIs such as Anthropic, OpenAI, Gemini, DeepSeek, OpenRouter, Mistral, GLM, Kimi, MiniMax, MiMo, NVIDIA NIM, and Qwen Cloud, and gateways including AgentRouter, AWS Mantle, Fireworks, Lightning AI, Modal, TokenRouter, and Vercel AI Gateway.

How does multi-key rotation work?

Store up to 10 keys or signed-in accounts per provider. On a rate limit, clai honours the provider's Retry-After hint, retries, then moves to the next key; auth and quota errors switch keys immediately. The key that last worked is tried first next time. Optional cross-provider fallback (/fallback on) covers outages, and /freeonly keeps paid providers out of that chain.

What makes clai different from other AI coding agents?

Three things. It is free-tier first: multi-key rotation and optional cross-provider fallback keep it alive across rate limits instead of stopping. It is honest: it edits files with reviewable diffs, typechecks and runs builds before claiming done, and never reports success without evidence. And it is session-native: persistent sessions, durable plans, background jobs, subagents, Agent Skills, and MCP servers in one terminal agent.

Can it really run a pentest?

clai assists with authorized security testing: reconnaissance, enumeration, scoped testing, and structured reporting using installed tools. You acknowledge authorization once with clai authorize-pentest AGREE, then configure scope — authorized targets, exclusions, phases, and limits — with clai scope or /scope. Only test systems you own or have explicit permission to assess.

Is it safe to let an agent run shell commands?

Every action passes through the permission policy you configure. Ask mode is read-only; agent mode executes under your chosen policy; plan mode gathers evidence before anything runs. Ctrl+O reveals a full pending operation before you approve it. Under auto-allow, deletions outside the active folder or with a target clai cannot verify still ask first, and default mode confirms every deletion. These controls govern clai's own tools — they are not an OS sandbox.

How do persistent sessions work?

Run /minimise to detach while the agent keeps working, then reattach from another terminal or over SSH — several terminals can share one live session. clai --resume reopens the latest live or saved session, clai -c prefers the current directory, and clai history lists sessions and whether an agent is still running.

Can I run local or self-hosted models?

Yes. Point clai at Ollama for fully local, offline use, bring a custom endpoint, or drive a hosted open-weight model through a gateway such as Modal or Lightning AI. Account, API-key, gateway, and local providers all sit in the same provider and model pickers.

Which platforms and terminals are supported?

macOS, Linux, and Windows on x64 and ARM64. OpenTUI is the default interface on macOS and Linux; Windows and small terminals use the Classic interface, which you can force with clai --classic. Recommended terminals are iTerm2, Kitty, WezTerm, Alacritty, and Windows Terminal. Native binaries bundle the runtime; only the npm package needs Node.js 22 or newer.

Is clai open source?

Yes — MIT licensed, built by Aniket Pandey (pentoshi007). Source, issues, and installers live on GitHub; the package ships on npm as @pentoshi/clai, plus Homebrew and a self-updating native installer. The current release is v5.1.2.

Start with one command.

Free, keyless, and open source. Add an account or a key later only when you want more capacity.

clai