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

# Terminal Client

> Connect synti-cli to a running Synti server over WebSocket to send prompts and manage sessions from the shell.

`synti-cli` is a terminal client for the Synti [headless server](/server/headless). It connects over WebSocket, streams agent responses to your terminal, and scripts cleanly for automation and CI. The client itself is stateless — it marshals commands and streams events while the server does the real work of storing sessions and calling the model.

This page is a quick orientation. For every command, flag, and scripting recipe, see the full [CLI reference](/reference/cli).

## Connect

The client needs a server URL and a matching token. Set them once in your environment:

```bash theme={null}
export SYNTI_SERVER_URL=ws://127.0.0.1:9100
export SYNTI_SERVER_TOKEN=<token>
synti-cli ping
```

`ping` confirms the connection and reports your client ID and latency. The token is the same `SYNTI_SERVER_TOKEN` the server was started with — see [Headless Server](/server/headless) for generating one. For `wss://` endpoints with a self-signed certificate, trust the CA with `SYNTI_TLS_CA` or `--tls-ca`.

## Common tasks

<CardGroup cols={2}>
  <Card title="Manage sessions" icon="comments">
    Create, list, and delete sessions with `synti-cli session ...`.
  </Card>

  <Card title="Send and stream" icon="paper-plane">
    `synti-cli send <session> <message>` streams the response, and accepts piped stdin.
  </Card>

  <Card title="One-off runs" icon="bolt">
    `synti-cli run <prompt>` spawns a temporary server, runs, and exits — no setup.
  </Card>

  <Card title="Validate a server" icon="circle-check">
    `synti-cli --validate-server` exercises the full server lifecycle end to end.
  </Card>
</CardGroup>

## Scripting

Add `--json` for machine-readable output and pipe prompts through stdin:

```bash theme={null}
SESSION_ID=$(synti-cli --json session create --name "CI Run" | jq -r '.id')
echo "Run the test suite and report results" | synti-cli send "$SESSION_ID"
synti-cli session delete "$SESSION_ID"
```

<Tip>
  Flags take precedence over environment variables, so you can override `SYNTI_SERVER_URL` per invocation with `--url` — handy when targeting several servers from one shell.
</Tip>

## Learn more

<CardGroup cols={2}>
  <Card title="CLI Reference" icon="book" href="/reference/cli">
    Full command list, flags, and troubleshooting.
  </Card>

  <Card title="Headless Server" icon="server" href="/server/headless">
    Start and secure the server the client connects to.
  </Card>

  <Card title="Environment Variables" icon="terminal" href="/reference/config/environment-variables">
    Connection variables the client reads.
  </Card>

  <Card title="LLM Connections" icon="plug" href="/reference/config/llm-connections">
    Providers the server can use.
  </Card>
</CardGroup>
