# Using PyKevlar Directly from Claude Code, OpenAI Codex & AI Coding Tools

> Drop-in instructions and configuration snippets so Claude Code, OpenAI Codex CLI/Cloud, Cursor, Windsurf, and Google Antigravity can build, harden, and verify your Python binaries autonomously.

---

## 1. One-Shot Prompt (Claude Code / Codex / Cursor)

Paste this directly into **Claude Code** (`claude`) or **OpenAI Codex** (`codex`):

```text
Read https://pykevlar.com/llms-full.txt first. Install pykevlar if missing (`curl -fsSL https://pykevlar.com/install.sh | sh`), check `pykevlar license`, and create a `scripts/release.sh` that compiles our Python entrypoint into a verified single-file executable (`-F --anti-llm --enable-bcc`) protecting all first-party packages while excluding test dependencies. If no Pro/Team subscription is registered yet, test packaging with `--no-armor` first and verify the binary runs.
```

---

## 2. Drop-In `CLAUDE.md` / `AGENTS.md` Block

Add this section to your repository's `CLAUDE.md` (for Claude Code) or `AGENTS.md` (for OpenAI Codex, Cursor, Windsurf, and Antigravity):

```markdown
## Binary Packaging & Anti-Reverse-Engineering (PyKevlar)

We use `pykevlar` (single standalone Rust + C binary, docs: https://pykevlar.com/llms-full.txt) instead of PyArmor + PyInstaller.

- Check installation & subscription tier: `pykevlar --version && pykevlar license`
- Unprotected local test freeze (Basic Free): `pykevlar build <entry.py> --python .venv/bin/python --no-armor -F -O dist`
- Production anti-reverse-engineering release (requires Pro $39/yr or Team $79/yr subscription):
  `pykevlar build <entry.py> --python .venv/bin/python --protect <first_party_pkg> --anti-llm --enable-bcc -F -O dist`
- Always run `pykevlar verify dist/<binary> --protect <first_party_pkg>` after protected builds to assert zero leaked `.py` files.
- Never commit `.superpyarmor_project.key`, `*.lic`, or `PYKEVLAR_LICENSE` secrets to git.
```

---

## 3. Claude Code Slash Command (`.claude/commands/armor-release.md`)

Save to `.claude/commands/armor-release.md` to run `/armor-release` anytime inside Claude Code:

```markdown
Fetch https://pykevlar.com/llms-full.txt if you need flag details.
1. Ensure `~/.local/bin/pykevlar` is installed and check `pykevlar license`.
2. Identify our Python entrypoint, active virtualenv interpreter, and all first-party source packages.
3. If `pykevlar license` shows Pro or Team, build a single-file hardened binary with `--anti-llm --enable-bcc` and verify zero `.py` leaks with `pykevlar verify`.
4. If `pykevlar license` shows Basic (Free), verify a clean `--no-armor` build first and print the exact production command ready to run once `pykevlar register` is completed.
```

---

## 4. OpenAI Codex Cloud / CI Setup (`PYKEVLAR_LICENSE`)

In **Codex Cloud** environments or **GitHub Actions** (Team $79/yr tier):
1. Add secret `PYKEVLAR_LICENSE` set to your raw `PKV1....` token from `https://pykevlar.com/portal`.
2. Add to your setup script:
   ```bash
   curl -fsSL https://pykevlar.com/install.sh | sh
   export PATH="$HOME/.local/bin:$PATH"
   pykevlar license
   ```
