4 (KEYWORD_NOT_FOUND) with a
sample of what you do track; a name two keywords share exits 2
(AMBIGUOUS_KEYWORD) — pass the id instead.
Add a keyword
--source to monitor every platform your plan allows. On a terminal
with no term, a short wizard asks;
headless runs pass the term. Optional
flags seed the AI’s matching config up front — --context (a one-sentence
disambiguation for relevance scoring), --tag, --exclude-words,
--additional-terms.
Adding is safe to re-run: a term you already track is a no-op that
returns the existing keyword with alreadyExisted: true, exit 0 — no
keyword slot or AI-enrichment call is spent, even when two identical adds
race. At your plan’s keyword cap the add exits 6 (KEYWORD_LIMIT_EXCEEDED)
pointing at octolens org usage.
octolens keywords add
Arguments
Flags
See what you track — and the --no-volume speed-up
status (active/paused) and volume — the keyword’s recent
mention count. That volume ride-along is an analytics aggregation and is
the slow part of the command: typically seconds, against a sub-second
keyword read. When you only need the configuration, skip it:
null (- on a terminal). In a normal run, 0 is a
genuinely quiet keyword; null plus a top-level warning means the volume
lookup itself failed this run — the list is still complete either way.
octolens keywords list
Flags
Tune, pause, resume
keywords update rewrites only the fields you pass — a
concurrent change to a field you did not mention survives. Pass an empty
string to clear a text-list field:
pause stops data collection without deleting anything; resume turns it
back on. Both are idempotent absolute writes — pause on an already-paused
keyword is a safe no-op, and a retry after a timeout can never flip the state
back:
Remove a keyword — the --yes gate and the cascade
Deletion is destructive twice over: it removes the keyword, and it
removes every feed whose filters reference only that keyword — each of which
takes its notification with it. On a terminal the confirmation names exactly
what goes; headless (piped or --json) the command requires --yes, and
without it exits 2 naming the flag with nothing deleted — a script can
never delete by accident:
deletedFeeds and
deletedNotifications are always present (empty arrays when nothing else was
destroyed), so branch on their length. To look before you leap, the REST API
offers a read-only deletion preview — see the
Keywords reference.
The AI suggestions review loop
Octolens continuously proposes keyword-tuning changes — “add this exclude word”, “disable this noisy source” — as suggestions you accept or reject. The loop is three commands:suggestions list --keyword 'acme corp' narrows to one keyword’s pending
suggestions and includes a snapshot of its current matching config, so you
can judge a proposal in context.
octolens suggestions list
Flags
Three semantics that make the loop safe to script:
- Each suggestion is answered at most once.
acceptandrejectact only on apendingsuggestion; one that was already answered exits4(SUGGESTION_NOT_FOUND) with the id echoed — of two racing accepts, exactly one wins. Treat exit4fromacceptas “somebody already answered this”, not as an error to retry. - A concurrent keyword edit is a retryable conflict, never a silent
overwrite. If the keyword changed while a suggestion was being applied,
nothing is written and the suggestion stays pending (
KEYWORD_CHANGED, HTTP 409) — retry to merge onto the current state. - What was applied is reported.
acceptreturnsappliedChangeswith the exact values written, in the same canonical comma-separated formkeywords updateaccepts, so values round-trip between the two commands.
Where to go next
- Watch a new keyword’s mentions arrive:
octolens feeds watch --keyword 'acme corp'(Feeds reference). - The full flag tables for every command here: Keywords reference.
- Keyword-level analytics — volume, co-mentions, sentiment: Export & report.
