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

# Quickstart: Deploy Flows custom apps with the Cognite CLI

> Scaffold, deploy, publish, and activate a Flows custom app with @cognite/cli@latest from install through activation.

This quickstart is for **developers** who build [Flows custom apps](/cdf/flows/guides/getting-started) and want the fastest path from an empty folder to an app running in Cognite Data Fusion (CDF).

Following the steps below, you will scaffold a React app with `@cognite/cli`, deploy it to your project, and activate a version users can open in CDF.

## Prerequisites

* [Node.js](https://nodejs.org) v18 or later
* A CDF project where you can deploy Flows custom apps
* Basic familiarity with the terminal (optional: [mkcert](https://github.com/FiloSottile/mkcert) for local HTTPS — see [Local HTTPS](#local-https))

## Deploy your first app

<Steps>
  <Step title="Verify the CLI">
    Confirm `@cognite/cli@latest` runs (no global install required):

    ```bash theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
    npx @cognite/cli@latest --version
    ```

    <Check>
      You see a version number printed to the terminal.
    </Check>
  </Step>

  <Step title="Create a new app">
    Run the interactive scaffolder:

    ```bash theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
    npx @cognite/cli@latest apps create my-app
    ```

    You are prompted for display name, description, CDF organization, CDF project, and CDF cluster (for example `greenfield`).

    For scripts or CI, pass flags instead of prompts:

    ```bash theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
    npx @cognite/cli@latest apps create my-app \
      --display-name "My App" \
      --description "My first Flows app" \
      --org my-org \
      --project my-project \
      --cluster greenfield \
      --base-url https://greenfield.cognitedata.com
    ```

    <Check>
      A new `my-app` directory exists with `app.json` and a React project scaffold.
    </Check>
  </Step>

  <Step title="Deploy to CDF">
    From the app directory, deploy a draft version:

    ```bash theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
    cd my-app
    npx @cognite/cli@latest apps deploy
    ```

    <Tip>
      Use `npx @cognite/cli@latest apps deploy --interactive` to sign in through the browser when you do not have deploy secrets configured locally.
    </Tip>

    For CI, set `deployClientId` and `deploySecretName` in `app.json`, set the referenced environment variable, then run `deploy`. See [Authentication](#authentication) and the [command reference](./reference#apps-deploy).

    ```bash theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
    export MY_CLIENT_SECRET=<my-client-secret>
    npx @cognite/cli@latest apps deploy
    ```

    <Check>
      The command completes without errors and reports a successful deployment.
    </Check>
  </Step>

  <Step title="Publish and activate">
    Promote the draft, then set the version users receive:

    ```bash theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
    npx @cognite/cli@latest apps publish .
    npx @cognite/cli@latest apps activate .
    ```

    `activate` combines `publish` and setting the `ACTIVE` alias in one step.

    <Check>
      Your app opens in CDF and shows the version you deployed.
    </Check>
  </Step>
</Steps>

## Authentication

Most commands accept one of the following authentication modes.

| Mode                           | How                                                 | When to use                                |
| ------------------------------ | --------------------------------------------------- | ------------------------------------------ |
| Environment variable (default) | `deployClientId` + `deploySecretName` in `app.json` | CI and repeated local deploys.             |
| Browser (interactive)          | `--interactive`                                     | Local development without storing secrets. |

With `--interactive`, pass `--base-url`, `--project`, and `--org` to skip prompts. Full flag lists are in the [command reference](./reference).

## Local HTTPS

Browsers sometimes require HTTPS for `localhost`. Generate trusted certificates with [mkcert](https://github.com/FiloSottile/mkcert):

```bash theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
npx @cognite/cli@latest apps setup-https
```

Certificates are written to `./certificates/mkcert` by default. See [`apps setup-https`](./reference#apps-setup-https) for `--cert-dir` and other options.

## Code signing

Certified Flows custom apps must be signed before submission. See [`apps sign`](./reference#apps-sign) and [`keys`](./reference#keys) in the command reference, and [App certification](/cdf/flows/guides/application-certification).

## Next steps

You scaffolded a Flows custom app, deployed it to CDF, and activated a version for users.

* [Command reference](./reference) — every `apps` and `keys` command, flag, and option.
* [Get started with Flows](/cdf/flows/guides/getting-started) — concepts, project layout, and how Flows custom apps run in CDF.
* [App certification](/cdf/flows/guides/application-certification) — requirements before you submit a production app.
