Skip to main content

recraft-cli

CLI for the Recraft AI image API, built to be driven by an LLM coding agent. Writes image files to disk and prints their paths — image bytes never touch stdout.

Spends API credits, never subscription credits.

Unofficial. Not affiliated with, endorsed by, or supported by Recraft AI.

Install

Requires uv.

Codex

Register the GitHub repository as a marketplace, then install the plugin:

codex plugin marketplace add nbr23/recraft-cli
codex plugin add recraft@nbr23

Start a new Codex thread after installation so the recraft skill is loaded. Then ask naturally:

generate an icon of a red bicycle, save it as bike.svg
remove the background from screenshot.png
vectorize this logo
what's my Recraft balance?

The skill selects the appropriate command and flags. Type @ and choose Recraft to invoke it explicitly.

Claude Code

The plugin adds recraft to the Bash tool's PATH, plus a skill telling Claude when to use it:

/plugin marketplace add nbr23/recraft-cli
/plugin install recraft@nbr23

Then allow it once in .claude/settings.json to stop the per-call permission prompt:

{ "permissions": { "allow": ["Bash(recraft:*)"] } }

Third-party marketplaces don't auto-update by default, so new releases won't reach you on their own. Pull them with:

/plugin marketplace update nbr23

or turn on auto-update for this marketplace from /plugin → Marketplaces.

Usage

Once installed, just ask Claude naturally — the skill tells it when to reach for recraft:

> generate an icon of a red bicycle, save it as bike.svg
> remove the background from screenshot.png
> vectorize this logo
> what's my Recraft balance?

Claude picks the right subcommand and flags; you don't need to know the CLI syntax yourself. To force it to load the skill instead of relying on auto-detection, invoke it explicitly with /recraft:recraft (plugin skills are namespaced as /plugin-name:skill-name).

As a standalone CLI:

uv tool install nbr23-recraft   # or: uvx nbr23-recraft --help

Token

From RECRAFT_API_TOKEN, falling back to ~/.config/recraft/token (mode 0600). Get one from the Recraft API console.

export RECRAFT_API_TOKEN='...'

Examples

recraft balance
# 12345 API credits ($12.345)

recraft generate "a red bicycle on a white background" -o bike.png
# /abs/path/bike.png  1024x1024  recraftv4_1  35 credits ($0.035)

recraft generate "a minimal bicycle icon" --vector -o bike.svg
recraft vectorize bike.png -o bike.svg              # ~10 credits
recraft remove-bg bike.png -o bike-cutout.png       # ~10 credits
recraft upscale bike.png --mode crisp -o bike-2x.png   # ~4 credits; creative is ~250

recraft generate "a red bicycle" --dry-run          # print the request, spend nothing
recraft generate "a red bicycle" -o bike.png --json # one JSON object on stdout

recraft models      # ids and per-image price
recraft styles      # valid style / model combinations

recraft --help lists every command; recraft COMMAND --help documents its flags with an example.

Metadata

Release files for nbr23-recraft 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nbr23-recraft 0.4.1
File Size Uploaded Provenance Actions
nbr23_recraft-0.4.1.tar.gz 22.6 kB With provenance Details for nbr23_recraft-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nbr23-recraft 0.4.1
File Interpreter ABI Platform Actions
nbr23_recraft-0.4.1-py3-none-any.whl Python 3 none any Details for nbr23_recraft-0.4.1-py3-none-any.whl

Total release size: 40.5 kB

Release files / nbr23_recraft-0.4.1.tar.gz

Download URL nbr23_recraft-0.4.1.tar.gz
Size 22.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e1ab8fd3dba6c9ef6ff6341a11ff803dd4323b31b900223733131a8dcbcb1463
BLAKE2b-256 checksum
How to use checksums
3d6097ddc9dff1347bba7cef793aa556c91ff62fded15270cde09e076c7f1c2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / nbr23_recraft-0.4.1-py3-none-any.whl

Download URL nbr23_recraft-0.4.1-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9687e7ea79b1e5cbcacade269a8c31cc2f217a6e7d7d4e694f01b2e22ed57835
BLAKE2b-256 checksum
How to use checksums
6933382d00741781b5f43f259cbf0249a58e6c3233a779acfa181e39ae76f763
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for nbr23-recraft 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nbr23_recraft-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page