See More

# CLI reference Every maple command, argument and flag, plus the local server's endpoints, environment variables and a troubleshooting guide. The `maple` binary is one CLI with two backends: the local server it starts itself (`maple start`) and a hosted Maple workspace (`maple auth login`). Every query command runs against whichever backend is [resolved](#auth-and-configuration) for that invocation. Output is JSON by default, clean enough to pipe into `jq` or an agent. If you are new to the CLI, start with the [Maple Local](/docs/local-mode) walkthrough, or [use the CLI with hosted Maple](#using-the-cli-with-hosted-maple). This page lists every command. ## Command index | Command | What it does | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | [`maple start`](#maple-start) · [`stop`](#maple-stop) · [`reset`](#maple-reset) | Run the local server, stop it, or clear its live data | | [`maple checkpoint`](#maple-checkpoint) · [`restore`](#maple-restore) | Take a restore point of the local store, or roll back to one | | [`maple archive …`](#maple-archive) | Export sealed days to Parquet and manage those archives | | [`maple delete`](#maple-delete) | Delete one service's or namespace's local telemetry | | [`maple schema …`](#maple-schema) | Inspect and migrate the local store's schema | | [`maple update`](#maple-update) · [`changelog`](#maple-changelog) | Upgrade a script-installed binary, read the release notes | | [`maple services`](#maple-services) · [`diagnose`](#maple-diagnose-service-name) · [`service-map`](#maple-service-map) · [`top-ops`](#maple-top-ops-service-name) | Services, their health, dependencies and hottest operations | | [`maple traces`](#maple-traces) · [`trace`](#maple-trace-trace-id) · [`slow-traces`](#maple-slow-traces) | Search spans, inspect one trace, find the slowest | | [`maple errors`](#maple-errors) · [`error`](#maple-error-fingerprint-hash) | Error groups by fingerprint, and one group in detail | | [`maple sourcemaps inject`](#maple-sourcemaps-inject-dir) · [`upload`](#maple-sourcemaps-upload-dir) | Add debug ids to a build, upload its source maps | | [`maple logs`](#maple-logs) · [`log-patterns`](#maple-log-patterns) · [`log-diff`](#maple-log-diff) | Search logs, or cluster them into templates | | [`maple attributes keys`](#maple-attributes-keys) · [`values`](#maple-attributes-values-key) | Discover attribute keys and their values | | [`maple metrics`](#maple-metrics) · [`metrics show`](#maple-metrics-show-metric-name) · [`metrics exemplars`](#maple-metrics-exemplars-metric-name) · [`query`](#maple-query-sql) | List metrics, read one over time, find the traces behind its peaks, run read-only SQL | | [`maple promql`](#maple-promql-query) · [`promql metrics`](#maple-promql-metrics-filter) | Run PromQL over metrics, list the names it can select | | [`maple users`](#maple-users) · [`user`](#maple-user-user-id) · [`events`](#maple-events) | Your apps' end users and product events (remote mode) | | [`maple timeseries`](#maple-timeseries) · [`breakdown`](#maple-breakdown) · [`compare`](#maple-compare) | Bucketed metrics, top-N breakdowns, two windows side by side | | [`maple auth …`](#maple-auth-login) · [`whoami`](#maple-whoami) · [`use`](#maple-use-localremoteauto) | Sign in to a workspace, see the resolved backend, pin one | | [`maple onboarding …`](#maple-onboarding) | Report a coding agent's Maple setup to the onboarding run | | [`maple api `](#maple-api-method-path) · [`get`](#maple-api-method-path) · [`post`](#maple-api-method-path) · [`put`](#maple-api-method-path) · [`patch`](#maple-api-method-path) | Send any request to the Maple API as the signed-in user | ## Global flags Accepted by every command, in any position (`maple --local traces` and `maple traces --local` both work): | Flag | Description | | ------------------------ | --------------------------------------------------------------------------------- | | `--local` | Force local mode (requires a running `maple start`) | | `--remote` | Force remote mode (requires `maple auth login`) | | `--debug` | Print the compiled SQL and per-query timing to stderr; stdout stays clean JSON | | `--format ` | Output format, default `json`. `table` renders a flat row set as an aligned table | Most **query** commands also share a set of filter flags. Which ones apply is listed per command below; the shapes are always the same: | Flag | Alias | Default | Description | | ------------------ | ----- | ------- | --------------------------------------------------------------------------------------- | | `--since ` | | `6h` | Relative window ending now: a number and `m`, `h`, `d` or `w` (`30m`, `6h`, `7d`, `2w`) | | `--start

