Skip to content
Developer docs Command reference

CLI commands

Every command with its options and examples: the same text commentgate <command> --help prints, taken from the tool's own definitions.

Updated September 26, 2026

Account

CommandDoes
loginSave an API key (checks it first)
logoutForget a saved API key
whoamiShow the workspace and key in use
profilesList saved profiles, or pick the default

commentgate login

Save an API key for this computer. Create one in CommentGate under Settings, API keys. The key is checked before it is saved, and stored in your config folder where only you can read it. Working for several brands? Save one key per brand with --profile and pick it with --profile on any command. Without a terminal, the key is read from standard input.

Usage
commentgate login [--profile <name>]
OptionDoes
--defaultAlso make this profile the default
Examples
$ commentgate login
$ commentgate login --profile wildermere --default
# In CI or a script, pipe the key in
$ echo "$COMMENTGATE_API_KEY" | commentgate login --profile ci

commentgate logout

Remove a saved key from this computer. The key keeps working elsewhere until you revoke it in Settings, API keys.

Usage
commentgate logout [--profile <name>] [--all]
OptionDoes
--allForget every saved profile
Examples
$ commentgate logout
$ commentgate logout --profile wildermere
$ commentgate logout --all

commentgate whoami

Show the workspace and key in use

Usage
commentgate whoami
Examples
$ commentgate whoami
$ commentgate whoami --profile wildermere --json

commentgate profiles

Agencies keep one saved key per brand. `profiles` lists them, `profiles use <name>` makes one the default.

Usage
commentgate profiles [list | use <name>]
Examples
$ commentgate profiles
$ commentgate profiles use wildermere

Autopilot

CommandDoes
statusHow the autopilot is doing
needs-youAnswer the comments the autopilot is unsure about
guidanceRead or change the autopilot guidance
protectionsList protections, or turn one on or off

commentgate status

How the autopilot is doing this week and last: what it handled on its own, what it asked you, how often it agreed with your corrections, which areas it now handles alone, and what is waiting for you.

Usage
commentgate status
Examples
$ commentgate status
$ commentgate status --profile wildermere
$ commentgate status --json

commentgate needs-you

Walk through the comments the autopilot wants you to decide, newest first. Each shows why it asks and which way it leans. Press h to hide, k to keep, r to reply, s to skip, q to quit. Every answer teaches the autopilot, exactly like answering in the app. When the output is not a terminal (or with --list or --json) it prints the list instead. `needs-you answer` answers one comment, for scripts.

Usage
commentgate needs-you [--limit <n>] | needs-you answer <id> hide|keep|reply ["text"]
OptionDoes
--limit <n>At most this many comments, 1 to 100 (default 50)
--cursor <cursor>Continue from a previous page
--listPrint the list even in a terminal
Examples
$ commentgate needs-you
$ commentgate needs-you --list
$ commentgate needs-you --json | jq -r '.data[].id'
$ commentgate needs-you answer 2a8d5bac-3084-472a-92d9-700577412c23 keep
$ commentgate needs-you answer 2a8d5bac-3084-472a-92d9-700577412c23 reply "Yes, it ships to Canada in 3 to 5 days."

commentgate guidance

Guidance is the plain-language note the autopilot follows, like "Never hide questions about sizing, even rude ones." `get` prints it, `set` replaces it ("-" reads standard input), `edit` opens it in $VISUAL or $EDITOR, `clear` removes it. Up to 2,000 characters.

Usage
commentgate guidance [get | set "text" | edit | clear]
Examples
$ commentgate guidance
$ commentgate guidance set "Never hide questions about sizing or shipping, even rude ones."
$ commentgate guidance edit
$ EDITOR="code --wait" commentgate guidance edit
$ cat guidance.txt | commentgate guidance set -

commentgate protections

Protections are the switches on Setup: scams, spam, hate, competitors, profanity, links, contact (phone numbers and emails), media (images, GIFs and stickers) and negative. `answers` sets how questions get answered: off, draft (you approve each reply) or send. Changes apply to new comments; nothing already decided changes.

