# Authentication

> How the Dailybot CLI authenticates. Two credentials, one contract, zero context switches.

Language: en
Canonical: https://www.dailybot.com/developers/cli-authentication
Markdown: send header `Accept: text/markdown` on any URL to receive Markdown instead of HTML.
Last Updated: 2026-07-02

---

The Dailybot CLI supports two credential types. Personal use hands off through an OTP-derived Bearer session; automation and AI agents use a long-lived API key. Both credentials grant identical access to every non-CLI-only endpoint — that is the parity guarantee at [/developers/authentication#parity-guarantee](/developers/authentication#parity-guarantee).

<h2 id="personal-login">1. Personal login (`dailybot login`)</h2>

Runs OTP-based authentication in a browser tab. On success, the CLI stores a Bearer session at `~/.dailybot/session.json` and transparently refreshes it before it expires. This is the right choice for a developer working from their own machine.

```bash
dailybot login
# Opens https://app.dailybot.com/cli-auth in your browser.
# You confirm the code the CLI printed.
# Session is stored locally.
```

<h2 id="api-key">2. API key (`$DAILYBOT_API_KEY`)</h2>

A long-lived credential minted from your Dailybot dashboard. No interactive login required. This is the right choice for CI, cron jobs, containers, and any AI agent running in a headless environment.

```bash
# In your CI secrets manager, set DAILYBOT_API_KEY.
export DAILYBOT_API_KEY=dbot_...

# The CLI picks it up automatically.
dailybot agent update "Build passed."
```

<h2 id="credential-precedence">Which credential wins when both are present?</h2>

A live `dailybot login` session takes precedence over `$DAILYBOT_API_KEY`. This matches the developer's mental model: "if I ran `dailybot login`, I want to be me". To confirm which credential is active at any point, run `dailybot me`.

<h2 id="parity">Parity: what works with either credential</h2>

Everything except the four CLI-only endpoints. See the full matrix at [/developers/authentication#parity-guarantee](/developers/authentication#parity-guarantee). If you observe an endpoint that behaves differently across credentials, please file an issue — it's a bug against the guarantee.

<h2 id="renewing">Renewing a session</h2>

CLI Bearer sessions refresh automatically on every command. If you've been offline long enough that the refresh token expired, the CLI will ask you to re-run `dailybot login`. API keys never need refreshing but can be rotated any time from your dashboard.

---

## Developer portal navigation

**Getting Started**

- [Overview](/developers)
- [Quick start](/developers/getting-started)
- [Authentication](/developers/authentication)

**API Reference**

- [API Overview](/developers/api)
- [Users](/developers/api/users)
- [Organization](/developers/api/organization)
- [Teams](/developers/api/teams)
- [Invitations](/developers/api/invitations)
- [Check-ins](/developers/api/check-ins)
- [Forms](/developers/api/forms)
- [Report channels](/developers/api/report-channels)
- [Templates](/developers/api/templates)
- [Kudos](/developers/api/kudos)
- [Mood tracking](/developers/api/mood)
- [Important dates](/developers/api/important-dates)
- [Messaging](/developers/api/messaging)
- [Automations](/developers/api/workflows)
- [Webhooks](/developers/api/webhooks)
- [Commands platform](/developers/api/commands-platform)
- [Agents](/developers/api/agents)
- [OAuth2](/developers/api/oauth2)
- [Integrations](/developers/api/integrations)
- [CLI](/developers/api/cli)

**API guides**

- [Errors & Status Codes](/developers/errors)
- [Rate Limits](/developers/rate-limits)
- [Conventions](/developers/conventions)
- [API Changelog](/developers/api-changelog)
- [Recipes](/developers/recipes)

**Developer Features**

- [Custom commands](/developers/custom-commands)
- [Serverless commands](/developers/serverless)
- [Webhooks & events](/developers/webhooks)
- [Automation API trigger](/developers/workflow-trigger)
- [Activity API](/developers/activity-api)

**CLI**

- [Overview](/developers/cli)
- [Authentication](/developers/cli-authentication) (this page)
- [Command reference](/developers/cli-reference)
- [CI/CD recipes](/developers/cli-ci-cd)
- [Configuration](/developers/cli-configuration)
- [Troubleshooting](/developers/cli-troubleshooting)

**Agent Skill**

- [Overview](/developers/agent-skill)
- [Skills catalog](/skills)

---

## Site navigation

**Product:**
- [Home](/)
- [Product](/product)
- [Pricing](/pricing)
- [Enterprise](/enterprise)
- [Integrations](/integrations)
- [Templates](/templates)

**Resources:**
- [Blog](/blog)
- [Academy](/academy)
- [Changelog](/changelog)
- [Help Center](/help)
- [Developers](/developers)
- [Agents](/agents)

**Company:**
- [About](/about)
- [Careers](/careers)
- [Security](/security)
- [Contact Sales](/demo)

**Connect:**
- [LinkedIn](https://www.linkedin.com/company/dailybot/)
- [X/Twitter](https://twitter.com/dailybot)
- [GitHub](https://github.com/Dailybot-Inc)
- [YouTube](https://www.youtube.com/channel/UC3uM9V52vwX7e3vQpCc4qvA)

