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.0

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.0
File Size Uploaded
nbr23_recraft-0.4.0.tar.gz 22.5 kB Details

Built distribution (wheel)

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

Total release size: 40.4 kB

Release files / nbr23_recraft-0.4.0.tar.gz

Download URL nbr23_recraft-0.4.0.tar.gz
Size 22.5 kB
Tags Source
SHA-256 checksum
How to use checksums
691f620d43df7c3c3d52085bccfa716d69c0d58303c1c5e88a720cd8ce3e1274
BLAKE2b-256 checksum
How to use checksums
ab608a84b8788ac3c1122a309e7851ff8a0483c09b48f9d150f312515c5a6320
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 12, 2026.

Transparency log

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

Download URL nbr23_recraft-0.4.0-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99cb2ecc5e2b25fd13fd4324eb8d0ddb68a4afc057bfcb8728d7a35c04309c3a
BLAKE2b-256 checksum
How to use checksums
7e3ee560f464e2f98cb484cbdc49f160636ce5ffedff2fe04140fcf33961a505
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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