Command-line interface for Minga.
Serves as the entry point for both mix minga <filename> and the standalone Burrito binary (./minga <filename>). In Burrito mode, arguments are fetched via Burrito.Util.Args.argv/0 which works whether running standalone or under Mix.
Startup view
By default, Minga boots into the agentic view (controlled by the :startup_view config option). CLI flags can override the config:
--editorforces the traditional file editing view- File arguments open in the traditional file editing view by default
- Directory arguments open the agentic view with the directory as context
--no-contextopens the agentic view but skips loading the CLI file argument as preview context--headlessstarts only the services and agent runtime, plus the JSON-RPC Gateway
Summary
Types
CLI flags that override config options.
Parsed CLI result.
Startup view mode requested by CLI flags.
Functions
Applies flag implications to a flags map.
Applies flag implications with file-aware startup view resolution.
Returns the project root inferred from the current CLI argv before startup flags are stored.
Returns the marked project root inferred from the current working directory, if any.
Returns true when args request headless mode.
Returns the output for info-only flags (--version/-v, --help/-h).
Main entry point for the CLI.
Returns true when args request minimal mode (for GIT_EDITOR use).
Parses CLI arguments into an action.
Returns true when args request safe mode.
Entry point used by the OTP application in release/Burrito mode.
Returns the startup flags stored by the CLI, or defaults if none were set.
Returns the project root inferred from the stored startup CLI target, if any.
Returns the project root inferred from raw CLI args, if they name a project or file inside a project.
Returns true when args request a terminal-only remote command.
Returns true when args request a terminal-only remote command after parsing flags.
Types
@type flags() :: %{ view_mode: view_mode(), no_context: boolean(), config_file: String.t() | nil, debug_log: String.t() | nil, headless: boolean(), minimal: boolean(), safe_mode: boolean(), node_name: String.t() | nil, short_name: boolean(), cookie_file: String.t() | nil, gateway_port: pos_integer() | nil, gateway_host: String.t() | nil }
CLI flags that override config options.
@type parsed() :: {:open, file :: String.t() | nil, flags()} | {:attach, url :: String.t(), flags()} | {:sessions, url :: String.t(), flags()} | {:detach, flags()} | {:kill_session, url :: String.t(), flags()} | {:login, flags()} | {:error, String.t()}
Parsed CLI result.
@type view_mode() :: :auto | :editor | :agentic
Startup view mode requested by CLI flags.
Functions
Applies flag implications to a flags map.
Applies flag implications with file-aware startup view resolution.
@spec argv_startup_project_root() :: String.t() | nil
Returns the project root inferred from the current CLI argv before startup flags are stored.
@spec cwd_startup_project_root() :: String.t() | nil
Returns the marked project root inferred from the current working directory, if any.
Returns true when args request headless mode.
Returns the output for info-only flags (--version/-v, --help/-h).
These flags should print and exit without booting the supervision tree,
so the application start path can short-circuit before doing any work.
Returns :none when the args don't request info-only output.
@spec main([String.t()]) :: :ok
Main entry point for the CLI.
Returns true when args request minimal mode (for GIT_EDITOR use).
Parses CLI arguments into an action.
Returns true when args request safe mode.
@spec start_from_cli() :: :ok
Entry point used by the OTP application in release/Burrito mode.
@spec startup_flags() :: flags()
Returns the startup flags stored by the CLI, or defaults if none were set.
@spec startup_project_root() :: String.t() | nil
Returns the project root inferred from the stored startup CLI target, if any.
Returns the project root inferred from raw CLI args, if they name a project or file inside a project.
Returns true when args request a terminal-only remote command.
Returns true when args request a terminal-only remote command after parsing flags.