CLI Reference
Every command, flag, and option.
Synopsis
myflames [options] [explain.json]
myflames -h HOST -u USER -p -D DB -e 'SQL' -o report.html
myflames compare before.json after.json --output diff.html
myflames teach <lesson> [-o file.html]
myflames guide
Rendering options
| Option | Default | Description |
|---|---|---|
--type TYPE | flamegraph | flamegraph, bargraph, treemap, diagram, tree |
--output FILE, -o | stdout | .html = self-contained report; .svg = responsive SVG. JSON sidecar auto-written alongside. |
--width N | 1800 / 1200 | SVG width in pixels |
--height N | 32 | Frame height (flamegraph only) |
--colors SCHEME | hot | hot, mem, io, red, green, blue (flamegraph only) |
--title TEXT | MySQL Query Plan | Chart title shown in the SVG header |
--inverted | off | Icicle graph — roots at the top (flamegraph only) |
--no-enhance | off | Disable detailed tooltips (flamegraph only) |
Live connection
Same flags as the mysql CLI. Providing -h enables live mode.
| Option | Description |
|---|---|
-h HOST, --host | Connect to this host (enables live mode) |
-P PORT | Port number (default: 3306) |
-u USER | Username |
-p[PASS] | Password. -p alone prompts; -p'secret' inline. |
-D DB | Default database |
-e SQL, --execute | Query to EXPLAIN ANALYZE (required in live mode) |
--ssl-mode MODE | DISABLED, PREFERRED, REQUIRED, VERIFY_CA, VERIFY_IDENTITY |
--ssl-ca PATH | CA certificate file for TLS verification |
--ssl-cert PATH | Client certificate for mutual TLS |
--ssl-key PATH | Client private key for mutual TLS |
--mysql-binary PATH | Override mysql/mariadb binary autodetection |
--no-collect-schema | Skip SHOW CREATE TABLE collection |
--no-collect-stats | Skip information_schema.tables row/size collection |
--no-collect-variables | Skip SHOW SESSION VARIABLES collection |
Password security: Passwords are written to a mode-0600 temporary
--defaults-extra-file and never appear in ps, environment variables, or logs. The temp file is deleted on exit.
JSON sidecar
| Option | Description |
|---|---|
| (default) | Auto-writes <output>.json alongside the HTML/SVG |
--sidecar PATH | Write sidecar to a specific path |
--no-sidecar | Suppress sidecar generation |
Subcommands
myflames compare
myflames compare before.json after.json --output diff.html
Side-by-side before/after comparison showing total time delta, per-operator self-time/rows/loops changes, and new/resolved warnings.
myflames guide
myflames guide
Interactive guide that helps you pick the right view type for your situation.
myflames teach
myflames teach # list available lessons
myflames teach btree -o btree.html # render a lesson
Generate self-contained HTML lessons that animate database algorithms. See the Teach Lessons index for the full catalog.
| Option | Description |
|---|---|
lesson | Lesson name: btree, bnl, hash, join, lru, filesort, tmp, icp, index_merge |
--output FILE, -o | Write HTML to file (default: stdout) |
--title TEXT | Override the lesson title |
Query embedding
| Option | Description |
|---|---|
--query SQL | Embed the original SQL in the output for reference |
--query-file PATH | Read the original SQL from a file |
Environment variables
myflames does not read any environment variables. All configuration is through CLI flags.
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Runtime error (parse failure, connection error, file not found) |
2 | Invalid arguments (argparse) |