Skip to main content

Command Reference

Complete documentation for all Mention CLI commands, flags, and options.

Global Options

These options are available for all commands:
mention [global-options] <command> <subcommand> [options]
--account-id
string
Account ID to use for the command. If not provided, uses MENTION_ACCOUNT_ID environment variable.Short form: -a
--output
string
default:"json"
Output format. Options: json, tableShort form: -o
--version
boolean
Show version number and exit

app-data

Get application data including available sources, languages, and other configuration.
mention app-data

Example

mention app-data

Example Output

{
  "sources": [
    {"id": "web", "name": "Web"},
    {"id": "twitter", "name": "Twitter"},
    {"id": "facebook", "name": "Facebook"}
  ],
  "languages": [
    {"code": "en", "name": "English"},
    {"code": "fr", "name": "French"},
    {"code": "es", "name": "Spanish"}
  ]
}

alerts list

List all alerts for an account.
mention alerts list --account-id=<account-id>

Options

--account-id
string
required
Account ID (or set MENTION_ACCOUNT_ID environment variable)Short form: -a

Example

mention alerts list --account-id=abc123

Example Output

{
  "alerts": [
    {
      "id": "alert_xyz789",
      "name": "My Brand Monitor",
      "query": {
        "type": "basic",
        "included_keywords": ["mycompany", "mybrand"],
        "excluded_keywords": ["competitor"]
      },
      "languages": ["en"],
      "sources": ["web", "twitter"]
    }
  ]
}

alerts get

Get details of a specific alert.
mention alerts get --account-id=<account-id> --alert-id=<alert-id>

Options

--account-id
string
required
Account ID (or set MENTION_ACCOUNT_ID environment variable)Short form: -a
--alert-id
string
required
Alert ID to retrieveShort form: -i

Example

mention alerts get --account-id=abc123 --alert-id=xyz789

Example Output

{
  "id": "alert_xyz789",
  "name": "My Brand Monitor",
  "query": {
    "type": "basic",
    "included_keywords": ["mycompany", "mybrand"],
    "excluded_keywords": ["competitor"]
  },
  "languages": ["en"],
  "sources": ["web", "twitter"],
  "created_at": "2026-01-15T10:30:00Z"
}

alerts create

Create a new alert to monitor keywords.
mention alerts create --account-id=<account-id> --name=<name> --keywords=<keywords> [options]

Options

--account-id
string
required
Account ID (or set MENTION_ACCOUNT_ID environment variable)Short form: -a
--name
string
required
Name for the alertShort form: -n
--keywords
string
required
Comma-separated keywords to monitorShort form: -k
--excluded
string
Comma-separated keywords to exclude from resultsShort form: -e
--languages
string
default:"en"
Comma-separated language codes (default: en)Short form: -l
--sources
string
default:"web"
Comma-separated sources to monitor (default: web)Short form: -s

Examples

# Create a basic alert
mention alerts create \
  --account-id=abc123 \
  --name="My Brand" \
  --keywords="mycompany,mybrand"

# Create an alert with exclusions and multiple languages
mention alerts create \
  --account-id=abc123 \
  --name="Product Launch" \
  --keywords="newproduct,productname" \
  --excluded="rumor,fake" \
  --languages="en,fr,es" \
  --sources="web,twitter,facebook"

Example Output

{
  "id": "alert_new123",
  "name": "My Brand",
  "query": {
    "type": "basic",
    "included_keywords": ["mycompany", "mybrand"],
    "excluded_keywords": []
  },
  "languages": ["en"],
  "sources": ["web"],
  "created_at": "2026-03-04T15:30:00Z"
}

✓ Alert created: alert_new123

alerts delete

Delete an alert.
mention alerts delete --account-id=<account-id> --alert-id=<alert-id>

Options

--account-id
string
required
Account ID (or set MENTION_ACCOUNT_ID environment variable)Short form: -a
--alert-id
string
required
Alert ID to deleteShort form: -i

Example

mention alerts delete --account-id=abc123 --alert-id=xyz789

Example Output

✓ Alert xyz789 deleted

mentions list

