Dump
The dump subcommand exports parsed cheat metadata for indexing, debugging,
or feeding into external tools.
Usage
cheatmd dump ~/cheats # JSON (default)
cheatmd dump ~/cheats --json # Explicit JSON
cheatmd dump ~/cheats --csv # CSV format Output fields
Each cheat produces a record with:
| Field | Description |
|---|---|
file | Source .md file path |
tags | Merged tag list |
title | Cheat heading text |
description | Code block title:"..." attribute |
command | The command template |
chain_name | Chain name (if part of a chain) |
chain_step | Chain step number (if part of a chain) |
variables | List of variable definitions |
Each variable entry includes:
| Field | Description |
|---|---|
name | Variable name |
kind | One of prompt, shell, literal |
shell | Shell command (for shell kind) |
literal | Literal value (for literal kind) |
condition | if condition (if inside a conditional) |
Variable kinds
| Kind | DSL form | Example |
|---|---|---|
prompt | var name | var host |
shell | var name = command | var branch = git branch |
literal | var name := value | var url := https://example.com |
JSON example
cheatmd dump ~/cheats | jq '.[0]' {
"file": "/full/path/to/docker.md",
"tags": ["full", "path", "to", "docker", "shell"],
"title": "Docker: exec into container",
"description": "Open a shell in a running container",
"command": "docker exec -it $container /bin/sh",
"variables": [
{
"name": "container",
"kind": "shell",
"value": "docker ps --format '{{.Names}}'",
"args": "--header 'Container Name?'"
}
]
} Use cases
- Search indexing: pipe JSON into a search engine or
jqqueries - Documentation generation: build a cheat index page from metadata
- CI validation: check that all cheats have descriptions, tags, etc.
- Debugging: inspect how CheatMD parsed a complex cheat block
See also
- Linting - validating cheats
- [Writing Cheats](/docs/writing cheats) - cheat structure