A zero-dependency Python CLI and library for text rewriting via the humanizeai.pro web endpoint (POST /api/process).
Note: This client interacts with the web application's endpoint, not the paid public API (
api.humanizeai.pro/v1). It does not try to work around or crack Cloudflare Turnstile in any way — instead, it lets you transfer your own browser's session cookie and Turnstile token quickly and repeatedly.
- Zero runtime dependencies — uses the Python 3.9+ standard library only (
urllib,sqlite3,argparse,dataclasses). - Automatic document chunking — breaks up long texts on paragraph and sentence boundaries (
--max-words 180by default) to stay within the endpoint's ~200-word per-request limit and stitches them back together. - Simple browser handoff —
- Reads existing
humanizeai.procookies locally from Chrome, Chromium, Brave, Edge, Arc, Vivaldi, or Firefox without sending them anywhere. - Parses Chrome and Firefox DevTools Copy as cURL dumps (
--from-curl). - Watches your clipboard (
--wait-token) and caches valid tokens locally (~/.humanizeai/session.json,0600permissions) for 30 minutes (--token-ttl 1800).
- Reads existing
- Unix-style CLI — takes inline text,
stdin, single files (-i/-o), or batch mode (-i ... --outdir), keepingstdoutclean for rewritten text and logging progress tostderr. - Agent-ready — ships a portable Agent Skill for Antigravity, Codex, and Claude Code, plus an
AGENTS.mdoperating guide with clear exit codes and a non-destructive output policy.
Requires Python 3.9+.
# Install globally as a CLI tool (recommended for using from any folder or agent skill)
pipx install git+https://github.com/igotlinux/humanizeai-cli.git
# (or with pip: pip install git+https://github.com/igotlinux/humanizeai-cli.git)For local development:
# Clone the repository
git clone https://github.com/igotlinux/humanizeai-cli.git
cd humanizeai-cli
# Install into a virtual environment
python3 -m venv .venv
source .venv/bin/activate
pip install -e .Or run directly without installing:
PYTHONPATH=src python3 -m humanizeai_cli --helphumanizeai automatically reads humanizeai.pro cookies from your local browser profile (Chrome, Brave, Edge, Arc, Vivaldi, or Firefox), and Copy as cURL hands over both the cookie and a fresh Turnstile token in one step.
Start the CLI in wait mode first:
humanizeai --wait-token -i examples/sample.txt -o sample.human.txtWhile it waits in your terminal:
- Open
https://www.humanizeai.proin your browser. - Open DevTools (
Cmd+Opt+Ion macOS,Ctrl+Shift+Ion Windows/Linux) and switch to the Network tab before clicking anything. Filter byprocess(or Fetch/XHR). - Type or paste a short test sentence into the website's text box (for example:
This is a short test sentence.). The site will not send a/api/processrequest if the text box is empty. - Click Humanize AI once and wait a moment for the
POST /api/processrequest to finish with status 200. (Ignore anyOPTIONSpreflight row or failed request — only a200POSTcarries a validturnstileToken.) - Right-click that
processrow → Copy → Copy as cURL (on Windows, choose Copy as cURL (bash)).
humanizeai automatically detects the cURL dump on your clipboard, extracts both the Cookie header and turnstileToken, saves them to ~/.humanizeai/session.json (0600 permissions, cached for 30 minutes), and processes your file.
Why isn't there a DevTools Console JS snippet to copy the cookie? Cloudflare sets
cf_clearancewith theHttpOnlyflag, which browsers intentionally hide from JavaScript (document.cookie). No Console script can readHttpOnlycookies — using Copy as cURL from the Network tab is the built-in browser way to copy both theHttpOnlycookie and the JSONturnstileTokenin one click.
You can also pipe an already-copied cURL request directly instead of using --wait-token:
pbpaste | humanizeai --from-curl - -i examples/sample.txt -o sample.human.txt# File in, file out
humanizeai -i examples/sample.txt -o sample.human.txt
# Inline text to stdout
humanizeai --text "Paste a paragraph here to rewrite."
# Pipe from stdin
cat examples/sample.txt | humanizeai > sample.human.txt
# Batch mode (writes abstract.human.txt, intro.human.txt, ...)
humanizeai -i abstract.txt -i intro.txt --outdir humanized/
# Inspect cached session (secrets masked) or preview payload without sending
humanizeai --show-session
humanizeai -i examples/sample.txt --dry-run| Flag | Description |
|---|---|
text / --text TEXT |
Inline text to humanize. |
-i, --input PATH |
Input UTF-8 file (repeatable for batch mode). |
-o, --output PATH |
Output file path (single input; default is stdout). |
--outdir DIR |
Output directory for batch mode. |
--suffix STR |
Filename suffix for batch outputs (default: .human). |
| Flag | Description |
|---|---|
--wait-token [SECONDS] |
Poll clipboard for a Turnstile token or cURL dump (default: 120 seconds). |
--from-curl PATH|- |
Extract cookie, headers, style defaults, and token from a saved cURL dump or stdin. |
--cookie VALUE |
Override the HTTP Cookie header for this run. |
--save-cookie VALUE |
Persist a Cookie header to the session file and exit. |
--token VALUE |
Supply a Turnstile token directly. |
--token-command CMD |
Shell command whose stdout yields a fresh token. |
--token-ttl SECONDS |
Cached token lifetime in seconds (default: 1800; 0 disables caching). |
--no-cache |
Ignore any cached token for this run. |
--no-browser-cookies |
Skip reading cookies from local browser profiles. |
--session-file PATH |
Custom session file path (default: ~/.humanizeai/session.json). |
--show-session |
Print the stored session with secrets masked and exit. |
| Flag | Description |
|---|---|
--style STYLE |
standard, academic, simple, flowing, informal, formal, expand, shorten. |
--mode MODE |
quality, balanced, bypass. |
--ultra |
Enable the Ultra model (paid accounts). |
--keyword WORD |
Keyword to preserve (repeatable). |
--max-words N |
Maximum words per chunk (default: 180; 0 disables chunking). |
--json |
Emit the raw JSON response(s) to stdout. |
--dry-run |
Print the request payload without sending an HTTP request. |
-q, --quiet |
Suppress progress logs on stderr. |
Session fields can also be overridden via environment variables:
HUMANIZEAI_COOKIEHUMANIZEAI_TURNSTILE_TOKENHUMANIZEAI_SESSION_IDHUMANIZEAI_USER_AGENT
| Code | Meaning |
|---|---|
0 |
Success |
1 |
Invalid input, network error, or API rejection |
2 |
Missing browser cookie or Turnstile token |
130 |
Cancelled via Ctrl-C |
You can also import and use the client directly from Python:
from humanizeai_cli import Session, WebHumanizer, chunk_text
session = Session.load()
client = WebHumanizer(session)
for chunk in chunk_text("Your long text goes here...", max_words=180):
result = client.humanize(
chunk.text,
token=session.cached_token(ttl=1800),
style="academic",
mode="balanced",
)
print(result.text, end=chunk.separator)This repository ships a portable Agent Skill following the open Agent Skills specification so coding agents know how to check session status, walk you through copying a Turnstile token, extract plain prose safely from Markdown files, and verify output word counts and exit codes.
- Inside this repo: Automatically discovered by Antigravity and Codex via
.agents/skills/humanizeai/SKILL.md, and by Claude Code via.claude/skills/humanizeai/SKILL.md. - Use globally across any project: First install the CLI on your
PATH(pipx install git+https://github.com/igotlinux/humanizeai-cli.git), then install the skill for your agent:
# Cross-agent installer (Antigravity, Codex, Claude Code, Cursor, etc.)
npx skills add igotlinux/humanizeai-cli
# Or copy manually after cloning this repo:
# Antigravity (global)
mkdir -p ~/.gemini/config/skills && cp -R .agents/skills/humanizeai ~/.gemini/config/skills/humanizeai
# Codex CLI (global)
mkdir -p ~/.agents/skills && cp -R .agents/skills/humanizeai ~/.agents/skills/humanizeai
# Claude Code (global)
mkdir -p ~/.claude/skills && cp -R .agents/skills/humanizeai ~/.claude/skills/humanizeaihumanizeai-cli/
├── .agents/skills/humanizeai/
│ ├── SKILL.md # Portable Agent Skill (Antigravity / Codex / Claude)
│ └── references/
│ └── troubleshooting.md # Progressive-disclosure error & chunking reference
├── .claude/skills/humanizeai # Symlink to .agents/skills/humanizeai for Claude Code
├── src/humanizeai_cli/
│ ├── __init__.py # Public package API
│ ├── __main__.py # Enables `python -m humanizeai_cli`
│ ├── cli.py # CLI parser, batch runner, entry point
│ ├── client.py # HTTP client, retries, error mapping
│ ├── chunking.py # Paragraph/sentence-aware text splitting
│ ├── cookies.py # Local Chromium/Firefox cookie import
│ ├── curl.py # DevTools "Copy as cURL" parser
│ ├── errors.py # Custom exception hierarchy
│ ├── session.py # Session file storage & token TTL cache
│ └── tokens.py # Clipboard polling, extraction & prompts
├── tests/ # Unit tests (stdlib unittest, no network required)
├── examples/ # Sample input text
├── AGENTS.md # Operating guide for AI agents
├── CONTRIBUTING.md # Development & PR guidelines
└── pyproject.toml # Packaging & tool configuration
The test suite uses Python's built-in unittest module and a local stub HTTP server, without accessing any network or installing external packages:
python3 -m unittest -v| Symptom | Cause | Fix |
|---|---|---|
no cookie available |
Browser has never visited the site, or cookie DB is inaccessible | Open humanizeai.pro once in your browser, or run with --from-curl |
No turnstile token available |
Token expired or not yet cached | Rerun with --wait-token and copy a /api/process cURL |
turnstileFailure='timeout' |
Cloudflare widget did not complete in the browser | Reload humanizeai.pro, pause ad blockers, wait a few seconds, and retry |
HTTP 403 |
Token rejected or expired | Copy a fresh /api/process cURL |
HTTP 429 |
Rate limited by upstream service | Wait a few minutes before continuing |
This software is not an official client and is not associated with or endorsed by humanizeai.pro in any way. Follow the service's terms of use and rate limits. Do not use it to process code, JSON, or LaTeX blocks, since non-prose syntax will be rewritten.
Released under the MIT License.