cheatmd

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: MIT

README

CheatMD

CI Go Report Card

Executable Markdown cheatsheets. Write readable docs, run interactive commands.

demo

Install

go install github.com/cheatmd-dev/cheatmd/cmd/cheatmd@latest

Requires Go 1.26+.

Quick Start

cheatmd                    # Browse current directory
cheatmd ~/cheats           # Browse a cheats directory
cheatmd -q "docker"        # Start with a search query
cheatmd init               # Initialize default config
cheatmd --lint ~/cheats    # Check cheats for syntax/reference issues
cheatmd packs install      # Install starter cheat packs

Any Markdown heading with a code block can become a cheat:

## Docker: exec into container

```sh title:"Execute shell in container"
docker exec -it $container /bin/sh
```
<!-- cheat
var container = docker ps --format "{{.Names}}" --- --header "Select container"
-->

What It Does

  • Fuzzy-search cheats by title, command, tags, and description
  • Prompt for variables using shell output, editable defaults, or pickers
  • Reuse variable definitions with modules
  • Run ordered multi-step workflows with chains
  • Lint cheat syntax, imports, chains, and variables
  • Export parsed metadata as JSON or CSV
  • Convert existing navi, tldr, and cheat/cheatsheets collections
  • Run headless over JSON-RPC for editor integrations

Editor Extensions

  • VS Code - syntax highlighting, diagnostics, completion, and CodeLens execution
  • Neovim - syntax highlighting, async diagnostics, completion, and :CheatMDRun
  • Obsidian - inline run buttons, lint status, execution results, and variable autocomplete

Documentation

Full documentation lives in the Wiki:

Contributing

See CONTRIBUTING.md.

Support

If CheatMD saves you time, you can support the project on Ko-fi.

License

MIT

Directories

Path Synopsis
cmd
cheatmd command
Command cheatmd is an executable Markdown cheatsheet tool.
Command cheatmd is an executable Markdown cheatsheet tool.
internal
headless
Package headless provides headless execution of cheats without a TUI.
Package headless provides headless execution of cheats without a TUI.
history
Package history records and reads the user's cheat execution history.
Package history records and reads the user's cheat execution history.
httputil
Package httputil provides common HTTP client utilities.
Package httputil provides common HTTP client utilities.
installer
Package installer installs cheat packs from the registry onto the local machine.
Package installer installs cheat packs from the registry onto the local machine.
packmanifest
Package packmanifest records which cheat packs have been installed into a cheats directory.
Package packmanifest records which cheat packs have been installed into a cheats directory.
resolver
Package resolver acts as a bridge connecting the parsed AST to the UI and Executor engines.
Package resolver acts as a bridge connecting the parsed AST to the UI and Executor engines.
shellgen
Package shellgen generates shell scripts for bash and zsh bindings and widgets (such as the ctrl+g interactive widget) that integrate cheatmd natively into the user's shell environment.
Package shellgen generates shell scripts for bash and zsh bindings and widgets (such as the ctrl+g interactive widget) that integrate cheatmd natively into the user's shell environment.
ui
Package ui implements the primary BubbleTea Terminal User Interface (TUI) for navigating cheats, resolving variables interactively, and previewing markdown documentation.
Package ui implements the primary BubbleTea Terminal User Interface (TUI) for navigating cheats, resolving variables interactively, and previewing markdown documentation.
pkg
chainstate
Package chainstate manages persistent state for multi-step chained cheats.
Package chainstate manages persistent state for multi-step chained cheats.
config
Package config handles loading, parsing, and managing the global cheatmd configuration and user preferences from disk.
Package config handles loading, parsing, and managing the global cheatmd configuration and user preferences from disk.
convert
Package convert provides utilities for migrating legacy cheat sheet formats (such as .navi) into the standard Markdown-based AST format used by cheatmd.
Package convert provides utilities for migrating legacy cheat sheet formats (such as .navi) into the standard Markdown-based AST format used by cheatmd.
executor
Package executor is the core execution engine responsible for resolving variable dependencies, substituting values securely into shell commands, and dispatching those commands to the local shell environment or clipboard.
Package executor is the core execution engine responsible for resolving variable dependencies, substituting values securely into shell commands, and dispatching those commands to the local shell environment or clipboard.
linter
Package linter checks a cheatmd cheats directory for problems.
Package linter checks a cheatmd cheats directory for problems.
parser
Package parser is the foundational Markdown engine for cheatmd.
Package parser is the foundational Markdown engine for cheatmd.
registry
Package registry fetches and parses the CheatMD cheat-pack registry: a remote YAML manifest that lists installable cheat repositories ("packs").
Package registry fetches and parses the CheatMD cheat-pack registry: a remote YAML manifest that lists installable cheat repositories ("packs").

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL