Skip to content

feat: rewrite help text for people - #45

Open
scmmishra wants to merge 4 commits into
feat/multi-accountfrom
feat/better-help
Open

scmmishra wants to merge 4 commits into
feat/multi-accountfrom
feat/better-help

Conversation

@scmmishra

@scmmishra scmmishra commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Rewrites the CLI's help so it reads well for people: plain language, real examples, and a top-level page that's easy to scan.

Stacked on #44 (multi-account), since much of the new text covers @account, pasted links, accounts and use. Once #44 merges, GitHub retargets this PR to main.

chatwoot --help

Before: "CLI for Chatwoot." followed by about 40 commands and verbs in one flat list.

After:

  • a one-line summary, then how commands read (which account, what, which one, then what to do)
  • five examples, including @acme and a pasted dashboard link
  • "New here? Start with: chatwoot auth login"
  • commands grouped under Conversations, Contacts and team, Help center, Accounts and login, and Other
  • only top-level commands listed; chatwoot conv --help shows the verbs
Examples:
    chatwoot convs                      Your open conversations
    chatwoot conv 123                   Look at conversation 123
    chatwoot conv 123 reply "On it!"    Reply to it
    chatwoot @acme convs                The same list, in your acme account

Copied a link from the dashboard? Use it in place of "conv 123":
    chatwoot https://app.chatwoot.com/app/accounts/1/conversations/123 resolve

Every command, argument and flag

Rewritten to say what happens and what to type, for example:

Before After
Reply to the conversation. / Send as a private note instead of a public reply. Send a reply the customer will see, or a private note with --private. / Post a private note only your team can see, instead of a reply.
Set labels on the conversation (replaces existing). Set the conversation's labels. This replaces the labels it has now.
Snooze duration (e.g. 24h, 7d) or absolute date (2006-01-02). Omit to snooze until next reply. When it should come back: a length of time like 4h, 2d, or 1w, or a date like 2026-05-10. Leave out to wait for the customer's next reply.
Agent ID, 'me', or name (case-insensitive substring). Who to assign: me, an agent ID, part of their name, or the start of their email.
Login with your Chatwoot credentials. Log in to a Chatwoot instance. All your accounts there are added.
View a conversation (default). Show the conversation. This is what 'chatwoot conv 123' does.

Examples and warnings where they matter

  • Examples on convs, conv, reply, snooze, assign, label, contacts, accounts, use, auth login, auth logout, hc articles and api.
  • Warnings where a mistake is costly:
    • a reply without --private reaches the customer and can't be taken back
    • label removes any label you leave out
    • use changes the default for every terminal, and @name or CHATWOOT_ACCOUNT switch for less
    • an api request other than GET can change data

Tests that keep it this way

New file cmd/chatwoot/help_test.go:

  • every command, argument and flag has help, written as a sentence (capital letter, ends with a period)
  • the top-level help teaches how commands read, @account and links, and shows the groups
  • the key commands show examples
  • usage lines stay id-first (<id> reply <text>)
  • --help for every command fits in 80 columns

The only code changes are that newParser accepts extra Kong options (so the tests can capture help output) and the top-level help lists commands without expanding their verbs. Nothing else changes behavior.

Layout and color

  • Layout: every section header has a blank line under it. Entries (commands, flags, arguments, examples) start flush left, with descriptions two spaces in.
  • Color, only in a terminal: soft blue headers, bold command names, muted cyan flags, gray italic placeholders like <id>, and gray example descriptions. These are 256-color codes chosen to read on both dark and light backgrounds.
  • Plain output: piped output, --no-color, NO_COLOR and TERM=dumb get no color. A test checks that stripping the colors gives back exactly the plain text.
  • Wording: "view" and "list" as default verbs now say so plainly: "You can leave out 'view': 'chatwoot conv 123' works too."

Plain-language descriptions for every command, argument, and flag, with
examples for the most-used commands. Top-level help explains how commands
read (account, what, which one, verb), shows @account and pasted links,
and groups commands by topic instead of listing every verb.

Tests keep it that way: every command, argument, and flag has help
written as a sentence, key commands show examples, and all help fits an
80-column terminal.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T10:53:51.993089Z b898a10 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Help gets muted 256-color styling in a terminal: soft blue headers, bold
command names, muted cyan flags, gray placeholders and example notes.
Pipes, --no-color, NO_COLOR, and TERM=dumb stay plain, and stripping the
colors always gives back the plain text.

Every section header gets a blank line under it, and entries start flush
left with descriptions two spaces in. Coloring goes by section rather than
by indentation. The default-verb help now says you can leave out 'view'.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b898a10abf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/cmd/auth.go Outdated
Login help promised that every account is added, but on Chatwoot versions
whose profile doesn't list accounts, login asks for one account ID and
adds only that one. The help now says so, and the accounts help no longer
repeats the promise.
@github-actions

Copy link
Copy Markdown

⚠️ Note: Baseline coverage from feat/multi-account branch is not available (artifact may be expired). Showing current coverage for changed files only.

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/chatwoot/cli/cmd/chatwoot 93.55% (+93.55%) 🌟
github.com/chatwoot/cli/internal/cmd 92.85% (+92.85%) 🌟

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/chatwoot/cli/cmd/chatwoot/help.go 96.15% (+96.15%) 52 (+52) 50 (+50) 2 (+2) 🌟
github.com/chatwoot/cli/cmd/chatwoot/main.go 91.67% (+91.67%) 72 (+72) 66 (+66) 6 (+6) 🌟
github.com/chatwoot/cli/internal/cmd/accounts.go 89.92% (+89.92%) 119 (+119) 107 (+107) 12 (+12) 🌟
github.com/chatwoot/cli/internal/cmd/api.go 98.36% (+98.36%) 61 (+61) 60 (+60) 1 (+1) 🌟
github.com/chatwoot/cli/internal/cmd/auth.go 85.28% (+85.28%) 197 (+197) 168 (+168) 29 (+29) 🌟
github.com/chatwoot/cli/internal/cmd/cli.go 0.00% (ø) 1 (+1) 0 1 (+1)
github.com/chatwoot/cli/internal/cmd/config.go 89.23% (+89.23%) 65 (+65) 58 (+58) 7 (+7) 🌟
github.com/chatwoot/cli/internal/cmd/contact.go 97.73% (+97.73%) 44 (+44) 43 (+43) 1 (+1) 🌟
github.com/chatwoot/cli/internal/cmd/conversation.go 97.05% (+97.05%) 237 (+237) 230 (+230) 7 (+7) 🌟
github.com/chatwoot/cli/internal/cmd/help_center.go 95.69% (+95.69%) 116 (+116) 111 (+111) 5 (+5) 🌟
github.com/chatwoot/cli/internal/cmd/inbox.go 100.00% (+100.00%) 23 (+23) 23 (+23) 0 🌟
github.com/chatwoot/cli/internal/cmd/version.go 100.00% (+100.00%) 43 (+43) 43 (+43) 0 🌟

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/chatwoot/cli/cmd/chatwoot/help_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant