diff --git a/cli.mdx b/cli.mdx index 26f9adb2..ce8636fc 100644 --- a/cli.mdx +++ b/cli.mdx @@ -76,3 +76,21 @@ chatwoot convs --help ``` Issues and feedback: [github.com/chatwoot/cli](https://github.com/chatwoot/cli). + +## Uninstalling + +```bash +chatwoot auth logout # remove API key from the OS keyring +rm -rf ~/.chatwoot # delete config (~/.chatwoot/config.yaml) +rm "$(command -v chatwoot)" # delete the binary +``` + +If you set up shell completions, also remove them: + +```bash +rm -f ~/.local/share/bash-completion/completions/chatwoot # bash +rm -f ~/.config/fish/completions/chatwoot.fish # fish +# zsh: delete the `source <(... completion zsh -c)` line from ~/.zshrc +``` + +On Windows, delete the extracted `chatwoot.exe` and the `%USERPROFILE%\.chatwoot` folder. If `CHATWOOT_API_KEY` is set in your environment, unset it in your shell rc — `auth logout` can't remove env-provided credentials. diff --git a/cli/agent-skill.mdx b/cli/agent-skill.mdx index 1aef3cd6..c1968d3b 100644 --- a/cli/agent-skill.mdx +++ b/cli/agent-skill.mdx @@ -36,7 +36,7 @@ export CHATWOOT_API_KEY=your_token_here - **The output contract** — parse `-o json`, never the human-readable text format. - **Safety rules** — `reply` is customer-visible and irreversible, so the agent shows the full text and asks before sending. - **Common pitfalls** — `label` replaces rather than appends, `--query` searches message content (not contacts), `assign --agent ` is a case-insensitive substring match, list endpoints paginate. -- **Composable patterns** — `-q | xargs` for bulk operations, `jq` chaining for lookups. +- **Composable patterns** — `-q | xargs` for bulk operations, `jq` chaining for lookups, and `chatwoot api` for authenticated raw API reads when no first-class command exists. The full skill source lives at [chatwoot/cli/skills/chatwoot-cli](https://github.com/chatwoot/cli/tree/main/skills/chatwoot-cli) read it directly to see exactly what behavior is shaped. @@ -51,6 +51,8 @@ Once the skill is installed, prompts like these work without further setup: The agent composes `chatwoot` commands, parses JSON, and stops to confirm before any write that affects customers. +For raw API calls, agents should check the application Swagger first: [application_swagger.json](https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/application_swagger.json). + ## Remove the skill ```bash diff --git a/cli/commands.mdx b/cli/commands.mdx index 963462f9..ee9d72c1 100644 --- a/cli/commands.mdx +++ b/cli/commands.mdx @@ -68,6 +68,12 @@ chatwoot conv 123 label billing,urgent # sets labels (replaces existing) chatwoot conv 123 priority urgent # urgent | high | medium | low | none ``` +**Contact:** + +```bash +chatwoot conv 123 contact # view the contact (sender) for this conversation +``` + ## Contacts ```bash @@ -94,6 +100,18 @@ chatwoot me # your profile (alias of auth sta chatwoot whoami # same ``` +## Raw API + +Use `chatwoot api` for authenticated API calls that do not have a first-class CLI command yet. Account-relative paths are expanded under `/api/v1/accounts/`, so do not include the `/api/v1/accounts/...` prefix. + +```bash +chatwoot api /conversations/123 # GET /api/v1/accounts//conversations/123 +chatwoot api -X PATCH /conversations/123 --data '{"status":"open"}' +chatwoot api --exact /api/v1/profile # non-account-scoped endpoint +``` + +Use the application Swagger as the endpoint reference before raw API calls: [application_swagger.json](https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/application_swagger.json). + ## Auth & config ```bash @@ -104,6 +122,14 @@ chatwoot config path # print config file path chatwoot config view # print config and credential source ``` +## Version + +```bash +chatwoot version # print the CLI version +chatwoot version --check # check GitHub for a newer release +chatwoot --version # same as `version`, as a flag +``` + ## Global flags | Flag | Short | Description |