API Keys
Pretty uses two authentication methods: browser-based login for interactive use, and API keys for the CLI, CI, and integrations.
How auth works
The Pretty web dashboard uses Clerk for authentication — you sign in with email, Google, or GitHub. The CLI and API use API keys (prefixed with pd_sk_) for authentication.
When you run pretty login, the CLI opens a browser window to authenticate via Clerk, then provisions an API key automatically and saves it locally.
Creating API keys
API keys can be created in two ways:
Via the CLI
The simplest approach — run pretty login and the CLI handles everything:
pretty loginCredentials are saved to ~/.pretty/credentials.json.
Via the dashboard
- Sign in at prettydraft.com/app
- Go to your workspace dashboard
- Create a new API key in the API Keys section
- Copy the key — it's only shown once
Using API keys in CI
For CI pipelines (GitHub Actions, GitLab CI, etc.), use the --token flag to authenticate without a browser:
pretty login --token $PRETTY_API_KEYOr set the token in your CI environment and pass it directly:
# GitHub Actions example
- name: Generate social assets
env:
PRETTY_API_KEY: ${{ secrets.PRETTY_API_KEY }}
run: |
pretty login --token $PRETTY_API_KEY
pretty -p "Generate social media kit from brand/ assets"Credential storage
Credentials are stored in ~/.pretty/credentials.json:
{
"token": "pd_sk_...",
"api_url": "https://api.prettydraft.com",
"default_project": "my-project"
}The file contains your API key, the API server URL, and your default project name. Run pretty logout to remove it.
Per-directory project config
When you run pretty init my-project, a local config file is created at .pretty/project.json in the current directory. This overrides the default project for any pretty commands run in that directory:
{
"project_id": "prj_...",
"project_name": "my-project"
}Project resolution
Pretty resolves which project to use in this order:
--projectflag — explicit, always wins.pretty/project.json— local directory config (frompretty init)default_projectin credentials — user-wide default- Fallback — creates or finds a "default" project