List mentions for an alert with optional filtering.
mention mentions list --account-id=<account-id> --alert-id=<alert-id> [options]

Options

--account-id
string
required
Account ID (or set MENTION_ACCOUNT_ID environment variable)Short form: -a
--alert-id
string
required
Alert ID to get mentions fromShort form: -i
--limit
integer
default:"100"
Maximum mentions to return (default: 100, max: 1000)Short form: -l
--source
string
Filter by source (e.g., web, twitter, facebook)Short form: -s
--tone
string
Filter by tone. Options: positive, negative, neutralShort form: -t
--read
boolean
Filter by read status. Use true or false
--favorite
boolean
Filter by favorite status. Use true or false

Examples

# List all mentions (default limit: 100)
mention mentions list --account-id=abc123 --alert-id=xyz789

# List first 50 mentions
mention mentions list --account-id=abc123 --alert-id=xyz789 --limit=50

# Filter by source
mention mentions list --account-id=abc123 --alert-id=xyz789 --source=twitter

# Filter by tone
mention mentions list --account-id=abc123 --alert-id=xyz789 --tone=positive

# Filter unread mentions
mention mentions list --account-id=abc123 --alert-id=xyz789 --read=false

# Filter favorites
mention mentions list --account-id=abc123 --alert-id=xyz789 --favorite=true

# Combine multiple filters
mention mentions list \
  --account-id=abc123 \
  --alert-id=xyz789 \
  --source=twitter \
  --tone=positive \
  --read=false

Example Output

{
  "mentions": [
    {
      "id": "mention_123",
      "title": "Great product review",
      "description": "I love using this product...",
      "source": "twitter",
      "tone": "positive",
      "read": false,
      "favorite": false,
      "published_at": "2026-03-04T14:20:00Z"
    }
  ]
}

100 mentions returned

mentions get

Get a specific mention by ID.
mention mentions get --account-id=<account-id> --alert-id=<alert-id> --mention-id=<mention-id>

Options

--account-id
string
required
Account ID (or set MENTION_ACCOUNT_ID environment variable)Short form: -a
--alert-id
string
required
Alert IDShort form: -i
--mention-id
string
required
Mention ID to retrieveShort form: -m

Example

mention mentions get \
  --account-id=abc123 \
  --alert-id=xyz789 \
  --mention-id=mention_456

Example Output

{
  "id": "mention_456",
  "title": "Great product review",
  "description": "I love using this product. It has completely transformed my workflow...",
  "original_url": "https://twitter.com/user/status/123456",
  "source": "twitter",
  "author": {
    "name": "John Doe",
    "username": "johndoe"
  },
  "tone": "positive",
  "read": false,
  "favorite": false,
  "trashed": false,
  "published_at": "2026-03-04T14:20:00Z"
}

mentions curate

Update properties of a mention (favorite, read, trashed, tone).
mention mentions curate --account-id=<account-id> --alert-id=<alert-id> --mention-id=<mention-id> [options]

Options

--account-id
string
required
Account ID (or set MENTION_ACCOUNT_ID environment variable)Short form: -a
--alert-id
string
required
Alert IDShort form: -i
--mention-id
string
required
Mention ID to updateShort form: -m
--favorite
boolean
Set favorite status. Use true or false
--read
boolean
Set read status. Use true or false
--trashed
boolean
Set trashed status. Use true or false
--tone
string
Set tone. Options: positive, negative, neutral

Examples

# Mark as favorite
mention mentions curate \
  --account-id=abc123 \
  --alert-id=xyz789 \
  --mention-id=mention_456 \
  --favorite=true

# Mark as read
mention mentions curate \
  --account-id=abc123 \
  --alert-id=xyz789 \
  --mention-id=mention_456 \
  --read=true

# Move to trash
mention mentions curate \
  --account-id=abc123 \
  --alert-id=xyz789 \
  --mention-id=mention_456 \
  --trashed=true

# Change tone
mention mentions curate \
  --account-id=abc123 \
  --alert-id=xyz789 \
  --mention-id=mention_456 \
  --tone=positive

