--- title: "The palt CLI" source: "https://docs.palt.io/cli" --- # The palt CLI Push specs and guide pages from your terminal and from CI. ```bash npm install -g palt palt login ``` `palt login` opens your browser. Check that the code matches your terminal and approve; the CLI receives an API key named after your computer and keeps it in its config file. ## Everyday commands ```bash palt whoami # account, plan and usage palt projects # your projects palt projects create acme-api --name "Acme API" # a new docs site at acme-api.palt.io palt push openapi.yaml --project acme-api # import or replace a spec version palt specs --project acme-api # versions, endpoints, which is default palt pages push docs --project acme-api # sync a folder of markdown palt pages pull docs --project acme-api # write the pages to files palt open --project acme-api # open the docs in your browser ``` Every command takes `--help`, and `--json` where it prints data. ## Specs `palt push` takes a file (JSON or YAML) or an `https://` URL palt.io fetches. The version comes from `--version`, else from the document's `info.version`; pushing a version that exists replaces it. - `--draft` keeps a version hidden from readers, `--publish` shows it. - `--default` makes it the version readers see first. ## Guide pages from markdown Every `*.md` file becomes a page, named after the file. Optional front matter sets the details: ```markdown --- title: Webhooks order: 3 parent: guides published: true --- # Webhooks The events we send, and how to verify them. ``` Files in a `guides/` folder become children of `guides.md`. Pages the folder doesn't mention are left alone; add `--prune` to delete them. ## In CI Set `PALT_API_KEY` to an API key stored as a secret; the CLI uses it instead of the config file. `PALT_API_URL` points it at another server. ```bash PALT_API_KEY=${{ secrets.PALT_API_KEY }} npx -y palt push openapi.yaml --project acme-api ```