# User guide

> Install dflow, create an account, and open a hostname.

Web page: /docs/cli/

`dflow` is the command line for this product. It talks to the API at `https://k8s.dflow.sh`. You do not put a kubeconfig on your laptop. dFlow runs the machines. Attach a cluster only if you already have one.

A workspace holds projects. A project holds environments. An application runs in one environment. A route gives that application a hostname. Signup creates one personal workspace, and that workspace stays private.

The full first session is [From install to a URL](/docs/onboarding). Builds, databases, CI, and cleanup are in [Day-one with dflow](/docs/cli/day-one).

## Installation

The installer checks the download against its SHA-256 checksum, then writes `~/.local/bin/dflow`.

Install the binary:

```bash
curl -fsSL https://github.com/dflow-sh/dflow/releases/latest/download/install.sh | sh
```

### Check the binary

`dflow version` prints the build you installed. `dflow upgrade --check` prints your version and the latest release, and does not download a new binary.

## Account

### Create an account

`dflow auth:register --email EMAIL`. You type the password at the prompt. It is 12 to 128 characters. Signup creates one personal workspace. The personal workspace is private and nobody else can join it.

Invite someone only after `dflow workspaces:create`. The second workspace is the one other people can join.

## Project and environment

`dflow projects:create`, then `dflow environments:create`. Each command selects what it creates, so the next command already knows the project and the environment. `dflow projects:create NAME --environment ENVIRONMENT` creates both at once. [dflow context](/docs/cli/path/context-use) prints the current project and environment. `dflow context --project PROJECT --environment ENVIRONMENT` saves a different pair. [dflow context:use](/docs/cli/path/context-use) is that same save.

### Deploy

Write `dflow.json` first. That file is the source of truth. `dflow apps:create` saves the application name, and `dflow apps:document NAME --file dflow.json --yes` stores the file and starts what it declares. `dflow apps:deploy --image IMAGE` is the one-off path, and it updates the stored copy. Read `status` from `--output json` and stop when it is `failed`.

### Hostname

`dflow apps:route:set` with no `--host` asks dFlow for a hostname. `dflow apps:route:show` prints that `host`.

## Commands

| Section | What it covers |
| --- | --- |
| [Install](/docs/cli/setup/install) | The installer, version, and upgrade |
| [Account](/docs/cli/account) | Sign in, sign out, and recover a password |
| [Workspace](/docs/cli/workspace) | List, switch, and invite |
| [Project](/docs/cli/project) | Projects, environments, and context |
| [Applications](/docs/cli/apps) | Build, logs, routes, variables, and secrets |
| [Data](/docs/cli/data) | PostgreSQL, MySQL, MongoDB, Redis, disks, tasks, and templates |
| [Access](/docs/cli/access) | Workspace tokens and operations |
| [API](/docs/api/reference) | The HTTP routes |
| [MCP](/docs/mcp) | The editor server and the skills |

A text error looks like `error: code: message`. `--output json` is the form a script or an editor should read. The codes are on [Exit codes](/docs/cli/exit-codes). Names you may see in older notes, and that this CLI does not run, are on [Not in this CLI yet](/docs/cli/later).
