---
name: meme
description: 'Find meme templates and caption them, with meme-cli. Tools: caption, catalog, list, templates. Use when a request needs any of these; each tool''s own trigger is in SKILL.md.'
compatibility: 'Requires fragletc and Docker. Hermetic: no network access.'
metadata:
  tags: media
  tools: caption.sh, catalog.sh, list.sh, templates.sh
---

# Meme

Find meme templates and caption them, with meme-cli.

Every tool below is one executable file beside this `SKILL.md`, in the directory the commands below call `<skill-dir>`. Run it directly. Two host requirements: [`fragletc`](https://github.com/ofthemachine/fraglet) (`curl -fsSL https://raw.githubusercontent.com/ofthemachine/fraglet/main/install.sh | sh && fragletc version`) and Docker; the image, parameters, outputs and network reach are declared in the file itself. Before running a tool, print its contract:

```sh
<skill-dir>/caption.sh --fraglet-help
```

Parameters are passed as `-p name=value` (a `file` parameter takes a host path); declared outputs are copied out with `--output <name>[=<host path>]`. A missing required parameter fails host-side with exit 2 before any container starts; otherwise the tool's own exit code is the run's. A declared output not named with `--output` is produced and discarded (a stderr note says what you could have copied). Add `--receipt run.json` (or set `FRAGLETC_RECEIPT_DIR`) to record the run: the receipt carries the tool's `procedure_hash`, image digest, parameters, and every input and output by content hash, and `receipt/attest.py` can verify it later without re-running anything.

## Tools

### `caption.sh`

Render a caption onto a meme-cli template. lines is a single "|"-delimited string, one caption per box in order, whatever the box count -- a 1-box template is just "one caption", a 2-box is "top|bottom", an 8-box is "a|b|c|d|e|f|g|h". Run templates.sh show <id> first to check the real box count/order.

Use when the user wants a meme rendered from a known template with specific captions.

```sh
<skill-dir>/caption.sh -p template="<template>" -p lines="<lines>" --output meme.png
```

Parameters:
- `template` (string, required) — meme-cli template id (find with templates.sh search/show)
- `lines` (string, required) — Captions joined by |, one per box in template order

Outputs:
- `meme.png` — copy out with `--output meme.png[=<host path>]`

Runs in `ofthemachine/meme@sha256:8a3ac29b110b9471e7688bf8d7bdc12fe83fd49da63a084a3db1a41549b6c57f`; hermetic — `network=none`; a run is a pure function of its inputs and safe to memoize.

### `catalog.sh`

Dump the whole meme catalog in one run: meme-cli list --json. Each template's alias is its id, its field count is the length of text_boxes, and its description is name. The image has no shell, so this is its own fraglet rather than a flag on templates.sh.

Use when a caller needs every template at once — alias, field count, description — to choose one.

```sh
<skill-dir>/catalog.sh
```

Parameters:
- none

Outputs:
- stdout

Runs in `ofthemachine/meme@sha256:8a3ac29b110b9471e7688bf8d7bdc12fe83fd49da63a084a3db1a41549b6c57f`; hermetic — `network=none`; a run is a pure function of its inputs and safe to memoize.

### `list.sh`

Every meme template, one per line: its id, how many captions it takes ("2 boxes") and its name, in columns at least two spaces apart (meme-cli list). For keywords and box geometry, meme/catalog's JSON.

Use when a caller needs the template ids to choose from, as plain lines.

```sh
<skill-dir>/list.sh
```

Parameters:
- none

Outputs:
- stdout

Runs in `ofthemachine/meme@sha256:8a3ac29b110b9471e7688bf8d7bdc12fe83fd49da63a084a3db1a41549b6c57f`; hermetic — `network=none`; a run is a pure function of its inputs and safe to memoize.

### `templates.sh`

Browse meme-cli's template library: templates.sh search <term>, templates.sh show <template> (boxes and their order), templates.sh list (popular templates), or templates.sh llms (meme-cli's guidance for LLMs). Arguments pass straight through to meme-cli; there are no -p parameters.

Use when the user wants to find a meme template, check a template's box count and order, list popular templates, or read meme-cli's guidance for LLMs.

```sh
<skill-dir>/templates.sh
```

Parameters:
- none

Outputs:
- stdout

Runs in `ofthemachine/meme@sha256:8a3ac29b110b9471e7688bf8d7bdc12fe83fd49da63a084a3db1a41549b6c57f`; hermetic — `network=none`; a run is a pure function of its inputs and safe to memoize.
