Reference

CLI reference.

Commands, flags, and settings for the matilda CLI.

Install and verify

Shell
npm install -g @maincode-ai/matilda-code@latest
matilda --version

The package installs matilda and matilda-code. They are the same binary.

Commands

Running matilda with no subcommand starts an interactive session in the current directory. Anything else you type as a positional argument is treated as a prompt.

Fieldtypedescription
matildacommandStart an interactive session, or run a positional prompt one-shot.
authcommandSign in, sign out, or check status. Subcommands: login, logout, status (alias whoami).
sessionscommandList and manage recorded sessions.
mcpcommandManage MCP servers available to the agent.
extensionscommandInstall and manage Matilda extensions.
hookscommandManage hooks. Also available as /hooks in a session.
channelcommandManage messaging channels such as Telegram and Discord.
servecommandRun Matilda as a local HTTP daemon. Experimental.
updatecommandUpdate Matilda Code in place.
Note

There is no matilda run or matilda diff. To run a single task, pass the prompt directly. To see pending changes, use /diff inside a session.

Commands you will actually use

Start an interactive session in the current directory. The agent reads the working tree, waits for a task, and pauses for approval before it writes or runs anything.

Shell
matilda

Global flags

These apply to any invocation:

Fieldtypedescription
--model, -mstringModel for this invocation.
--prompt, -pstringRun one prompt non-interactively. Ambient piped stdin is ignored when set.
--prompt-interactive, -istringRun a prompt, then stay in the interactive session.
--output-format, -otext | json | stream-jsonShape of the CLI output. Defaults to text.
--approval-modeplan | default | auto-edit | auto | yoloHow much the agent may do without asking.
--bogan, --yolo, -bbooleanAuto-approve every action. Shorthand for the yolo mode.
--sandbox, -sbooleanRun tool calls inside the sandbox.
--include-directories, --add-dirarrayAdditional directories to include in the workspace.
--allowed-toolsarrayTools that bypass confirmation for this run.
--mcp-configstringMCP server config as inline JSON or a path to a JSON file.
--fresh, --no-resumebooleanStart a fresh one-shot session without resuming or recording history.
--debug, -dbooleanRun in debug mode.

Slash commands

Inside a session, /help lists everything. The ones worth knowing early:

Fieldtypedescription
/helpcommandList every slash command.
/authcommandSwitch account, API token, or provider.
/modelcommandPick the model for this session.
/approval-modecommandChange what the agent may do without asking.
/contextcommandShow what is loaded and how much of the window it uses.
/compresscommandSummarise the conversation to free up context.
/clearcommandDrop the working set and start fresh.
/diffcommandShow pending changes.
/memorycommandInspect and edit what Matilda remembers.
/initcommandCreate a MATILDA.md for this project.
/mcpcommandInspect connected MCP servers.
/doctorcommandDiagnose a broken setup.
/aussiecommandHop a Matilda easter egg across the terminal. Takes an optional animal.
Note

/aussie takes kangaroo, koala, wombat, emu, or quokka, and picks one at random if you leave it off. Interactive sessions only, and Esc clears it early.

Settings

Settings are JSON, not TOML, and they layer. Later layers win:

Fieldtypedescription
~/.matilda/settings.jsonuserApplies to every session for this user.
.matilda/settings.jsonprojectApplies only in this repository. Overrides user settings.
System settingssystemMachine-wide, for administrators. Overrides user and project. Path varies by OS.

Environment variables override the files, and command-line flags override everything.

Data
{
  "tools": {
    "approvalMode": "default"
  }
}
Note

String values in settings.json can reference environment variables with $VAR_NAME or ${VAR_NAME}, so credentials never have to be written into the file itself.

Environment

Fieldtypedescription
MATILDA_API_KEYstringMatilda API token for CI and other non-interactive runs. Not needed for interactive use.