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

# Running and chatting locally

> Build, run, and chat with your agent before it touches a cluster.

An agent speaks A2A the moment it starts. You don't need a cluster, or even a connected CLI, to run it and hold a full conversation with it.

<Steps>
  <Step title="Build the image">
    ```sh theme={null}
    nasiko build                    # current directory
    nasiko build --tag my-agent:v2  # custom tag
    nasiko build ./path/to/agent
    ```

    Reads the `Dockerfile` to build, and `AgentCard.json` for the `name:version` tag.
  </Step>

  <Step title="Run it">
    ```sh theme={null}
    nasiko run                      # build + start on port 8000
    nasiko run --port 8080
    ```

    Your agent is live at `http://localhost:8000`, speaking A2A over HTTP.
  </Step>

  <Step title="Chat with it">
    <CodeGroup>
      ```sh Interactive theme={null}
      nasiko chat http://localhost:8000
      ```

      ```sh One-shot theme={null}
      nasiko chat http://localhost:8000 "What can you do?"
      ```

      ```sh Full-screen TUI theme={null}
      nasiko chat http://localhost:8000 --tui
      ```
    </CodeGroup>

    All three talk A2A directly to your container — no control plane involved.
  </Step>
</Steps>

## Resuming a conversation

Conversations are tracked by session, keyed to the A2A `contextId` your agent returns.

```sh theme={null}
nasiko sessions                                                    # list local sessions
nasiko chat http://localhost:8000 --session-id <session-id> "..."  # continue a conversation, one-shot
nasiko chat http://localhost:8000 --resume <session-id> --tui      # continue a conversation, full-screen TUI
nasiko history <session-id>                                        # show message history
```

`--resume` and `--session-id` are not interchangeable: `--resume` always opens the TUI (it fails
outside a real terminal), `--session-id` sends a one-shot message into an existing session.

Useful for iterating on multi-turn behavior — resume the same session after a code change instead of replaying every turn.

## Chatting once you're deployed

The same command works against a deployed agent or the routing engine once you've [connected to a cluster](/adlc/deploy):

```sh theme={null}
nasiko chat "hello"                  # the routing engine
nasiko chat my-agent "hi"            # a specific deployed agent
nasiko chat --agent my-agent "hi"    # same, explicit flag
```

A lone argument containing whitespace is the message, not the target.

## Next

<CardGroup cols={2}>
  <Card title="Deploy and manage" href="/adlc/deploy">
    Push your agent to a cluster.
  </Card>

  <Card title="A2A agents and frameworks" href="/adlc/a2a-agents">
    The protocol behind every `chat` call.
  </Card>
</CardGroup>
