Synced package doc
Docs/prompts-gpt Package/Authentication

Authentication

prompts-gpt uses project tokens to authenticate with the prompts-gpt.com API. Tokens are required for cloud features (prompt library, generation, model sync) but not for local-only execution.

Getting a Token

  1. Sign up at prompts-gpt.com
  2. Create or select a project
  3. Copy the project token (starts with pgpt_)

Storing Credentials

Interactive (recommended)

prompts-gpt init

Prompts for the token without echoing it to the terminal.

Direct

prompts-gpt init --token pgpt_abc123def456

From stdin (CI/CD)

printf '%s' "$PROMPTS_GPT_TOKEN" | prompts-gpt init --token-stdin

Masked prompt

prompts-gpt init --token-prompt

Where Credentials Are Stored

Credentials are saved to .prompts-gpt/.credentials.json:

{
  "token": "pgpt_abc123def456",
  "apiUrl": "https://prompts-gpt.com"
}

Security

  • On Unix/macOS: file permissions are set to 0600 (owner-only read/write)
  • Auto-added to .gitignore to prevent accidental commits
  • If the file is found with overly permissive permissions, the CLI auto-fixes them

Environment Variables

Override stored credentials for specific commands or CI/CD:

VariablePurpose
PROMPTS_GPT_TOKENProject token (overrides stored credentials)
PROMPTS_GPT_API_URLCustom API URL (default: https://prompts-gpt.com)
PROMPTS_GPT_TOKEN=pgpt_abc123 prompts-gpt sync

Per-Command Overrides

Every command that calls the API accepts token overrides:

prompts-gpt sync --token pgpt_other_token
prompts-gpt pull --token-stdin < /path/to/token-file
prompts-gpt project --token-prompt

Self-Hosted Instances

For self-hosted prompts-gpt deployments:

prompts-gpt init --token pgpt_abc123 --api-url https://prompts.internal.company.com

The API URL must use HTTPS unless connecting to localhost.

Token Validation

Tokens must:

  • Start with the pgpt_ prefix
  • Be no longer than 256 characters
  • Not be sent over unencrypted HTTP (except to localhost)

Verify your token resolves to the expected project:

prompts-gpt project

CI/CD Integration

For remote machines, prefer env-injected secrets plus a readiness check:

export CI=true
export PROMPTS_GPT_NON_INTERACTIVE=1
export PROMPTS_GPT_TOKEN=pgpt_your_project_token
prompts-gpt doctor --remote
printf '%s' "$PROMPTS_GPT_TOKEN" | prompts-gpt init --token-stdin

GitHub Actions

steps:
  - name: Sync prompts
    env:
      PROMPTS_GPT_TOKEN: ${{ secrets.PROMPTS_GPT_TOKEN }}
    run: npx prompts-gpt sync

GitLab CI

sync-prompts:
  script:
    - npx prompts-gpt sync
  variables:
    PROMPTS_GPT_TOKEN: $PROMPTS_GPT_TOKEN

Features That Require Authentication

FeatureToken Required
prompts-gpt sync (pull from library)Yes
prompts-gpt pullYes
prompts-gpt generateYes
prompts-gpt projectYes
prompts-gpt sync-modelsYes
prompts-gpt runNo
prompts-gpt sweepNo
prompts-gpt orchestrateNo
prompts-gpt doctorNo
prompts-gpt listNo
prompts-gpt setupNo

Next Steps