Usage
commentgate protections [list | on <name> | off <name> | answers off|draft|send]
Examples
$ commentgate protections
$ commentgate protections on profanity
$ commentgate protections off competitors
$ commentgate protections answers draft
$ commentgate protections --json

Comments

CommandDoes
comments listList comments, newest first
comments getShow one comment
comments hideHide comments on the platform
comments unhideMake hidden comments visible again
comments allowMark comments as fine (unhides them if hidden)
comments archiveMove comments out of the inbox (nothing changes on the platform)
comments unarchiveBring archived comments back to the inbox
comments restoreBring comments back from the Bin
comments deleteDelete comments on the platform (not TikTok)
comments likeLike comments as your Page or account (Facebook and Instagram)
comments blockBlock the authors (Facebook only)
comments unblockUnblock the authors (Facebook only)
comments replyPost a public reply to a comment

commentgate comments list

List comments, newest first. Every filter can be combined. Times take 24h, 7d, 2w, a date (2026-09-01, your local midnight) or a full ISO time.

Usage
commentgate comments list [filters]
OptionDoes
--status <status>One of: visible, hidden, deleted, review, pending
--platform <platform>One of: facebook, instagram, tiktok, youtube, threads
--surface <surface>organic (posts) or ad
--account <id>A connected account id
--ad <id>The platform ad id
--post <id>The platform post id
--external-id <id>The platform comment id
--since <time>Received at or after (24h, 7d, a date)
--until <time>Received before
--limit <n>Comments per page, 1 to 100 (default 50)
--cursor <cursor>Continue from a previous page
--pages <n>Fetch up to this many pages in one go (default 1, at most 20)
Examples
$ commentgate comments list
$ commentgate comments list --status review
$ commentgate comments list --platform tiktok --surface ad --since 24h
$ commentgate comments list --status hidden --since 2026-09-01 --until 2026-09-08
$ commentgate comments list --external-id 918273645501928_484690767
# Every hidden comment from the last week, as JSON lines for jq
$ commentgate comments list --status hidden --since 7d --pages 20 --json | jq -c '.data[]'

commentgate comments get

Show one comment in full: text, author, where it was posted, and why it was decided the way it was.

Usage
commentgate comments get <id>
Examples
$ commentgate comments get 2a8d5bac-3084-472a-92d9-700577412c23
$ commentgate comments get 2a8d5bac-3084-472a-92d9-700577412c23 --json

commentgate comments hide

Hide comments on the platform. Pass one or more comment ids, or "-" to read ids from standard input (one per line). Platform changes are queued and happen within seconds. Each id is reported on its own line; the exit code is non-zero if any failed.

Usage
commentgate comments hide <id...>
Examples
$ commentgate comments hide 2a8d5bac-3084-472a-92d9-700577412c23
$ commentgate comments hide 2a8d5bac-3084-472a-92d9-700577412c23 7f0c7a2e-5a1e-4a0c-9d6e-0f7c2b1e9a11
# Hide everything waiting for review on TikTok ads
$ commentgate comments list --status review --platform tiktok --surface ad --json | jq -r '.data[].id' | commentgate comments hide -

commentgate comments unhide

Make hidden comments visible again. Pass one or more comment ids, or "-" to read ids from standard input (one per line). Platform changes are queued and happen within seconds. Each id is reported on its own line; the exit code is non-zero if any failed.

Usage
commentgate comments unhide <id...>
Examples
$ commentgate comments unhide 2a8d5bac-3084-472a-92d9-700577412c23
$ commentgate comments unhide 2a8d5bac-3084-472a-92d9-700577412c23 7f0c7a2e-5a1e-4a0c-9d6e-0f7c2b1e9a11

commentgate comments allow

Mark comments as fine (unhides them if hidden). Pass one or more comment ids, or "-" to read ids from standard input (one per line). Platform changes are queued and happen within seconds. Each id is reported on its own line; the exit code is non-zero if any failed.

Usage
commentgate comments allow <id...>
Examples
$ commentgate comments allow 2a8d5bac-3084-472a-92d9-700577412c23
$ commentgate comments allow 2a8d5bac-3084-472a-92d9-700577412c23 7f0c7a2e-5a1e-4a0c-9d6e-0f7c2b1e9a11

