A tiny zero-dependency CLI for generating memes via the free memegen.link API. Agent-friendly.
Project description
meme
A tiny, zero-dependency CLI for generating memes via the free memegen.link API. No API key, no signup, stdlib-only.
Built to be agent-friendly: predictable stdout, a --json mode, and a
bundled Claude Code skill so coding agents (Claude Code, Codex, etc.) can drive
it directly.
meme drake "not reading docs" "reading docs" -o out.png
Install
Requires Python 3.8+.
pip install makememe
# or, as an isolated tool:
uv tool install makememe # or: pipx install makememe
Run once without installing:
uvx --from makememe meme drake "a" "b"
Usage
meme <template> "top line" "bottom line" [-o out.png]
| Flag | Meaning |
|---|---|
-o, --out |
output file (default meme.png) |
--bg URL |
use a custom background image instead of a template |
--ext |
png (default), jpg, webp, or gif |
--style / --font |
template style variant / font override |
--print-url |
print the image URL, don't download |
--json |
machine-readable output (for scripts/agents) |
--list |
list available template ids |
Examples
meme drake "manual deploys" "ci/cd"
meme same "after I sold" "if I held" "same picture"
meme --bg https://example.com/pic.png "_" "DODGED"
meme regret "SOLD @ 620" "NOW 780 (+26%)" --print-url
meme --list
meme --list --json
Text that starts with -
If a caption line begins with - (e.g. "-26%"), put -- before your lines so
it isn't parsed as a flag:
meme regret --json -- "-26%" "WHY"
(Put flags like --json/-o before the --.)
For agents (Claude Code / Codex / scripts)
The tool is designed to be parsed:
-
Plain mode prints only the output path to stdout (status goes to stderr), so
path=$(meme drake "a" "b")just works. -
--jsonmode prints a single JSON object:{ "path": "meme.png", "bytes": 12345, "url": "https://api.memegen.link/..." }
--list --jsonreturns the template catalog as JSON;--print-url --jsonreturns{"url": "..."}; failures return{"error": "...", "url": "..."}with a non-zero exit code.
Typical agent flow:
meme --list --json # discover template ids
meme drake "old way" "new way" --json # generate, capture the path
Claude Code skill
A ready-made skill lives in skill/meme/. Install it so
Claude Code auto-discovers the tool:
# user-level (all projects)
mkdir -p ~/.claude/skills
cp -r skill/meme ~/.claude/skills/meme
# or project-level
mkdir -p .claude/skills
cp -r skill/meme .claude/skills/meme
Then just ask Claude Code things like "make a drake meme about writing tests"
and it will call meme for you.
Robustness
The CLI is built to fail gracefully, never with a raw traceback:
- Network errors, dead hosts, bad template ids (404), oversized text (414), and non-image backgrounds (415) all exit non-zero with a one-line message — and no partial/garbage file is written.
Ctrl-Cexits cleanly (code 130); piping intoheadetc. won't spew aBrokenPipeError.- Arbitrary text — emoji, CJK,
% # & / ? " \, tabs, control chars, 10k-char lines — is escaped safely.
Run the test suite (stdlib only, no network needed):
python -m unittest discover -s tests
How it works
It builds a memegen.link URL from your template + text (handling all the fiddly
path-segment escaping — spaces, _, -, ?, /, %, etc.), downloads the
image, and saves it. That's the whole trick.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file makememe-0.1.0.tar.gz.
File metadata
- Download URL: makememe-0.1.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59d031085b55fee3de8deabacb445a4b6ded0c6d299e45f7ebe9f2fb19626f3d
|
|
| MD5 |
fe50d707ef46c5f3ac9e0f8355fc9a8e
|
|
| BLAKE2b-256 |
5d793e0e3bbd10ee140f22d74eeada15568ed8b9710a92176801b0fa39b71304
|
File details
Details for the file makememe-0.1.0-py3-none-any.whl.
File metadata
- Download URL: makememe-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6d5ba8bfe9e0199ab59e8e872ffc1de67371e8ea9b7ae6f111e03b314b826af
|
|
| MD5 |
056eee3bab8936f819d7e8ee52b85bae
|
|
| BLAKE2b-256 |
02b5d70362efab10787c47c823a626a6d961c180394693818ec3f61e1e1e4f89
|