Solve CAPTCHAs from the command line using 2Captcha human-powered service.
Canonical source: https://github.com/adinvadim/2captcha-cli
This tool sends CAPTCHA images, page URLs, sitekeys, challenge IDs, and task metadata to 2Captcha for processing by the 2Captcha service and its human solvers. Use it only for authorized automation, and do not submit sensitive, regulated, internal, or third-party user data unless you have approval.
- GitHub source and feedback: https://github.com/adinvadim/2captcha-cli
- skills.sh install source: https://skills.sh/adinvadim/2captcha-cli
- ClawHub/OpenClaw skill: https://clawhub.ai/adinvadim/2captcha
- 10 captcha types — Image, reCAPTCHA v2/v3, hCaptcha, Turnstile, FunCaptcha, GeeTest, Amazon WAF
- Zero dependencies — Pure Python 3 stdlib
- Human-first design — Clear output, helpful errors, progress indicators
- Script-friendly —
--jsonoutput, proper exit codes,--quietmode - Flexible config — Flag > env > config file precedence
# skills.sh: Codex, Claude Code, Cursor, and other supported agents
npx skills add adinvadim/2captcha-cli
npx skills add adinvadim/2captcha-cli --global
npx skills add adinvadim/2captcha-cli --agent codex
npx skills use adinvadim/2captcha-cli@2captcha
# OpenClaw / ClawHub
openclaw skills install 2captcha
clawhub install 2captcha# Review source, then install locally
git clone https://github.com/adinvadim/2captcha-cli.git
cd 2captcha-cli
python3 solve-captcha --version
mkdir -p ~/.local/bin
ln -sf "$PWD/solve-captcha" ~/.local/bin/solve-captcha
# Or with Homebrew (coming soon)
# brew install adinvadim/tap/solve-captcha
# Or clone manually
git clone https://github.com/adinvadim/2captcha-cli.git
cd 2captcha-cli
chmod +x solve-captcha
sudo ln -s $(pwd)/solve-captcha /usr/local/bin/Old adamvinsky/2captcha-cli links are obsolete. Use adinvadim/2captcha-cli.
API key lookup order:
--api-key/-kflagTWOCAPTCHA_API_KEYenvironment variable~/.config/2captcha/api-keyfile~/.2captcha-api-keyfile
# Option 1: Environment
export TWOCAPTCHA_API_KEY="your-key"
# Option 2: Config file
mkdir -p ~/.config/2captcha
echo "your-key" > ~/.config/2captcha/api-key# Image captcha
solve-captcha image captcha.png
solve-captcha image https://example.com/captcha.jpg --math
# reCAPTCHA v2
solve-captcha recaptcha2 -s 6Le-wvkSAAAA... -u https://example.com
# hCaptcha
solve-captcha hcaptcha -s a5f74b19-9e45... -u https://example.com
# Cloudflare Turnstile
solve-captcha turnstile -s 0x4AAA... -u https://example.com
# Check balance
solve-captcha balanceDo not use these commands on sensitive or internal pages unless sending CAPTCHA content and page metadata to 2Captcha is approved for that workflow.
| Command | Description |
|---|---|
image <file|url> |
Solve image captcha (OCR) |
recaptcha2 |
Solve reCAPTCHA v2 |
recaptcha3 |
Solve reCAPTCHA v3 |
hcaptcha |
Solve hCaptcha |
turnstile |
Solve Cloudflare Turnstile |
funcaptcha |
Solve Arkose Labs FunCaptcha |
geetest |
Solve GeeTest v3 |
geetest4 |
Solve GeeTest v4 |
amazon |
Solve Amazon WAF CAPTCHA |
text <question> |
Solve text question |
balance |
Check account balance |
| Flag | Description |
|---|---|
-h, --help |
Show help |
-V, --version |
Show version |
-k, --api-key |
API key (overrides env/config) |
-j, --json |
Output full JSON response |
-q, --quiet |
Suppress progress output |
-v, --verbose |
Verbose debug output |
-t, --timeout |
Timeout in seconds (default: 180) |
--no-color |
Disable colored output |
solve-captcha image captcha.png [options]| Option | Description |
|---|---|
--phrase |
Answer contains multiple words |
--case-sensitive |
Case-sensitive answer |
--numeric N |
0=any, 1=numbers, 2=letters, 3=either, 4=both |
--math |
Requires calculation |
--min-length N |
Minimum answer length |
--max-length N |
Maximum answer length |
--comment TEXT |
Instructions for solver |
--lang LANG |
Language pool (en, rn) |
$ solve-captcha image captcha.png
Submitting image captcha...
Solving... 12s
✓ Solved in 0.00025 USD
abc123
$ solve-captcha --json image captcha.png
{
"errorId": 0,
"status": "ready",
"solution": {"text": "abc123"},
"cost": "0.00025"
}
TOKEN=$(solve-captcha -q recaptcha2 -s KEY -u URL)| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Invalid usage / missing args |
| 3 | Timeout |
| 4 | Authentication error |
| 130 | Interrupted (Ctrl-C) |
Respects standard conventions:
NO_COLOR— Disable colorsTERM=dumb— Disable colors- Non-TTY stderr — Disable progress/colors
Open bugs and feature requests in GitHub Issues.
MIT © Vadim Kostin (@adinvadim)