commentgate comments archive

Move comments out of the inbox (nothing changes on the platform). Pass one or more comment ids, or "-" to read ids from standard input (one per line). Platform changes are queued and happen within seconds. Each id is reported on its own line; the exit code is non-zero if any failed.

Usage
commentgate comments archive <id...>
Examples
$ commentgate comments archive 2a8d5bac-3084-472a-92d9-700577412c23
$ commentgate comments archive 2a8d5bac-3084-472a-92d9-700577412c23 7f0c7a2e-5a1e-4a0c-9d6e-0f7c2b1e9a11

commentgate comments unarchive

Bring archived comments back to the inbox. Pass one or more comment ids, or "-" to read ids from standard input (one per line). Platform changes are queued and happen within seconds. Each id is reported on its own line; the exit code is non-zero if any failed.

Usage
commentgate comments unarchive <id...>
Examples
$ commentgate comments unarchive 2a8d5bac-3084-472a-92d9-700577412c23
$ commentgate comments unarchive 2a8d5bac-3084-472a-92d9-700577412c23 7f0c7a2e-5a1e-4a0c-9d6e-0f7c2b1e9a11

commentgate comments restore

Bring comments back from the Bin. Pass one or more comment ids, or "-" to read ids from standard input (one per line). Platform changes are queued and happen within seconds. Each id is reported on its own line; the exit code is non-zero if any failed.

Usage
commentgate comments restore <id...>
Examples
$ commentgate comments restore 2a8d5bac-3084-472a-92d9-700577412c23
$ commentgate comments restore 2a8d5bac-3084-472a-92d9-700577412c23 7f0c7a2e-5a1e-4a0c-9d6e-0f7c2b1e9a11

commentgate comments delete

Delete comments on the platform (not TikTok). Pass one or more comment ids, or "-" to read ids from standard input (one per line). TikTok only lets you hide other people’s comments, so deleting there is refused. Platform changes are queued and happen within seconds. Each id is reported on its own line; the exit code is non-zero if any failed.

Usage
commentgate comments delete <id...>
Examples
$ commentgate comments delete 2a8d5bac-3084-472a-92d9-700577412c23
$ commentgate comments delete 2a8d5bac-3084-472a-92d9-700577412c23 7f0c7a2e-5a1e-4a0c-9d6e-0f7c2b1e9a11

commentgate comments like

Like comments as your Page or account (Facebook and Instagram). Pass one or more comment ids, or "-" to read ids from standard input (one per line). Platform changes are queued and happen within seconds. Each id is reported on its own line; the exit code is non-zero if any failed.

Usage
commentgate comments like <id...>
Examples
$ commentgate comments like 2a8d5bac-3084-472a-92d9-700577412c23
$ commentgate comments like 2a8d5bac-3084-472a-92d9-700577412c23 7f0c7a2e-5a1e-4a0c-9d6e-0f7c2b1e9a11

commentgate comments block

Block the authors (Facebook only). Pass one or more comment ids, or "-" to read ids from standard input (one per line). Only Facebook lets a Page block people. Other platforms refuse with a message. Platform changes are queued and happen within seconds. Each id is reported on its own line; the exit code is non-zero if any failed.

Usage
commentgate comments block <id...>
Examples
$ commentgate comments block 2a8d5bac-3084-472a-92d9-700577412c23
$ commentgate comments block 2a8d5bac-3084-472a-92d9-700577412c23 7f0c7a2e-5a1e-4a0c-9d6e-0f7c2b1e9a11

commentgate comments unblock

Unblock the authors (Facebook only). Pass one or more comment ids, or "-" to read ids from standard input (one per line). Platform changes are queued and happen within seconds. Each id is reported on its own line; the exit code is non-zero if any failed.

Usage
commentgate comments unblock <id...>
Examples
$ commentgate comments unblock 2a8d5bac-3084-472a-92d9-700577412c23
$ commentgate comments unblock 2a8d5bac-3084-472a-92d9-700577412c23 7f0c7a2e-5a1e-4a0c-9d6e-0f7c2b1e9a11

commentgate comments reply

