Grapity CLI - the command line interface for the Grapity platform. Requires Node.js 18+.
Documentation: grapity.dev/docs/cli-reference/init · Quickstart
npm install -g @grapity/cliTo run a local registry server, also install the server package:
npm install -g @grapity/registryRun a registry server on this machine. No external dependencies.
npm install -g @grapity/cli @grapity/registry
grapity init --local
grapity servenpm install -g @grapity/cli @grapity/registry
grapity serve --db postgresql://user:pass@host:5432/grapity --auth jwtConnect to a hosted Grapity instance. No server to run.
npm install -g @grapity/cli
grapity init --remote --url https://api.grapity.dev --api-key <key>Configure the registry. Writes ~/.grapity/config.yaml.
--local Use local mode (SQLite)
--remote Use remote mode
--url <url> Registry URL (required for remote)
--api-key <key> API key (optional, for remote)
--port <port> Port for local server (default: 3750)
--db <path> SQLite database path (default: ~/.grapity/registry.db)
Start the registry server. Requires @grapity/registry to be installed.
-p, --port <port> Port to listen on (default: 3750)
--db <url> SQLite path or postgresql:// URL
--auth <mode> Auth mode: none | api-key | jwt (default: none)
The database backend is inferred from --db: a postgresql:// URL uses PostgreSQL, anything else (or omitted) uses SQLite.
Push a spec file to the registry. Validates structure, checks backward compatibility against the latest version, assigns a semver, and stores the result.
--name <name> Spec name (required)
--type <type> Spec type: openapi | asyncapi
--description <desc> Description
--owner <owner> Owner
--source-repo <url> Source repository URL
--tags <tags> Comma-separated tags
--git-ref <ref> Git commit SHA
--pushed-by <by> Pusher identity
--force Force push even with breaking changes
--reason <reason> Reason for force push (required with --force)
--prerelease Use pre-release versioning (0.x)
Breaking changes block a push by default. Use --force --reason <reason> to override (recorded in the audit log).
Validate a spec against the latest version in the registry without storing anything. Returns the compatibility report.
--against <name> Spec name to validate against (required)
List all specs in the registry.
--type <type> Filter by spec type
--owner <owner> Filter by owner
--tags <tags> Comma-separated tag filter
Get metadata and latest version details for a spec.
List all versions of a spec, newest first.
Fetch the raw spec document (OpenAPI/AsyncAPI file) for a spec. Prints to stdout, pipe-friendly.
--semver <semver> Specific version (default: latest)
--format <format> Output format: json or yaml (default: yaml)
Examples:
grapity registry spec payments-api # latest, yaml
grapity registry spec payments-api --format json # latest, json
grapity registry spec payments-api --semver 1.2.0 # specific version
grapity registry spec payments-api --semver 1.2.0 | yq '.info.title'Apache-2.0