Skip to main content

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+. Easiest is uv (installs the meme command in its own isolated environment):

uv tool install makememe          # or: pipx install makememe

Update later with:

uv tool upgrade makememe

Run once without installing anything:

uvx --from makememe meme drake "a" "b"

(If you specifically want pip: python3 -m pip install makememe.)

Check the version anytime:

meme --version

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.

  • --json mode prints a single JSON object:

    { "path": "meme.png", "bytes": 12345, "url": "https://api.memegen.link/..." }
    

    --list --json returns the template catalog as JSON; --print-url --json returns {"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

The package bundles a Claude Code skill. After installing, run one command to make Claude Code auto-discover the tool:

meme --install-skill              # installs into ~/.claude/skills/meme/ (all projects)
meme --install-skill --project    # or into ./.claude/skills/meme/ (this repo only)

Restart Claude Code, then just ask things like "make a drake meme about writing tests" and it will call meme for you.

(Other agents like Codex don't use this skill format — they discover everything through meme --help and meme --list, which already works out of the box.)

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-C exits cleanly (code 130); piping into head etc. won't spew a BrokenPipeError.
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

makememe-0.1.2.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

makememe-0.1.2-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file makememe-0.1.2.tar.gz.

File metadata

  • Download URL: makememe-0.1.2.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for makememe-0.1.2.tar.gz
Algorithm Hash digest
SHA256 58032463093397824f35bc94d3519c3c27a6d63463bf19c1b0292b26bf423874
MD5 8fb19d41c3850bdf2e9474b13f2f8eb1
BLAKE2b-256 7d0f23caafff15fef53c24473dce5b0922091d6b19d86ee6dcfb68e1d9e3c3a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for makememe-0.1.2.tar.gz:

Publisher: publish.yml on dhruvmehra/makememe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file makememe-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: makememe-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for makememe-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b2f662a009ffd540d8854b02aa59f03e392a8ed4923b96eaed2cb4def0e0e22
MD5 e236fae734af1df286c5f86bffad3a2e
BLAKE2b-256 5ee69a19df2cbee82e20d34ccd93a84bafc7878723538abf4ada77de5d7bfad5

See more details on using hashes here.

Provenance

The following attestation bundles were made for makememe-0.1.2-py3-none-any.whl:

Publisher: publish.yml on dhruvmehra/makememe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page