muon(1)
π muon β a meson-compatible build system π
okay bestie, sit down, we're learning muon (that's the manual page muon(1) from the General Commands Manual section, iykyk) and it's genuinely so good.
β¨ NAME β¨
muon β a meson-compatible build system. that's it, that's the girl. she builds your stuff and she's compatible with meson and she eats every time. π
πΈ SYNOPSIS πΈ
muon [-vh] [-C <chdir>] <command> [<args>]
muon setup [-D[subproject:]option=value...] build
cd build
<invoke backend build tool>
muon test [options]
muon install [options]
look at that shape. it's giving workflow. π
π¦ DESCRIPTION π¦
so here's the vibe: muon interprets source files written in the meson dsl and produces buildfiles for a backend. that's literally the whole job description. no cap.
when you're building meson projects with muon, you typically first start by running the setup command in the project root. this creates buildfiles for the backend in the build dir you specify. π
then you invoke the backend, e.g.
ninja -C <build dir>
and if the project defines tests, you may run them with the test subcommand, and finally install the project with the install subcommand. chef's kiss, that's the full loop. π
β OPTIONS β
the top-level flags, bestie, memorize them:
-vβ enable verbose output. she's chatty, let her talk. π£οΈ-qβ silence logging except for errors. quiet luxury. π€«-C <path>β chdir to path before executing a command. yes she'll walk there first. πΆββοΈ-hβ print a help message. the classic. π«Ά
π COMMANDS π
muon requires a command. like, you can't just show up with no command and expect the main character moment to happen. π
all commands accept a -h option which prints a brief summary of their usage. so if you ever get lost, just -h and breathe. π
π analyze
muon analyze [-l] [-m <mode>] [-q] [-O <path>] [-W
[no-]<diagnostic|list|error>] [command]
run a static analyzer on the current project. she's reading your code and she has opinions. π
OPTIONS:
-lβ optimize output for editor linter plugins. for example, a diagnostic is added for thesubdir()callsite, so that the editor can highlight subdirs with errors in them. lowkey genius. β¨-m <mode>β set the language mode.-qβ only report errors. no side quests.-O <path>β read project file with matching path from stdin. this is useful for editor linter plugins that run as you type on files that aren't saved to disk. not me saving nothing and still getting linted π-W [no-]<diagnostic>β enable or disable a particular diagnostic, e.g.unused-variable.-W listβ list available diagnostics. window shopping, but for warnings. ποΈ-W errorβ turn all warnings into errors. she's not playing around anymore. π₯
COMMANDS:
traceβ print a tree of all meson source files that are evaluated. π³lspβ run the analyzer as a language server.root-for <path>β given the path to a file, try to determine the project's root. detective energy. π΅οΈββοΈfile <path>β run the analyzer in single file mode. implies-m module, but-m scriptcan be passed to analyze a file in script mode. this is useful for catching bugs in scripts that will be evaluated with muon internaleval, or script modules. π
π fmt
muon fmt [-i] [-q] [-l] [-c <muon_fmt.ini>] <file>[ <file>[...]]
format a source file. glow-up service, free of charge. π
OPTIONS:
-qβ exit with1if files would be modified bymuon fmt. the vibe check, essentially. π«§-lβ like-qbut also print failing filenames. so she names names. π-iβ format files in-place. yes she's editing your file. trust the process. π-c <muon_fmt.ini>β read configuration frommuon_fmt.ini.-eβ try to read configuration from.editorconfig. only indentation related settings are recognized. so don't get any ideas about the rest. π
okay that's part 1, and there's more coming, so don't go anywhere bestie β we're not even close to done. π§ββοΈ
β¨ CONFIGURATION OPTIONS β¨
okay bestie, this is the whole vibe-tuning section π every one of these keys lives in your config, and here's the tea on each one: its type, its default, and what it actually does to your precious code. π
max_line_lenβ int, default80β the maximum length of lines before they get split. yes, she's strict. yes, she's doing it for your own good. βοΈindent_styleβ space or tab, defaultspaceβ whether you're a spaces girlie or a tabs girlie for indentation. choose your fighter. πindent_sizeβ int, default4β whenindent_style = space, this is how many spaces you indent by per level. four. it's always four. πΈinsert_final_newlineβ bool, defaulttrueβ whether or not to insert a trailing newline at the end of the file. yes queen, end your files politely. π«Άend_of_lineβ lf, crlf, or cr, default<unset>β the type of line ending to use. if this value is not set, then the line ending of the first line in the source file gets used instead. no cap, she just copies the first line's whole energy. π¦space_arrayβ bool, defaultfalseβ whether to include spaces around array elements (ex.[1]vs[ 1 ]). pick a lane and commit bestie. β¨kwargs_force_multilineβ bool, defaultfalseβ makes every dictionary literal and function call with kwargs expand into multiple lines. she's dramatic like that, everything gets the full spread. π₯wide_colonβ bool, defaultfalseβ whether to put a space before the colon operator (ex.key : val). wide. colon. energy. πno_single_comma_functionβ bool, defaultfalseβ don't add a trailing comma to multi-line function calls with only one argument. sometimes one arg is enough, and that's valid. πsort_filesβ bool, defaulttrueβ whether to sort the arguments offiles(). alphabetical besties stay winning. πgroup_arg_valueβ bool, defaulttrueβ whether to group strings in array literals such that command line arguments that take a value remain on the same line as the value. the heuristic used is that if a string starts with-and the next string does not, put both strings on the same line. so-oand its lil buddy stay together, they're a package deal. πsimplify_string_literalsβ bool, defaultfalseβ whether to automatically convert multiline string literals without newlines, as well as f-strings without formatting, into single-quoted string literals. glow-down for the better. β¨indent_before_commentsβ str, default' 'β the indent to put before trailing comments. one lil space of respect. πsticky_parensβ bool, defaultfalseβ controls whether parenthesis used for grouping are stuck to what they enclose, or are exploded out to be on their own lines. clingy or independent, her choice. πcontinuation_indentβ bool, defaultfalseβ controls whether a multiline conditional in- β¦and an
ifstatement gets an extra indent. yes bestie that's the whole rule, slay π
β¨ install β¨
muon install [-n]
Installs the project, fr fr. The DESTDIR environment variable is respected and will prefix all installation directories if it's present. π
OPTIONS:
-nβ dry run π-d <destdir>β set destdir
πΈ internal πΈ
muon internal <command> [<args>]
internal holds a bunch of subcommands that muon uses on itself. Heads up though bestie: these commands are subject to change at any time and you should not rely on them. Also not all internal commands are even documented. π
COMMANDS:
evalβ evaluate a source fileexeβ execute a commandreplβ start a meson dsl repldump_funcsβ output all supported functions and arguments
π internal check π
muon internal check [-p|-d] [-m <mode>] <filename>
Checks if filename parses. vibe check but for syntax, iykyk π¦
OPTIONS:
-pβ print the parsed ast-dβ print the dissasembly-m <mode>β set the compilation mode-fβ parse in formatting mode
β¨ internal eval β¨
muon internal eval [-e] [-s] -c <command> | <filename> [<args>]
Evaluate a source file. Lowkey important: the interpreter environment here is substantially different from the typical environment you get during setup. Build related functions are unavailable, plus a bunch of other functions including subdir. And on top of that, the variable argv is defined as an array containing the commandline starting at <filename>. π
OPTIONS:
-eβ lookup<filename>as an embedded script-sβ disable functions that are unsafe to be called at random, particularlyrun_command(). The motivation for this flag is so that automated fuzz testing can be used without accidentally executing something likerun_command('rm', '-rf', '/'). π genuinely do not skip this one-c <command>β evaluate the stringcommandrather than reading from a file
π§ internal exe π§
muon internal exe [-f <input file>] [-c <output file>] [-e <env.dat>] [-a <args.dat>] [-R <file>] [-- <cmd> [<args>]]
Execute <cmd> with arguments <args>. π«Ά
OPTIONS:
-f <input file>β passinput fileas stdin to<cmd>-c <output file>β capture stdout of<cmd>and write it tooutput file-e <env.dat>β read and set environment variables fromenv.dat-a <args.dat>β read and set command fromargs.dat-R <file>β removefileif it exists before executing the command
π internal repl π
muon internal repl
Start a meson dsl repl. The functions available are limited, same energy as with internal eval. π
β internal summary β
muon internal summary
Print a previously configured project's summary. receipts, but for your build β¨
π¦ internal dump_funcs π¦
muon internal dump_funcs
Print all supported functions, methods, and module functions β with their arguments, argument types, and return types β to stdout. This subcommand is mainly useful for generating https://muon.build/status.html. π
π meson π
[muon] meson ...
A compatibility layer that attempts to translate all flags and operands from meson cli syntax to muon cli syntax. For example, the following two commands:
muon meson setup build --werror --prefix=/
muon meson test -C build --list
Would be translated into the following two muon versions respectively:
muon setup -Dwerror=true -Dprefix=/ build
muon -C build test -l
This compatibility layer is also enabled when muon's executable is named meson.
For a more detailed usage information you can use the following two commands:
muon meson -h
muon meson <subcommand> -h
NOTE: This is a best-effort translation and does not guarantee or imply full cli compatibility. Many unimplemented flags are ignored and attempting to use an unsupported subcommands will result in an error. no cap.
π options π
muon options [-a] [-m]
Lists available project options and defaults. This command may either be run from the project root or from a build directory. The way that it works: running this command from a build directory highlights configured option values in the output, whereas running it from the project root causes the default value for each option to be highlighted. iconic behaviour honestly π
OPTIONS:
-aβ Include builtin global and per-project options in the output.-mβ Only display option values that have been modified.
πΈ samu πΈ
muon samu [<args>]
Executes an embedded copy of samu(1). This command requires that muon was compiled with samu enabled. π«Ά
β¨ setup β¨
muon setup [-D[subproject:]option=value...] [-#] <build dir>
Interpret all source files and generate buildfiles in build dir. main character energy tbh π
OPTIONS:
-D [subproject:]option=valueβ Set build options. Options are either built in or project-defined. Subproject options can be specified by prepending the subproject's name and a colon to the option. This option may be specified multiple times.-#β Display a progress bar during setup. Can be combined withmuon -qto only display a progress bar.
π¦ subprojects π¦
muon subprojects
Run various commands over all subprojects. Only subprojects with .wrap files are supported. Most commands accept a list of projects as trailing arguments. π¦
OPTIONS:
-d <directory>β manually specify subprojects directory. By default muon will evaluate the current project'sproject()call to determine the value forsubproject_dir.
COMMANDS:
check-wrapβ check if a wrap file is validupdateβ update subprojects with.wrapfileslistβ list subprojects with.wrapfiles and their statuscleanβ clean wrap-git subprojects
π₯ test π₯
muon test [-a] [-b] [-d <display mode>] [-o <output>] [-e <setup>] [-f] [-j <jobs>] [-l] [-R] [-s <suite>] [-S] [-v [-v]] [<test> [<test>[...]]
Execute tests defined in source files. π§ͺ
The default is to execute all tests, but you can also specify which tests to execute on the command line.
<test> should consist of an optional project name, followed by a colon and then a test name. Either may be omitted. For example,
"test name" and ":test name" will match all tests named 'test name'
in any project.
"proj:test name" will match all tests named 'test name' in the
project 'proj'.
"proj:" will match all tests in the project 'proj'.
Additionally, the test name may be a glob expression. For example,
"proj:long*" will match all tests with names starting with 'long' in
the project 'proj'.
OPTIONS:
-aβ include all tests from all projects-bβ run benchmarks instead of tests-d <display mode>β Control test progress output.display modecan be one ofauto,dots, orbar.dotsprints a'.'for success and'E'for error,barprints a progress bar with an error count. The default mode,auto, selectsbarif the output device is a terminal ordotsotherwise.-o <output mode>β Control test results output.termprints failures and output to the terminal,htmlgenerates a single-page html report, andjsonoutputs test information to a json file.-e <setup>β Use test setupsetup.-fβ Fail fast. exit after first test failure is encountered.-jβ Set the number of jobs used when running tests.-lβ List tests that would be run with the current setup, suites, etc. The format of the output is<project name>:<list of suites> - <test_name>.-Rβ No rebuild. Disable automatic build system invocation prior to running tests.-s <suite>β Only run tests in suitesuite. This option may be specified multiple times.-Sβ print a summary of test results, including the duration of each test-vβ Increase verbosity. When passed once, print test results as they are completed. When passed twice, the stdout/stderr of tests is not captured.
π version π
muon version
Print out version information as well as enabled features. π
π EXTENSIONS π
muon provides some extra functions that may be called within source files. They are documented below. π
dbg()β Begin an interactive debugger.p(value)β Print any value's internal representation. For example,p('hello')prints'hello'.
πΈ SEE ALSO πΈ
meson.build(5) meson-reference(3) meson(1)
π AUTHORS π
Maintained by Stone Tickle <lattis@mochiro.moe>, who is assisted by other open source contributors. For more information about muon development, see <https://sr.ht/~lattis/muon>. π«Ά
okay bestie that's a wrap π this page is muon(1), dated 2026-02-23, so go forth and build something iconic. periodt. πβ¨
π¦ where this page comes from
- ubuntu resolute: muon-meson 0.5.0-1.1 Β· GPL-3.0-only
- ubuntu stonking: muon-meson 0.5.0-1.1 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms