Read-only CLI and interactive TUI for the Chatwoot API.
go build ./cmd/chatwoot/ # build binary
mise run dev # auto-rebuild on file changes
./chatwoot # launch interactive TUI (requires auth)
./chatwoot conversation list # CLI modecmd/chatwoot/main.go Entry point: no args → TUI, otherwise Kong CLI
internal/
sdk/ HTTP client + service modules (conversations, messages, contacts, etc.)
cmd/ Kong command structs with Run(app *App) error
config/ YAML config at ~/.chatwoot/config.yaml
output/ Printer: text (tabwriter), JSON, CSV formats + quiet mode
tui/ Bubbletea interactive TUI
- CLI framework: Kong (alecthomas/kong) — struct-based command tree with tags
- TUI framework: Bubbletea + Lipgloss + Bubbles
- SDK pattern:
client.Conversations(),client.Contacts(), etc. return service objects - Command pattern: each command is a struct with
Run(app *App) error - App struct holds
Client,Printer,Config— passed to all commands
- Kong commands: define flags/args as struct fields with tags, implement
Run(app *App) error skipAuthin main.go: auth/config commands bypass API client creationGetRaw()on Client: for non-account-scoped endpoints (e.g./api/v1/profile)- TUI layout: lipgloss
Width(w)sets content width; borders add +2 visual cols — always account for this
- Contacts list
meta.current_pagereturns as string, not int - Messages list
meta.agent_last_seen_atcan be string - Single contact GET returns
{payload: {contact data}}(wrapped) - Agents list returns raw
[]Agentarray (not wrapped in payload) - Profile endpoint is non-account-scoped:
/api/v1/profile
Use conventional commits without scope: feat:, fix:, chore:, refactor:, docs: