DocsGuides

Coastly CLI

Official @coastly/cli for listing towns and searching marketplace listings with --json and RFC 9457 Problem errors.

The Coastly CLI (@coastly/cli, bin coastly) wraps the Partner API so agents and scripts can discover towns and listings without hand-writing HTTP. Source lives in the monorepo at packages/cli.

Install

npm install -g @coastly/cli
# or one-shot
npx @coastly/cli --help

Requires Node.js 20+.

Auth

Create a key under Vendor dashboard → Developers. Default keys include listings:read, which the catalog commands need.

export COASTLY_API_KEY="ck_test_..."
# COASTLY_KEY is accepted as an alias

Optional base URL override (defaults to production):

export COASTLY_API_BASE="https://coastly.surf/api/v1"

Commands

coastly towns list
coastly towns list --json

coastly listings search --town cabarete
coastly listings search --town cabarete --type restaurants --q taco --json
coastly listings search --town cabarete --type stays
coastly listings search --town cabarete --type tours
coastly listings search --town cabarete --type events

coastly listings get <id> --json

coastly --help

--type is one of restaurants, stays, tours, events.

These map to:

CLI HTTP
towns list GET /api/v1/towns
listings search GET /api/v1/listings?town=&type=&q=
listings get GET /api/v1/listings/{id}

JSON and errors

--json (or -j) prints the Partner API JSON body on success.

On failure the CLI prints an RFC 9457 Problem object (same fields as the OpenAPI Problem schema: type, title, status, detail, code, request_id) and exits nonzero. Branch on code, not on the human detail string.

Publish

The package is versioned 0.1.0 and marked publish-ready (publishConfig.access: public). Publishing to the npm registry is a separate credentials step (npm publish from packages/cli after npm run build) and is not automated from this repo.