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

OptionDefaultDescription
--type TYPEflamegraphflamegraph, bargraph, treemap, diagram, tree
--output FILE, -ostdout.html = self-contained report; .svg = responsive SVG. JSON sidecar auto-written alongside.
--width N1800 / 1200SVG width in pixels
--height N32Frame height (flamegraph only)
--colors SCHEMEhothot, mem, io, red, green, blue (flamegraph only)
--title TEXTMySQL Query PlanChart title shown in the SVG header
--invertedoffIcicle graph — roots at the top (flamegraph only)
--no-enhanceoffDisable detailed tooltips (flamegraph only)

Live connection

Same flags as the mysql CLI. Providing -h enables live mode.

OptionDescription
-h HOST, --hostConnect to this host (enables live mode)
-P PORTPort number (default: 3306)
-u USERUsername
-p[PASS]Password. -p alone prompts; -p'secret' inline.
-D DBDefault database
-e SQL, --executeQuery to EXPLAIN ANALYZE (required in live mode)
--ssl-mode MODEDISABLED, PREFERRED, REQUIRED, VERIFY_CA, VERIFY_IDENTITY
--ssl-ca PATHCA certificate file for TLS verification
--ssl-cert PATHClient certificate for mutual TLS
--ssl-key PATHClient private key for mutual TLS
--mysql-binary PATHOverride mysql/mariadb binary autodetection
--no-collect-schemaSkip SHOW CREATE TABLE collection
--no-collect-statsSkip information_schema.tables row/size collection
--no-collect-variablesSkip 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

OptionDescription
(default)Auto-writes <output>.json alongside the HTML/SVG
--sidecar PATHWrite sidecar to a specific path
--no-sidecarSuppress 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.

OptionDescription
lessonLesson name: btree, bnl, hash, join, lru, filesort, tmp, icp, index_merge
--output FILE, -oWrite HTML to file (default: stdout)
--title TEXTOverride the lesson title

Query embedding

OptionDescription
--query SQLEmbed the original SQL in the output for reference
--query-file PATHRead the original SQL from a file

Environment variables

myflames does not read any environment variables. All configuration is through CLI flags.

Exit codes

CodeMeaning
0Success
1Runtime error (parse failure, connection error, file not found)
2Invalid arguments (argparse)