2 min read

Writing cheat sheets

Table of Contents

Each cheat sheet is a .yaml or .yml file containing a name, description, and one or more sections.

name: Docker
description: Core Docker and Compose commands
sections:
  - title: Containers
    items:
      - key: docker ps
        desc: List running containers
      - key: docker exec -it <id> sh
        desc: Open a shell in a container
  - title: Compose
    items:
      - key: docker compose up -d
        desc: Start services in the background

Discovery order

chtrs searches these locations in order:

  1. ./cheat-sheets in the current directory.
  2. ~/.config/chtrs/cheat-sheets.
  3. ~/.config/chtrs.
  4. cheat-sheets beside the installed executable.

The first sheet with a given name wins, so a project-local sheet can override a user-wide or bundled sheet without modifying it. Loaded sheet names are sorted alphabetically in the interface.

Use project-local sheets for repository-specific commands and the personal configuration directory for references you want available everywhere.