` | `127.0.0.1` | Bind address. Off loopback, set `MAPLE_LOCAL_INGEST_KEY` and `MAPLE_LOCAL_ACCESS_TOKEN`, or the UI, OTLP ingest and raw SQL are open to the network (see [Server endpoints](#server-endpoints)) | | `--advertise-host ` | | Hostname printed for clients and used by the bundled UI. Defaults to the bind address (`--host`) | | `--port ` | `4318` | Port for OTLP ingest, the query API and the bundled UI | | `--data-dir ` | `~/.maple/data` | Embedded ClickHouse data directory | | `--offline` | `false` | Serve the UI bundled in the binary instead of linking to `local.maple.dev` | | `--background`, `-d` | `false` | Run detached, logging to `~/.maple/maple.log`; stop with `maple stop` | | `--reset` | `false` | Wipe live data before starting, keeping checkpoints. For an incompatible upgrade | | `--checkpoint-interval ` | `30m` | How often to refresh the restore point while running (`45s`, `2h`, or `off`) | | `--on-dirty-store ` | `fail` | What to do when the store was not cleanly closed: `fail`, `wipe` or `restore-checkpoint` | | `--chdb-config-file ` | | Your own ClickHouse config for the embedded engine, instead of the generated one. Must keep backups enabled for checkpoints to work | | `--minimum-raw-telemetry-retention-days ` | | Persist a retention floor for the raw tables (at least 90 days). Survives reset and restore | | `--in-memory` | `false` | Keep telemetry for this run only, in a throwaway store deleted on exit, with no checkpoints. Cannot be combined with `-d`, `--data-dir`, `--reset`, `--checkpoint-interval`, `--on-dirty-store` or the retention floor | | `--projector-module ` | | Load a trusted local projector `.mjs` module. Repeatable. The module runs with Maple's permissions | ```bash maple start # foreground, UI from local.maple.dev maple start --offline # foreground, bundled UI, no internet needed maple start -d --port 4400 # detached on a custom port maple start --in-memory # throwaway store, deleted on exit maple start --host 0.0.0.0 --advertise-host maple.home.arpa --offline ``` The default recovery policy is `fail`, so an unclean shutdown never silently deletes telemetry. What each policy does, and how reset and restore protect the store, is on [Checkpoints and archives](/docs/local-mode/checkpoints-and-archives). ### `maple stop` Stop a running server. Reads the PID file beside the data directory. | Flag | Default | Description | | ------------------- | --------------- | ------------------------------------ | | `--data-dir ` | `~/.maple/data` | Data directory of the server to stop | ### `maple reset` Delete live data so the next `maple start` bootstraps fresh. Checkpoints under `/backups` are kept. Refuses to run while a server owns the store. | Flag | Default | Description | | ------------------- | --------------- | ------------------------------ | | `--data-dir ` | `~/.maple/data` | Store whose live data to clear | | `--yes`, `-y` | `false` | Skip the confirmation prompt | ### `maple checkpoint` Create and validate a restorable checkpoint of the local store. Works out of the box against a running `maple start`. | Flag | Default | Description | | ------------------- | --------------- | --------------------------- | | `--host
` | `127.0.0.1` | Host of the running server | | `--port ` | `4318` | Port of the running server | | `--data-dir ` | `~/.maple/data` | The server's data directory | If the server was started with a custom data directory, pass the same one. Without `--port`, the command reads the server's address from the store's discovery file. ### `maple restore` Restore the local store from the current checkpoint. Refuses to run while a server owns the store. The existing store is moved beside the data directory as `.quarantine-`, never deleted. `maple schema gc` lists it and `--apply` removes it. | Flag | Default | Description | | ------------------------ | --------------- | ---------------------------------------------------------- | | `--data-dir ` | `~/.maple/data` | Store to restore | | `--checkpoint-id ` | | Restore one specific checkpoint instead of the current one | | `--yes`, `-y` | `false` | Skip the confirmation prompt | ```bash maple restore --yes maple restore --checkpoint-id 01234567-89ab-4cde-8fab-0123456789ab --yes ``` ### `maple delete` Delete one service's or namespace's telemetry from the local store, in the raw tables and every derived rollup. Local mode only. Without `--yes` it only prints what would be deleted. | Flag | Description | | -------------------- | ------------------------------------------------------------------------------------ | | `--service ` | The `service.name` whose telemetry to delete | | `--namespace ` | The `service.namespace` whose telemetry to delete. With `--service`, both must match | | `--env ` | Only rows whose deployment environment equals this value | | `--before ` | Only rows older than an age (`7d`, `12h`) or a UTC timestamp, floored to the hour | | `--yes` | Delete. Without it the command is a dry run | ```bash maple delete --service checkout-pr-42 # preview maple delete --namespace pr-42 --yes maple delete --service api --before 7d --yes ``` ### `maple archive` Local mode only. Export whole UTC days of the six raw telemetry tables from a checkpoint into Parquet files, and manage those exports. How archives work is explained on [Checkpoints and archives](/docs/local-mode/checkpoints-and-archives#archives). | Subcommand | What it does | | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `archive create ` | Export one day of one signal. `--checkpoint-id` picks the checkpoint. Refuses days past retention, and refuses to replace an archived day with fewer rows unless you pass `--allow-shrink` | | `archive list [--output summary\|paths\|json] [--signal ]` | List archived days. `paths` prints Parquet file paths for DuckDB and needs `--signal` | | `archive verify [--signal ]` | Re-check the SHA-256 of every archived file | | `archive expire --apply` | Delete one archived day across all six signals | | `archive retire-live --apply` | Delete a day from the live store once all six signals are archived and verified. The day must be at least `--sealing-lag-hours` (default `24`) past UTC midnight | | `archive gc [--keep ] [--apply]` | Delete replaced copies of re-exported days, keeping the newest `n` per signal and day (default `1`). Without `--apply` it only prints the plan | | `archive reconcile` | Finish an interrupted `create` or `gc` without exporting again | | `archive rebuild ` | Rebuild a signal's `catalog.jsonl` from its manifests | Signals: `logs`, `traces`, `metrics_sum`, `metrics_gauge`, `metrics_histogram`, `metrics_exponential_histogram`. Common flags: `--data-dir` (default `~/.maple/data`), `--archive-dir` (default `~/.maple/archive`) and `--scratch-root` (default `~/.maple/scratch`). `gc`, `expire` and `retire-live` change nothing unless you pass `--apply`. `reconcile` acts by default; pass `--dry-run` to print the plan without changing anything. Export settings are fixed: one writer thread, 10,000-row row groups, and files of at most 500,000 rows or 256 MiB. Older releases had `archive calibrate`; `archive create` still accepts its `--config` flag but ignores it. ### `maple schema` Inspect and migrate the local store's schema. Needed only when a release note says a store needs migrating; a normal upgrade opens the store as is. | Subcommand | What it does | | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `schema status` | Show the store's schema identity and migration journal state | | `schema plan` | Show the deterministic migration plan for this store | | `schema migrate [--dry-run] [--yes]` | Migrate a populated store into a staged current-schema store. Needs a stopped server; keeps the original as a rollback point | | `schema abandon [--yes]` | Quarantine an unfinished staged target, preserving the active source (also when the source was left dirty) | | `schema gc [--apply] [--release-preserved]` | List what restores, resets and migrations set aside (quarantined stores, migration sources, stale locks). `--apply` deletes it; `--release-preserved` also unpins the checkpoints a reset kept | All five take `--data-dir ` (default `~/.maple/data`). ### `maple update` Update a script-installed binary to the latest release: download, verify the checksum and release signature, install in place. | Flag | Description | | --------------------------- | ---------------------------------------------------------------------------------- | | `--check` | Only report whether a newer version is available | | `--tag ` | Install a specific release instead of the latest | | `--insecure-skip-signature` | Install even if the signature is missing or invalid. The checksum is still checked | Homebrew installs refuse `maple update` so the package manager stays in charge; run `brew upgrade maple` instead. ### `maple changelog` Print the release notes for the installed version. `--since ` prints every release after that version instead (`maple changelog --since 0.0.20`). Text by default; `--format json` for JSON. ## Services ### `maple services` List active services with throughput, error rate and P95 latency. Flags: `--since` / `--start` / `--end`, `--env`, `--service`/`-s` (services whose name contains the text), `--limit` (default `50`). ### `maple diagnose ` Deep-dive one service: health, top errors, recent traces and logs. - **``**: the service to diagnose - Flags: `--since` / `--start` / `--end`, `--env` ### `maple service-map` Service dependency edges with call counts, errors and latency. Flags: `--since` / `--start` / `--end`, `--service`, `--env`. - `edges`: service-to-service calls, drawn when an instrumented callee continues the caller's trace - `databases`: calls from client spans with `db.system.name` (or the legacy `db.system`), keyed by system and `db.namespace` - `external`: HTTP, messaging and RPC targets that are not a traced service; listed only with `--service`, since that query is scoped to one caller Databases and external calls are local-only. In remote mode the command prints `edges`, and `--service` keeps that service's outbound edges only; locally it keeps both directions. ### `maple top-ops ` Top operations (span names) for a service, ranked by a metric. - **``**: the service to inspect - `--metric `: ranking metric, default `count` - Flags: `--since` / `--start` / `--end`, `--limit` ## Traces ### `maple traces` Search traces and spans. | Flag | Description | | ------------------------- | ------------------------------------------------- | | `--span-name ` | Filter by span name (substring, case-insensitive) | | `--errors` | Only traces with errors | | `--min-duration-ms ` | Minimum duration in milliseconds | | `--max-duration-ms ` | Maximum duration in milliseconds | | `--http-method ` | Filter by HTTP method (`GET`, `POST`, …) | Plus `--since` / `--start` / `--end`, `--service`, `--env`, `--limit`, `--offset`. ```bash maple traces --service api --min-duration-ms 500 --errors --since 1h ``` ### `maple trace ` Inspect one trace: the full span tree plus correlated logs. - **``**: the trace to inspect, 32 hex characters - Flags: `--since` / `--start` / `--end`. With none set, the command looks back 24 hours, then up to 30 days ### `maple slow-traces` The slowest traces with duration stats. Flags: `--since` / `--start` / `--end`, `--service`, `--env`, `--limit`. ## Errors ### `maple errors` Error groups by fingerprint, with count, affected services and last seen. Flags: `--since` / `--start` / `--end`, `--service`, `--env`, `--limit`. ### `maple error ` One error group in detail: sample traces and a timeseries. - **``**: the fingerprint from `maple errors` - Flags: `--since` / `--start` / `--end`, `--service`, `--limit` ### `maple sourcemaps inject ` Gives a debug id to every built JS file under `` that has a source map, and writes the id into the map. Run it after the build, before deploying and uploading; re-running changes nothing. Maps outside `` are never touched. - Flags: `--dry-run` reports what would change without writing ### `maple sourcemaps upload ` Uploads every source map under `` whose JS file is there too, so error stacks show original source. Needs a signed-in workspace (remote mode). Skips maps over 10 MiB and index maps; exits non-zero when nothing uploads or an upload fails. See [Source maps](/docs/errors/source-maps). - `--service`: the `service.name` the maps belong to - `--release`: the `service.version`; defaults to the directory's git commit when `--service` is set - `--url-prefix`: the path the files are served under, prepended to each file path, for example `assets/` ## Logs ### `maple logs` Search logs. | Flag | Alias | Description | | -------------------- | ----- | -------------------------------------------------------------- | | `--severity ` | | `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR` or `FATAL` | | `--search ` | `-q` | Substring match on the body | | `--trace-id ` | | Only logs from one trace | | `--attributes` | | Include every log attribute on each entry, not only error keys | Plus `--since` / `--start` / `--end`, `--service`, `--env`, `--limit`, `--offset`. ### `maple log-patterns` Cluster logs into templates to surface the noisiest patterns. Flags: `--since` / `--start` / `--end`, `--service`, `--env`, `--severity`, `--search`/`-q`, `--limit`. ### `maple log-diff` What changed in the logs between two windows: templates that are new, gone, or whose share of the logs at least doubled or halved. A rise in traffic alone flags nothing. Give the windows as `maple compare` does: `--around