---
description: Develop a Flue application locally, build and run it, and continue to deployment.
---

# Develop & Build

Last updated May 30, 2026 [ View as Markdown](https://flueframework.com/docs/guide/develop-and-build/index.md) 

Use the Flue CLI to develop your application locally, invoke agents and workflows directly, and build the output you deploy.

This guide covers that lifecycle. For source files and discovery conventions, see [Project Layout](https://flueframework.com/docs/guide/project-layout/). For the routes your application exposes, see [Routing](https://flueframework.com/docs/guide/routing/).

## Develop

`flue dev` is the local development server for a Flue application. It builds the discovered agents, workflows, and optional `app.ts`, serves the application locally, and rebuilds as source files change.

After selecting your normal runtime target in `flue.config.ts`, start the development server:

```
pnpm exec flue dev
```

Use development mode to exercise the same routes and transports that callers will use. Agents and workflows are not public merely because they are built; see [Routing](https://flueframework.com/docs/guide/routing/) to expose them or add application-owned routes such as webhooks.

Keep local credentials and platform values in environment configuration rather than agent source. See [Configuration](https://flueframework.com/docs/reference/configuration/) to choose a runtime target, pass a one-time CLI override, or provide local environment values.

## Run

The CLI can invoke discovered agents and workflows directly through a local Node build. This is useful when you want to exercise application behavior without first exposing or calling an HTTP or WebSocket route.

Use `flue connect` to open an interactive connection to one agent instance:

```
pnpm exec flue connect support-assistant ticket-8472
```

The connection remains open for multiple prompts, so the agent instance and session can continue accumulating context as you work. See the [flue connect CLI reference](https://flueframework.com/docs/cli/connect/) for command options.

Use `flue run` to invoke one finite workflow locally, from a script, or as a CI job:

```
pnpm exec flue run summarize-ticket --payload '{"ticket":"Ticket details"}'
```

`flue run` prints the workflow result and exits. See the [flue run CLI reference](https://flueframework.com/docs/cli/run/) for command options.

Both commands are local Node execution paths. A deployed application receives input through the routes and transports it publishes; see [Routing](https://flueframework.com/docs/guide/routing/) for that boundary.

## Build

`flue build` creates the generated application output that you hand to a deployment environment. Run it before deployment to catch build-time errors and confirm that Flue discovers the agents and workflows you intend to include:

```
pnpm exec flue build
```

The build uses that configured target, or a one-time `--target` override, to produce deployable output in `dist/` by default. See [Configuration](https://flueframework.com/docs/reference/configuration/) to change the output directory.

A build packages the application for its runtime environment. It does not choose a model, add provider credentials, expose additional routes, or configure platform-owned bindings. Keep those concerns in your authored application modules, secrets configuration, and deployment-platform configuration.

## Deploy

Once the application builds and runs in the form you need, follow the [deployment ecosystem guides](https://flueframework.com/docs/ecosystem/overview/) for your destination, including [Node.js](https://flueframework.com/docs/ecosystem/deploy/node/), [Cloudflare](https://flueframework.com/docs/ecosystem/deploy/cloudflare/), managed hosting, and CI workflow execution.

Treat deployment as more than uploading build output: provide secrets and platform bindings, verify application-owned routes such as health checks and webhook ingress, and test any state or workspace behavior that must survive beyond one local process. See [Agents](https://flueframework.com/docs/guide/building-agents/) and the [Data Persistence API](https://flueframework.com/docs/api/data-persistence-api/) for session continuity, [Sandboxes](https://flueframework.com/docs/guide/sandboxes/) for workspace behavior, and [Observability](https://flueframework.com/docs/guide/observability/) for operating an application after deployment.

## Docs Navigation

Current page: [Develop & Build](https://flueframework.com/docs/guide/develop-and-build/)

### Sections

* [Guide](https://flueframework.com/docs/getting-started/quickstart/)
* [Reference](https://flueframework.com/docs/api/agent-api/)
* [CLI](https://flueframework.com/docs/cli/overview/)
* [SDK](https://flueframework.com/docs/sdk/overview/)
* [Ecosystem](https://flueframework.com/docs/ecosystem/overview/)

### Introduction

* [ Getting Started ](https://flueframework.com/docs/getting-started/quickstart/)
* [ What is an agent? ](https://flueframework.com/docs/concepts/agents/)
* [ Why Flue? ](https://flueframework.com/docs/introduction/why-flue/)
* [ Changelog ](https://github.com/withastro/flue/blob/main/CHANGELOG.md)

### Guides

* [ Project Layout ](https://flueframework.com/docs/guide/project-layout/)
* [ Models & Providers ](https://flueframework.com/docs/guide/models/)
* [ Agents ](https://flueframework.com/docs/guide/building-agents/)
* [ Workflows ](https://flueframework.com/docs/guide/workflows/)
* [ Skills ](https://flueframework.com/docs/guide/skills/)
* [ Tools ](https://flueframework.com/docs/guide/tools/)
* [ Subagents ](https://flueframework.com/docs/guide/subagents/)
* [ Sandboxes ](https://flueframework.com/docs/guide/sandboxes/)
* [ Routing ](https://flueframework.com/docs/guide/routing/)
* [ Develop & Build ](https://flueframework.com/docs/guide/develop-and-build/)
* [ Chat ](https://flueframework.com/docs/guide/chat/)
* [ Observability ](https://flueframework.com/docs/guide/observability/)