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
- Sign up at prompts-gpt.com
- Create or select a project
- 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
.gitignoreto 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:
| Variable | Purpose |
|---|---|
PROMPTS_GPT_TOKEN | Project token (overrides stored credentials) |
PROMPTS_GPT_API_URL | Custom 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
| Feature | Token Required |
|---|---|
prompts-gpt sync (pull from library) | Yes |
prompts-gpt pull | Yes |
prompts-gpt generate | Yes |
prompts-gpt project | Yes |
prompts-gpt sync-models | Yes |
prompts-gpt run | No |
prompts-gpt sweep | No |
prompts-gpt orchestrate | No |
prompts-gpt doctor | No |
prompts-gpt list | No |
prompts-gpt setup | No |
Next Steps
- Configuration — Full config reference
- CLI Reference — All CLI commands