VectleSkillspscale CI auth: PLANETSCALE_SERVICE_TOKEN_ID and PLANETSCALE_SERVICE_TOKEN

pscale CI auth: PLANETSCALE_SERVICE_TOKEN_ID and PLANETSCALE_SERVICE_TOKEN

Export

Configures PlanetScale CLI auth in CI with service-token env vars. Use when setting up pipelines, GitHub Actions, or any non-interactive job that needs pscale. Exports PLANETSCALE_SERVICE_TOKEN_ID and PLANETSCALE_SERVICE_TOKEN as secrets so the CLI authenticates without a browser. Not for local interactive login.

pscale CI auth: PLANETSCALESERVICETOKENID and PLANETSCALESERVICE_TOKEN

TL;DR: the CLI reads service-token credentials from the environment when the browser flow is unavailable. Create a service token in the dashboard with the needed grants, store the token id and token as CI secrets under exactly those variable names, and export them before any pscale call. The CLI then authenticates non-interactively.

pscale commands need non-interactive auth in CI

Steps

  1. Create a service token in the PlanetScale dashboard with grants for the databases and branches the job touches.
  1. Add two CI secrets: one holding the token id, one holding the token value. Name them exactly PLANETSCALESERVICETOKENID and PLANETSCALESERVICE_TOKEN.
  1. Export both before the pscale step (or set them as job-level env). Run a read-only command like pscale database list. Expected: it lists databases with no login prompt.
  1. If auth fails, re-check the names character by character and confirm the secrets are actually injected into the job, not just defined.

When this applies

  • GitHub Actions, GitLab CI, or any runner needing pscale
  • scheduled jobs and deploy pipelines
  • Docker builds that call pscale

When it doesn't

  • local development — use pscale auth login there
  • auth failures with the vars already set — check the token grants next
  • interactive troubleshooting sessions

Compatibility

pscale CLI; PLANETSCALESERVICETOKENID / PLANETSCALESERVICE_TOKEN env vars; CI secret stores. Verified against the official PlanetScale CLI docs.

Variant phrasings

  • pscale CI authentication service token
  • PLANETSCALESERVICETOKEN_ID env var
  • planetscale github actions auth

Root cause

The CLI checks these two env vars before attempting interactive login, so a correctly named pair silently converts every pscale invocation into an authenticated one. A single typo in either name drops back to the browser flow, which is why the names must be exact.

Edge cases

  • mark both as secret/masked; build logs must never show the token value
  • scope the token to the branches the pipeline needs, not the whole org
  • service tokens do not expire on password change, which is why they suit CI

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=pscale+CI+auth%3A+PLANETSCALE_SERVICE_TOKEN_ID+and+PLANETSCALE_SERVICE_TOKEN&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.