Skip to main content
Ardent supports two CLI authentication modes:
  • Browser login for local development.
  • API tokens for CI, scripts, and other headless environments.

ardent login

Open your browser to authenticate with GitHub or email:
ardent login
After login, Ardent automatically selects your project and connector if you only have one of each, so you can go straight to ardent branch create.
✓ Logged in as vikram@tryardent.com

  Auto-selected project 'my-app'
  Auto-selected connector 'my-app-db'
  Ready to branch:
  ardent branch create <name>
✓ Logged in as vikram@tryardent.com

3 projects found.
Next step: select a project: ardent project switch <name>
List your projects: ardent project list

Token login

For one-off headless login, pass a token directly:
ardent login --token <your-token>
For repeat automation, prefer the ARDENT_TOKEN environment variable in a clean CI environment. It avoids writing a session to disk and makes the job’s credential source obvious:
export ARDENT_TOKEN="sk-ard_..."
ardent project list
ardent branch create pr-123 --print-url
If a machine already has a stored browser or token login, the stored token is used before ARDENT_TOKEN. In CI, run on a clean runner or run ardent logout before setting ARDENT_TOKEN if you need to guarantee the environment variable is the only credential source. In GitHub Actions:
env:
  ARDENT_TOKEN: ${{ secrets.ARDENT_TOKEN }}

steps:
  - run: npm install -g ardent-cli
  - run: ardent logout  # important on self-hosted runners; harmless on clean runners
  - run: ardent project switch my-project
  - run: ardent connector switch prod-db
  - run: echo "DATABASE_URL=$(ardent branch create pr-${{ github.run_id }} --print-url)" >> "$GITHUB_ENV"
Create and revoke API tokens from Ardent dashboard > Settings > API keys. Store tokens in your secret manager and rotate them if they are exposed.

ardent status

Check your current authentication, project, connector, and branch:
ardent status
✓ Authenticated
  Email:   vikram@tryardent.com
  Org:     Ardent
If the CLI is authenticated only through ARDENT_TOKEN, status may show token-based authentication and ask you to run ardent login to refresh profile details. That is fine for CI.

ardent logout

Clear stored credentials, stored API URL, current selections, and cached workspace data from this machine:
ardent logout
This does not revoke API tokens in the dashboard. Revoke tokens from Settings > API keys when you want to invalidate them.