> ## Documentation Index
> Fetch the complete documentation index at: https://keyflare.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

> Deploy Keyflare to your Cloudflare account in minutes

# Quick Start

Get Keyflare running on your Cloudflare account in just a few commands.

## Prerequisites

<CardGroup cols={2}>
  <Card icon="terminal" title="Node.js">
    Node.js 20+ installed on your machine.
  </Card>

  <Card icon="cloud" title="Cloudflare Account">
    A Cloudflare account. **Free tier works perfectly.** You need to be able to create at least one more Worker and one D1 database.
  </Card>
</CardGroup>

## Installation

Install the Keyflare CLI globally:

```bash theme={null}
npm install -g @keyflare/cli
```

Or use it directly with npx:

```bash theme={null}
npx @keyflare/cli init
```

## Optional: Use the bundled agent skill

If you use an AI coding agent in this repo, Keyflare ships with a lightweight CLI usage skill at:

```text theme={null}
.agents/skills/keyflare/SKILL.md
```

It is focused on day-to-day commands (projects, environments, secrets, keys, and `kfl run`).

## Deploy Keyflare

Run the initialization command:

```bash theme={null}
kfl init
```

You'll be prompted to authenticate with Cloudflare:

<Tabs>
  <Tab title="Browser (OAuth)">
    Opens `cloudflare.com` in your browser. Wrangler caches the OAuth session locally, so subsequent runs reuse the session automatically.
  </Tab>

  <Tab title="API Token">
    Generate a token at [Cloudflare Dashboard](https://dash.cloudflare.com/profile/api-tokens) with these permissions:

    * `Workers Scripts:Edit`
    * `D1:Edit`
    * `Workers Routes:Edit`

    Or set `CLOUDFLARE_API_TOKEN` in your environment to skip the prompt (CI-friendly).
  </Tab>
</Tabs>

### What `kfl init` Does

<Steps>
  <Step title="Authenticate">
    Checks for existing Wrangler session or prompts for authentication method.
  </Step>

  <Step title="Deploy Worker">
    Deploys the Keyflare Worker to your Cloudflare account via `wrangler deploy`.
  </Step>

  <Step title="Create Database">
    Wrangler auto-provisions the D1 database from the configuration.
  </Step>

  <Step title="Set Master Key">
    Generates a 256-bit `MASTER_KEY` and stores it as a Worker secret.
  </Step>

  <Step title="Apply Database Schema">
    Runs Drizzle migrations to create the database schema.
  </Step>

  <Step title="Bootstrap">
    Creates the first root user key via the `/bootstrap` endpoint.
  </Step>

  <Step title="Save Configuration">
    Saves the API URL and root key to `~/.config/keyflare/`.
  </Step>
</Steps>

<Warning>
  **Save your master key!** If lost, all encrypted data becomes permanently unrecoverable.
</Warning>

<h2 noAnchor>Next Steps</h2>

Now that Keyflare is deployed, you can:

<CardGroup cols={2}>
  <Card href="/guides/projects" title="Create a Project">
    Organize your secrets into projects and environments.
  </Card>

  <Card href="/guides/secrets" title="Add Secrets">
    Store your first secrets in Keyflare.
  </Card>

  <Card href="/guides/api-keys" title="Create API Keys">
    Generate scoped keys for CI/CD and services.
  </Card>
</CardGroup>
