Skip to main content
CLI

pptx command-line interface (planned)

A hosted-API CLI is planned. It is not published to any package registry, so there is nothing to install today; the command reference below describes the intended interface. It would wrap the same REST API as the planned TypeScript SDK.

Availability

Not available yet

The pptx CLI is not published to npm, PyPI or Homebrew, so there is no install command. For creating, validating, editing and inspecting OPF JSON today, use the open source opf CLI from the OpenPresentation repository (published as @openpresentation/cli).

Intended quick start

Once the CLI ships: authenticate once, scaffold a minimal deck, validate it, then render when you are ready to hit the API.

Shell
pptx login
pptx add deck -o deck.opf.json
pptx validate deck.opf.json
pptx render deck.opf.json --format pptx --out deck.pptx

Commands

Run pptx [command] --help for flags and examples.

CommandWhat it does
pptx loginSave your API key to ~/.pptx/config.json (mode 0600).
pptx logoutRemove the saved API key from the config file.
pptx generate <file | prompt>Generate a deck from an OPF JSON file. Prompt-based input returns a clear "not yet supported" message until that endpoint ships.
pptx validate <file>Validate an OPF document against the canonical schema (calls the API).
pptx parse <file.pptx>Parse a .pptx file into OPF JSON.
pptx render <file> --format <fmt>Render OPF to pptx. PowerPoint output is the only implemented format; pdf, png and svg are reserved and the API answers them with 501 not_implemented. Optional --out controls the output path.
pptx fmt <file>Normalize OPF JSON locally — no API call. Use --write (-w) to edit in place, --check to fail CI if formatting drifts.
pptx add <component>Scaffold OPF snippets offline: deck, theme, slide.title, slide.two-column, slide.chart, slide.quote.

Global options

These apply before any subcommand:

FlagPurpose
--api-key <key>Override the API key for this invocation (wins over saved config).
--base-url <url>Override the API base URL (defaults to https://api.pptx.dev).

Precedence for the key: --api-key, then PPTX_API_KEY, then values from pptx login. For the base URL: --base-url, then PPTX_API_BASE_URL, then saved config, then the default above.

Authentication

pptx login writes JSON to ~/.pptx/config.json with permissions 0600 — no OS keychain required, so the CLI stays portable. CI should set PPTX_API_KEY instead of running login.

Get a key from the API Keys page.

Exit codes

CodeMeaning
0Success
1Generic failure (API error, validation failed, fmt --check dirty)
2Bad input (missing key, invalid args, unreadable file)
3Feature not yet available (for example prompt-based generate)

License

MIT. Source and full readme live in the opf/packages/cli directory of the OpenPresentation repository.