Post a public reply as your Page or account (up to 2,000 characters). Pass "-" as the text to read it from standard input. Platform limits apply: TikTok cuts replies at 150 characters, Instagram only takes replies to top-level comments that are not hidden.

Usage
commentgate comments reply <id> "text"
Examples
$ commentgate comments reply 2a8d5bac-3084-472a-92d9-700577412c23 "Thanks, Maya! Wide sizes ship in October."
$ cat answer.txt | commentgate comments reply 2a8d5bac-3084-472a-92d9-700577412c23 -

Reports and sales

CommandDoes
reportsTotals for a period: received, hidden, replies, response times
sales recordRecord a sale from a tracked link

commentgate reports

Report totals for a period, counted by the day each comment arrived in your workspace time zone. Without a period flag you get the last 30 days.

Usage
commentgate reports [period] [filters]
OptionDoes
--last <n>dThe last n days, including today (7d, 30d, 4w)
--month <yyyy-mm>One calendar month
--todayToday only
--from <yyyy-mm-dd>First day (inclusive)
--to <yyyy-mm-dd>Last day (inclusive, default today)
--platform <platform>One of: facebook, instagram, tiktok, youtube, threads
--surface <surface>organic (posts) or ad
--account <id>A connected account id
Examples
$ commentgate reports
$ commentgate reports --last 7d
$ commentgate reports --month 2026-08 --surface ad
$ commentgate reports --from 2026-09-01 --to 2026-09-15 --platform instagram
$ commentgate reports --today --json

commentgate sales record

Tell CommentGate about a sale from a tracked link, so the revenue shows next to the comment and campaign that led to it. The click id is the cg_click value added to your store link. Recording the same click again replaces its value, so it is safe to retry.

Usage
commentgate sales record --click <id> --value <amount> [--currency USD] [--at <time>]
OptionDoes
--click <id>The cg_click value from the order (required)
--value <amount>Order value in dollars, not cents (required)
--currency <code>ISO 4217 code (default USD)
--at <time>When the sale happened (default now)
Examples
$ commentgate sales record --click k7Qm2x.a1b2c3d4 --value 129.50
$ commentgate sales record --click k7Qm2x.a1b2c3d4 --value 89 --currency CAD --at 2026-09-22T15:04:00-04:00

Integrations

CommandDoes
hooks listList REST hook subscriptions
hooks deleteUnsubscribe REST hooks
mcpRun a local MCP server for assistants (Claude Desktop, Cursor)

commentgate hooks list

List the REST hooks integrations created in this workspace (Zapier, Make and your own code), newest first. Webhooks added by hand in Settings, Alerts are managed there.

Usage
commentgate hooks list
Examples
$ commentgate hooks list
$ commentgate hooks list --json

commentgate hooks delete

Stop deliveries to one or more hooks at once.

Usage
commentgate hooks delete <id...>
Examples
$ commentgate hooks delete 8f1bee66-640e-4cbd-bc3f-f58ba092a457

commentgate mcp

Run a local MCP server over stdio that connects your assistant to CommentGate with your saved key. Use it with assistants that only run local servers. Add it to the assistant's config as { "command": "npx", "args": ["-y", "commentgate", "mcp"] } Log in first with `npx commentgate login`, or pass COMMENTGATE_API_KEY in the server's env.

Usage
commentgate mcp
Examples
$ npx -y commentgate mcp
$ npx -y commentgate mcp --profile wildermere

Global options

Every command takes these.

OptionDoes
-p, --profile <name>Use the key saved under this profile (one per brand)
--jsonPrint JSON for scripts
--no-colorTurn off colour (NO_COLOR works too)
-h, --helpShow help for this command

COMMENTGATE_API_KEY uses that key instead of a saved one, COMMENTGATE_PROFILE picks the profile when --profile is not given, and NO_COLOR turns off colour.

Exit codes

CodeMeaning
0Done
1Something went wrong on the way (network or server)
2The command line itself is wrong
3Sign-in needed: no key, a revoked key, or a key that cannot do this
4No such comment, hook or item
5Refused: a permission or a platform limit (TikTok cannot delete, already removed)

In the help center