# PAM command-line tools: setup and first success

The command-line tools ship inside PAM’s macOS installer, the same download as the PAM trial. There is no separate package, and the CLI has no licence of its own.

To install the command-line tools, run PAM’s macOS installer from https://map.audio/download, click Customize and tick “Command-Line & AI Agent Tools” (Apple Silicon Macs). It installs `pam`, `pamd` and `pamd-worker` under `/Library/Application Support/MAP Audio/PAM/bin` and links `/usr/local/bin/pam`. The choice is unticked by default and independent of the selected plugin formats; run the installer again to add it to an existing PAM. Intel Macs and the Windows installer do not offer it, and no Linux package is distributed.

Use a supported local execution environment. A shell-capable agent runs `pam … --json`; a local MCP client starts `/usr/local/bin/pam mcp`. Ordinary hosted web/mobile chat cannot run your local binary. Per-client installed-package and file-delivery acceptance remains open; no client is claimed release-verified yet.

```json
{"mcpServers":{"pam":{"type":"stdio","command":"/usr/local/bin/pam","args":["mcp"]}}}
```

The `pam` server exposes file and model tools alongside controls for a selected running PAM instance. `pam mcp` relays to MCP sessions hosted by `pamd`; plugin control uses the installed bundled runtime. The `pam-audio-gen` task skill is published at https://map.audio/.well-known/agent-skills/pam-audio-gen/SKILL.md.

Inspect the local contract first:

```sh
pam version --json
pam manifest --json
pam search "measure loudness"
pam schema audio generate --json
```

For a WAV measurement, skip model setup:

```sh
pam audio analyze recording.wav --json
```

For generation, inspect `pam model list --json`. Both command availability and model `runtimeReady` must permit the operation. SA3 and both Magenta models have registered adapters and built-in Apple Silicon profiles. Their model files and native runtime dependencies must still be installed. A downloaded model alone is insufficient. Report `daemonReason` without blind retries.

When the platform supports the model, obtain consent for any missing model download using the client's normal consent flow. SA3 Small SFX weights need about 2.7 GB. Magenta needs Apple Silicon, macOS 14+ and its runtime. The CLI/daemon may build on other platforms; that is not evidence of model eligibility.

```sh
pam model pull stable-audio-3-small-sfx --json
pam audio generate -p "short metallic kick, tight transient" -d 1.2 --category kick --seed 7 -o kick.wav --json
pam audio analyze kick.wav --json
```

Generation, model management, streaming and analysis are free. Check entitlement only if the installed contract marks the command paid. `fx`, `audio master`, `preset render` and `dj set` process files and render presets and DJ sets without opening PAM; they require a PAM licence or active trial. Presets and song references also follow desktop pack ownership: unowned packs return `pack_license_required`, while factory presets need no separate pack purchase. Model licences apply separately: [Stability AI terms](https://stability.ai/community-license-agreement), including commercial registration, organization/affiliate revenue conditions, attribution and separate Gemma encoder terms. Powered by Stability AI.

Wait for the actual job; inspect errors, completion, resulting files and measurements. Deliver the file with the client's supported file mechanism. `wavPath` alone does not establish attachment, upload or audition. Never infer measurements from a prompt.

For musical edits, enable the MCP Bridge in PAM's Settings → Integrations and select the instance in the same `pam` MCP server. Generate and measure files, load them into cells, edit, save, reopen and export through that session. Preserve unsaved work and query applied state after edits; a queued acknowledgement alone does not prove the session changed.

Troubleshooting: missing binary → install the command-line tools as above; unavailable runtime → report readiness; missing model → ask for download consent; `model_in_use` → stop the holder deliberately before retrying; no audible output → inspect the real WAV and measurements. Use `pam daemon status --json`, `pam model ps --json` and job commands for observed state.
