Skip to main content
The chatcli connect command transforms your local terminal into a client that connects to a remote ChatCLI server. The entire interactive experience (sessions, contexts, agent, coder) works transparently, as if the LLM were running locally.

Basic Connection

1

Connect to the server

2

Verify server information

Upon connecting, ChatCLI displays server information:
If the server has an active K8s Watcher, it also shows:

All Flags

StackSpot Flags

Ollama Flags


Credential Modes

You can choose how to authenticate with the LLM provider:
Do not send any credential flags. The server uses its own API keys:

One-Shot Mode via Connect

Send a single prompt to the remote server and receive the response:

Interactive Mode

Without the -p flag, ChatCLI starts the full interactive mode:
You have access to all ChatCLI features:
  • Sessions: /session save, /session load, /session list
  • Agent: /agent <task> or /run <task>
  • Coder: /coder <task>
  • Context: @file, @git, @command, @env, @history
  • Persistence: /context create, /context attach
  • Switch: /switch to change provider/model
  • Watcher: /watch status to see K8s Watcher status
  • Remote commands: /status, /plugins list, /agents list, /skills list

Remote Resource Discovery

Upon connecting, the client automatically discovers plugins, agents, and skills available on the server:
Server plugins appear in /plugin list with the [remote] tag. They are executed on the server — the client sends the command via gRPC and receives the result:

Hybrid Mode

  • Local and remote plugins coexist; the [remote] prefix indicates the origin
  • Local and remote agents are listed together; when loading, resolution is transparent
  • When disconnecting (/disconnect), remote resources are automatically removed

Check K8s Watcher Status

If the server has an active K8s Watcher, you can query the status remotely:
Example output:

Environment Variables

Configure default values via environment variables to avoid typing flags every time:

TLS and Security

1

Insecure Connection (Development)

When TLS is disabled, a warning is logged by the client as a reminder that the connection is not encrypted. In production, enable TLS.
2

Connection with TLS

3

Token + TLS (Production)

For a complete security guide (authentication, container hardening, RBAC, etc.), see the security documentation.

Load Balancing with Multiple Replicas

When the ChatCLI server runs with multiple replicas in Kubernetes, the client automatically distributes connections across available pods:
  • The client uses client-side round-robin via gRPC dns:/// resolver
  • Requires a headless Service (ClusterIP: None) in Kubernetes
  • Built-in keepalive (ping every 10s) detects inactive pods and reconnects quickly
  • In the Helm chart, enable service.headless: true when replicaCount > 1
  • In the Operator, headless is activated automatically when spec.replicas > 1

Practical Examples


Next Steps

Server Mode

Configure the server

Deploy

Deploy with Docker and Helm

K8s Watcher

Monitor Kubernetes