Skip to main content
In this recipe, you will set up a centralized ChatCLI server that serves the entire development team. Each member can connect from their terminal and use the AI without needing to manage individual API keys.

Scenario

Small Team

5-10 developers sharing resources

Corporate API Keys

Central server with managed keys

Terminal Access

Each dev connects from their local terminal

Flexible Authentication

Shared token or individual credentials

1

Configure the Server

Create a .env file on the server:
# .env
CHATCLI_SERVER_TOKEN=team-token-2024
LLM_PROVIDER=CLAUDEAI
ANTHROPIC_API_KEY=sk-ant-xxx-corporate-key
ANTHROPIC_MODEL=claude-sonnet-4-5
LOG_LEVEL=info
Start with Docker Compose:
docker compose up -d
2

Distribute Access

Share with the team:
# Add to each dev's .bashrc or .zshrc
export CHATCLI_REMOTE_ADDR=ai-server:50051
export CHATCLI_REMOTE_TOKEN=team-token-2024

# Alias for quick access
alias cia='chatcli connect'
3

Each Dev Connects

# Interactive mode
chatcli connect

# Quick one-shot
chatcli connect -p "Explain the Repository pattern in Go"
4

Allow Individual Credentials (Optional)

Devs who prefer to use their own credentials can do so:
# Dev who has a Claude Pro subscription
chatcli connect --use-local-auth

# Dev who prefers OpenAI
chatcli connect --provider OPENAI --llm-key sk-my-personal-key

# Dev who uses GitHub Copilot
chatcli connect --use-local-auth --provider COPILOT
The server accepts both modes simultaneously. Devs can use the server credentials (default) or provide their own.
5

Add TLS (Production)

For production environments, add TLS:
# Generate certificates (e.g., with Let's Encrypt or certbot)
# Or use mkcert for development

# Start with TLS
chatcli server \
  --tls-cert /etc/chatcli/cert.pem \
  --tls-key /etc/chatcli/key.pem \
  --token team-token-2024
Devs connect with:
chatcli connect server:50051 --tls --token team-token-2024
6

Multiple Providers

Configure the server with multiple API keys. Devs can choose the provider:
# Server with OpenAI, Claude, Google AI, and Copilot
export OPENAI_API_KEY=sk-xxx
export ANTHROPIC_API_KEY=sk-ant-xxx
export GOOGLEAI_API_KEY=AIzaSy-xxx
export GITHUB_COPILOT_TOKEN=ghu_xxx  # or use /auth login github-copilot
export LLM_PROVIDER=CLAUDEAI  # default
chatcli server
# Dev chooses the provider
chatcli connect --provider OPENAI
chatcli connect --provider GOOGLEAI
chatcli connect --provider COPILOT --use-local-auth
chatcli connect  # uses the default (CLAUDEAI)
7

Share Agents, Skills, and Plugins (Optional)

Provision agents, skills, and plugins on the server so the entire team has access to the same resources:
helm install chatcli deploy/helm/chatcli \
  --namespace tools --create-namespace \
  --set llm.provider=CLAUDEAI \
  --set secrets.anthropicApiKey=sk-ant-xxx \
  --set server.token=team-token-2024 \
  --set agents.enabled=true \
  --set-file agents.definitions.devops-senior\\.md=agents/devops-senior.md \
  --set skills.enabled=true \
  --set-file skills.definitions.k8s-best-practices\\.md=skills/k8s-best-practices.md \
  --set plugins.enabled=true \
  --set plugins.initImage=myregistry/chatcli-plugins:latest
When devs connect, they automatically see the server resources:
Connected to ChatCLI server (version: 1.3.0, provider: CLAUDEAI, model: claude-sonnet-4-5)
 Server has 2 plugins, 2 agents, 3 skills available

Operational Tips

# Docker
docker logs chatcli-server -f

# Kubernetes
kubectl logs -f deployment/chatcli -n tools
# The Dockerfile includes a built-in health check
docker inspect chatcli-server --format='{{.State.Health.Status}}'
Set LOG_LEVEL=info on the server to log each request with the provider and model used.
# Docker: persistent volumes
docker cp chatcli-server:/home/chatcli/.chatcli/sessions ./backup/

# Kubernetes: PVC already configured in the Helm chart
When connected to a server, the /session commands interact with both local and remote:
  • /session save asks where to save: local, remote, or both
  • /session list displays sessions from both in separate sections
  • /session load searches both; if found in both, asks which one to load
  • /session delete checks both; if found in both, asks which one to remove
This allows devs to save sessions on the server to share with the team, or locally for offline use.

Summary

ComponentConfiguration
Serverchatcli server --token X
Clientchatcli connect --token X
Env VarsCHATCLI_REMOTE_ADDR, CHATCLI_REMOTE_TOKEN
TLS--tls-cert, --tls-key (server) / --tls (client)
CredentialsServer (default) or client (--llm-key / --use-local-auth)
Agents/Skillsagents.enabled=true + ConfigMap (Helm) or agents.configMapRef (Operator)
Pluginsplugins.enabled=true + init container or PVC (Helm) or plugins.image (Operator)