> ## 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.

# Projects & Environments

> Organize your secrets into projects and environments

Keyflare organizes secrets using a simple hierarchy: **Projects → Environments → Secrets**. See [Core Concepts](/getting-started/introduction#core-concepts).

# Projects

A project is a namespace for related secrets. For example:

* `my-api` — Backend API secrets
* `frontend` — Frontend application secrets
* `worker` — Background worker secrets

### Create a Project

```bash theme={null}
# Create a project with default environments (dev, prod)
kfl projects create my-api

# Create a project without default environments
kfl projects create my-api --environmentless
```

<Note>
  New projects get two default environments (**dev** and **prod**) unless you use `--environmentless`.
</Note>

### List Projects

```bash theme={null}
kfl projects list
```

Output:

```text theme={null}
NAME           ENVIRONMENTS  CREATED
my-api         2             2024-01-15
frontend       2             2024-01-16
worker         3             2024-01-17
```

### Delete a Project

```bash theme={null}
kfl projects delete my-api
```

<Warning>
  Deleting a project removes **all** environments and secrets. This cannot be undone.
</Warning>

# Environments

Each project contains environments. Common environment names:

* `development` / `dev`
* `staging` / `stage`
* `production` / `prod`

### Create an Environment

```bash theme={null}
kfl env create staging --project my-api
```

### List Environments

```bash theme={null}
kfl env list --project my-api
```

Output:

```text theme={null}
ENVIRONMENT    SECRETS  LAST UPDATED
development    12       2024-01-17
staging        12       2024-01-17
production     15       2024-01-18
```

### Delete an Environment

```bash theme={null}
kfl env delete staging --project my-api
```

<Warning>
  Deleting an environment removes **all** secrets in that environment.
</Warning>

# Example: New Project Setup

```bash theme={null}
# 1. Create the project
kfl projects create my-api
# ✓ Project "my-api" created with environments: dev, prod

# 2. Add a staging environment
kfl env create staging --project my-api
# ✓ Environment "staging" created in project "my-api"

# 3. Add secrets to each environment
kfl secrets set DATABASE_URL=postgres://dev... --project my-api --env dev
kfl secrets set DATABASE_URL=postgres://stage... --project my-api --env staging
kfl secrets set DATABASE_URL=postgres://prod... --project my-api --env prod

# 4. Verify
kfl env list --project my-api
# ENVIRONMENT    SECRETS  LAST UPDATED
# dev            1        2024-01-17
# prod           1        2024-01-17
# staging        1        2024-01-17
```

<h2 noAnchor>Next Steps</h2>

<CardGroup cols={2}>
  <Card href="/guides/secrets" title="Manage Secrets">
    Add and update secrets.
  </Card>

  <Card href="/guides/using-secrets" title="Using Secrets">
    Download and inject secrets.
  </Card>
</CardGroup>
