# Design: enterprise-audio-cli
**Change ID**: enterprise-audio-cli
**Package**: `@suaveplan/audio-cli`
`@suaveplan/audio-cli` is the `audio` command-line tool — the server-tier application entry point of
the `@suaveplan/audio-*` family. It is deliberately **thin**: it owns argument parsing, the pipeline
grammar, command dispatch, exit-code mapping, and signal handling, and nothing else. Every audio
transform is delegated to the universal and platform packages below it.
---
## 1. Relationship to the ecosystem architecture
The cross-cutting architecture for the whole audio family — the three-layer separation, the six
plugin slots, the canonical `Segment` shape, the universal data model, and the error hierarchy —
lives in [`enterprise-audio-core/design.md`](../enterprise-audio-core/design.md) §1–§4 and is **not
duplicated here**. `audio-cli` sits in the Application layer of that architecture (the topmost box
in §1.6's diagram). It composes:
- `@suaveplan/audio-core` — `AudioDocument`, `OpRegistry`, `PlanEngine`, `ProcessPipeline`.
- `@suaveplan/audio-codecs` — `CodecRegistry`, `decodeSource`, `encodeTo`.
- `@suaveplan/audio-engine-server` — `FileSourceAdapter`, `FileSinkAdapter`, stdin/stdout adapters.
- `@suaveplan/audio-fx-plugin-base` — FX plugins resolvable by name inside a pipeline.
- `@suaveplan/audio-analysis-*` — analysis ops for the `analyze` command.
- `@suaveplan/cli` — command registry, argument parsing, help-text rendering.
- `@suaveplan/queue` — batch job distribution for `batch --queue`.
The CLI implements **no DSP, no codec, and no page management**. If a behaviour belongs to audio
processing, it belongs in one of the packages above; `audio-cli` only wires them together and maps
the result onto an Unix process contract (argv in, exit code out, stdout/stderr).
---
## 2. Command grammar
The tool accepts two interchangeable surface forms that resolve to the same internal op chain.
**Bare-op positional form** — the primary, ergonomic form:
```sh
audio input.wav trim 30s normalize -16lufs fade 0.5s 1s save output.flac
```
**Pipe-string form** — for scripting and `batch --pipeline`:
```sh
audio batch --input "./tracks/*.mp3" --pipeline "trim 30s | normalize | fade 0.5s 1s" --output "./processed/"
```
Both forms parse to `Array<[opName, params]>`. Unit suffixes are normalised at parse time: `30s` →
seconds `30`, `500ms` → seconds `0.5`, `-16lufs` → `{ lufs: -16 }`, `6db` → `{ db: 6 }`,
`44100hz` → `{ rate: 44100 }`. Quoted arguments and backslash escaping let a single op carry a
string parameter containing spaces.
| Command | Description |
|---|---|
| `audio save