---
description: Reference for opening an interactive local agent-instance session from the command line.
---

# flue connect

Last updated May 30, 2026 [ View as Markdown](https://flueframework.com/docs/cli/connect/index.md) 

## Synopsis

```
flue connect <agent> <instance-id> [--target node] [--session <name>] [--root <path>] [--output <path>] [--config <path>] [--env <path>]
```

## Description

`flue connect` builds the selected Node project and opens a local connection to one discovered agent instance. Enter one prompt per line. The connection remains open until end-of-input or interruption so the agent instance and session can be reused between prompts.

The local connection uses private child-process communication. The agent does not need public HTTP or WebSocket exposure, and application ingress middleware is not executed.

## Arguments

| Argument      | Description                      |
| ------------- | -------------------------------- |
| <agent>       | Agent module name to connect to. |
| <instance-id> | Agent-instance identifier.       |

## Options

| Option            | Default                                                    | Description                                                                                                                      |
| ----------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| \--session <name> | default                                                    | Select the session used by each entered prompt.                                                                                  |
| \--target node    | Configuration value                                        | Select the supported local connection target.                                                                                    |
| \--root <path>    | Selected config-file directory, or config search directory | Select the project root.                                                                                                         |
| \--output <path>  | <root>/dist                                                | Select the build output directory.                                                                                               |
| \--config <path>  | Auto-discovered flue.config.\*                             | Select a configuration file.                                                                                                     |
| \--env <path>     | <config-base>/.env, when present                           | Select one alternate .env\-format file loaded before configuration. Relative paths resolve from <config-base>. Shell values win. |

## Output and exit behavior

Build diagnostics are written to stdout before the connection opens. Streamed agent events and prompt errors are written to stderr. A successful non-null prompt result is written as formatted JSON to stdout. Prompt errors do not close the interactive connection. End-of-input closes the connection.

## Target support

`flue connect` supports local Node builds only. Use the public WebSocket surface to connect to a deployed application.

## Examples

```
flue connect assistant customer-123 --target node
flue connect assistant customer-123 --session support --env .env.staging
```

See [Develop & Build](https://flueframework.com/docs/guide/develop-and-build/) for the local development workflow.

## Docs Navigation

Current page: [flue connect](https://flueframework.com/docs/cli/connect/)

### 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/)

### CLI

* [ Overview ](https://flueframework.com/docs/cli/overview/)
* [ init ](https://flueframework.com/docs/cli/init/)
* [ dev ](https://flueframework.com/docs/cli/dev/)
* [ connect ](https://flueframework.com/docs/cli/connect/)
* [ run ](https://flueframework.com/docs/cli/run/)
* [ build ](https://flueframework.com/docs/cli/build/)
* [ logs ](https://flueframework.com/docs/cli/logs/)
* [ add ](https://flueframework.com/docs/cli/add/)