# Update multiple properties
mention mentions curate \
  --account-id=abc123 \
  --alert-id=xyz789 \
  --mention-id=mention_456 \
  --read=true \
  --favorite=true \
  --tone=positive

Example Output

{
  "id": "mention_456",
  "title": "Great product review",
  "description": "I love using this product...",
  "tone": "positive",
  "read": true,
  "favorite": true,
  "trashed": false
}

✓ Mention mention_456 updated

mentions mark-read

Mark all mentions as read for a specific alert.
mention mentions mark-read --account-id=<account-id> --alert-id=<alert-id>

Options

--account-id
string
required
Account ID (or set MENTION_ACCOUNT_ID environment variable)Short form: -a
--alert-id
string
required
Alert ID to mark all mentions as readShort form: -i

Example

mention mentions mark-read --account-id=abc123 --alert-id=xyz789

Example Output

✓ All mentions for alert xyz789 marked as read

mentions stream

Stream all mentions for an alert with automatic pagination. This command is useful for processing large numbers of mentions.
mention mentions stream --account-id=<account-id> --alert-id=<alert-id> [options]

Options

--account-id
string
required
Account ID (or set MENTION_ACCOUNT_ID environment variable)Short form: -a
--alert-id
string
required
Alert ID to stream mentions fromShort form: -i
--source
string
Filter by source (e.g., web, twitter, facebook)Short form: -s
--limit
integer
default:"100"
Mentions per page (default: 100)Short form: -l
--max
integer
Maximum total mentions to stream. If not specified, streams all mentions.

Examples

# Stream all mentions (with automatic pagination)
mention mentions stream --account-id=abc123 --alert-id=xyz789

# Stream first 1000 mentions
mention mentions stream --account-id=abc123 --alert-id=xyz789 --max=1000

# Stream with custom page size
mention mentions stream --account-id=abc123 --alert-id=xyz789 --limit=50

# Stream and filter by source
mention mentions stream --account-id=abc123 --alert-id=xyz789 --source=twitter

# Stream to a file
mention mentions stream --account-id=abc123 --alert-id=xyz789 > mentions.jsonl

Example Output

Each mention is printed as a separate JSON object:
{"id": "mention_001", "title": "First mention", "source": "web"}
{"id": "mention_002", "title": "Second mention", "source": "twitter"}
{"id": "mention_003", "title": "Third mention", "source": "facebook"}
...

1000 mentions streamed

Common Usage Patterns

Piping JSON Output

Use jq to process JSON output:
# Extract alert names
mention alerts list --account-id=abc123 | jq '.alerts[].name'

# Count mentions by source
mention mentions list --account-id=abc123 --alert-id=xyz789 | \
  jq '.mentions | group_by(.source) | map({source: .[0].source, count: length})'

# Get unread mention count
mention mentions list --account-id=abc123 --alert-id=xyz789 --read=false | \
  jq '.mentions | length'

Batch Operations

# Mark all mentions as read
mention mentions mark-read --account-id=abc123 --alert-id=xyz789

# Export all mentions to a file
mention mentions stream --account-id=abc123 --alert-id=xyz789 > mentions.jsonl

# Process mentions in batches
mention mentions stream --account-id=abc123 --alert-id=xyz789 --limit=100 | \
  while read -r mention; do
    echo "Processing: $(echo $mention | jq -r '.id')"
    # Your processing logic here
  done

Using with Scripts

#!/bin/bash

# Set environment variables
export MENTION_ACCESS_TOKEN="your_token"
export MENTION_ACCOUNT_ID="abc123"

# Get all positive mentions from Twitter
mention mentions list \
  --alert-id=xyz789 \
  --source=twitter \
  --tone=positive \
  --limit=1000 | \
  jq '.mentions[] | {title: .title, url: .original_url}'

Error Handling

# Check if command succeeded
if mention alerts get --account-id=abc123 --alert-id=xyz789 > /dev/null 2>&1; then
  echo "Alert exists"
else
  echo "Alert not found"
fi

# Capture exit code
mention alerts list --account-id=abc123
if [ $? -eq 0 ]; then
  echo "Success"
else
  echo "Failed with exit code $?"
fi

Build docs developers (and LLMs) love