# mx

> MAML cli

Latest version **1.0.4** (published 2026-06-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install mx
pnpm add mx
yarn add mx
bun add mx
```

Provides the command `mx`.

## Health

**Score 50/100 (C)** — status: active.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2026-06-16 |
| First published | 2014-12-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 8.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Anton Medvedev |
| Maintainers | medv |

## Links

- npm: https://www.npmjs.com/package/mx
- Repository: https://github.com/maml-dev/mx
- Homepage: https://maml.dev
- Issues: https://github.com/maml-dev/mx/issues
- npm.io page: https://npm.io/package/mx

## Dependencies (1)

- [maml-ast](https://npm.io/package/maml-ast.md) ^1.0.0

## Recent versions

- 1.0.4 (latest) — 2026-06-16
- 1.0.3 — 2026-06-09
- 1.0.2 — 2026-03-28
- 1.0.1 — 2026-03-27
- 1.0.0 — 2026-03-22
- 1.0.0-0 — 2017-10-25
- 0.5.0 — 2014-12-21

## README

# mx

MAML cli tool. `mx` pretty-prints, queries, and edits [MAML](https://maml.dev) files.

## Install

```bash
npm i -g mx
```

Or run without installing:

```bash
npx mx data.maml
```

## Usage

```
mx [file] [code...]
```

Pipe input or pass a file:

```bash
cat data.maml | mx
mx data.maml
```

## Query

Drill into data with dot notation:

```
.prop            access property
.prop.nested     nested access
.[0]             array index
.items[2].name   mixed access
.[]              iterate over array
.users[].name    map field over array
```

```bash
mx data.maml .users[0].name
cat data.maml | mx .config.server.port
```

Iterate over an array with `[]`. The results are collected back into an
array, so the output stays valid MAML:

```bash
mx data.maml '.users[].name'
```

## Edit

Assign a MAML value to any path:

```bash
mx data.maml '.config.port = 8080'
mx data.maml '.users[0].roles = ["admin", "dev"]'
```

Edits print to stdout. Add `save` to write back to the file:

```bash
mx data.maml '.config.port = 8080' save
```

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/mx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
