@1a35e1/sonar-cli 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -136
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
# 🔊 Sonar (
|
|
1
|
+
# 🔊 Sonar (Alpha)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Agent optimised [X](https://x.com) CLI for founders who want to stay ahead of the curve.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
We got tired of missing important content in our feed and built Sonar to fix it.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Pipe it into scripts,
|
|
10
|
-
* automate your morning briefing,
|
|
11
|
-
* Or just discover tweets you probably missed out on the web interface.
|
|
12
|
-
|
|
13
|
-
---
|
|
7
|
+
Sonar matches your interests from your X network, filtering only relevant content from your graph using a variety of AI pipelines. We built this to automate our social intelligence at [@LighthouseGov](https://x.com/LighthouseGov).
|
|
14
8
|
|
|
15
9
|
## Get started
|
|
16
10
|
|
|
17
|
-
*
|
|
18
|
-
* Learn more about which [scopes](#scopes) we request and why.
|
|
11
|
+
* Login with your `X` account to obtain a [free API key](https://sonar.8640p.info/).
|
|
19
12
|
|
|
20
13
|
Install the CLI
|
|
21
14
|
|
|
@@ -26,7 +19,7 @@ pnpm add -g @1a35e1/sonar-cli@latest
|
|
|
26
19
|
Register your API key.
|
|
27
20
|
|
|
28
21
|
```sh
|
|
29
|
-
#
|
|
22
|
+
# Ensure "SONAR_API_KEY" available in your env
|
|
30
23
|
export SONAR_API_KEY=snr_xxxxx
|
|
31
24
|
|
|
32
25
|
# or, manually register
|
|
@@ -52,54 +45,11 @@ sonar status --watch
|
|
|
52
45
|
|
|
53
46
|
## Scopes
|
|
54
47
|
|
|
55
|
-
* We currently request `read:*` and `offline:processing` scopes
|
|
56
|
-
|
|
57
|
-
* So we can stay connected to your account until you revoke access.
|
|
58
|
-
* Posts you’ve liked and likes you can view.
|
|
59
|
-
* All the posts you can view, including posts from protected accounts.
|
|
60
|
-
* Accounts you’ve muted.
|
|
61
|
-
* Accounts you’ve blocked.
|
|
62
|
-
* People who follow you and people who you follow.
|
|
63
|
-
* All your Bookmarks.
|
|
64
|
-
* Lists, list members, and list followers of lists you’ve created or are a member of, including private lists.
|
|
65
|
-
* Any account you can view, including protected accounts.
|
|
66
|
-
|
|
67
|
-
## Why Sonar exists
|
|
68
|
-
|
|
69
|
-
Setting up your own social data pipeline is genuinely awful. You're looking at OAuth flows, rate limit math, pagination handling, webhook plumbing, deduplication logic, and a SQLite schema you'll regret in three weeks — before you've seen a single useful result. Most developers who try it abandon it halfway through.
|
|
70
|
-
|
|
71
|
-
**Sonar skips all of that. Get actionalable data for OpenClaw in 15 minutes.**
|
|
72
|
-
|
|
73
|
-
We believe your data is yours. If you want to go deeper than our platform allows — build your own models, run custom queries, pipe it into your own tooling — you can sync everything we have indexed on your behalf into a local SQLite database:
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
sonar sync # sync data to ~/.sonar/data.db
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
No lock-in. If you outgrow us, you leave with your data intact.
|
|
80
|
-
|
|
81
|
-
## Design philosophy
|
|
82
|
-
|
|
83
|
-
There's a quiet shift happening in how developer tools are built.
|
|
48
|
+
* We currently request `read:*` and `offline:processing` scopes
|
|
49
|
+
* This allows us to read your feed, bookmarks, followers/following, and other account data to power our signal filtering and topic suggestions.
|
|
84
50
|
|
|
85
|
-
In the early web2 era, API-first was a revelation. Stripe, Twilio, Sendgrid — companies that exposed clean REST contracts unlocked entire ecosystems of products built on top of them. The insight was simple: if your service has strong, reliable APIs, anyone can build anything. The interface didn't matter as much as the contract underneath.
|
|
86
|
-
We're at a similar inflection point now, but the interface layer has changed dramatically.
|
|
87
51
|
|
|
88
|
-
|
|
89
|
-
Which raises an interesting question about CLIs themselves. Traditionally a CLI was developer-first by definition — you were writing for someone comfortable with flags, pipes, and man pages. But if the primary consumer of your CLI is increasingly an agent (OpenClaw, a cron job, an LLM with tool access), the design principles shift:
|
|
90
|
-
|
|
91
|
-
Output should be machine-readable by default. Every command has a --json flag. Agents don't parse card renders.
|
|
92
|
-
Commands should be composable. Small, single-purpose commands that pipe cleanly into each other are more useful to an agent than monolithic workflows.
|
|
93
|
-
|
|
94
|
-
Side effects should be explicit. An agent calling index --force should know exactly what it's triggering. No surprises.
|
|
95
|
-
Errors should be structured. A human reads an error message. An agent needs to know whether to retry, skip, or escalate.
|
|
96
|
-
|
|
97
|
-
The CLI still needs to work well for humans — interactive mode, card renders, readable output — but those are progressive enhancements on top of a foundation built for automation. Design for the agent, polish for the human.
|
|
98
|
-
This is what API-first looks like in the agentic era: strong contracts at the service layer, composable interfaces at the CLI layer, and a clear separation between the two.
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## What you can do with it
|
|
52
|
+
## Use cases
|
|
103
53
|
|
|
104
54
|
### Morning briefing in one command
|
|
105
55
|
|
|
@@ -174,11 +124,21 @@ sonar --no-interactive # disable for scripting
|
|
|
174
124
|
|
|
175
125
|
Mark suggestions as skip, later, or archive — keyboard-driven.
|
|
176
126
|
|
|
127
|
+
### Build your own filters and dashboards (WIP)
|
|
128
|
+
|
|
129
|
+
Download your data and build your own tools on top of it.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
sonar sync # sync data to ~/.sonar/data.db
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
No lock-in. If you outgrow us, you leave with your data intact.
|
|
136
|
+
|
|
177
137
|
---
|
|
178
138
|
|
|
179
|
-
## How Sonar finds
|
|
139
|
+
## How Sonar finds relevant content
|
|
180
140
|
|
|
181
|
-
Sonar surfaces relevant content from your
|
|
141
|
+
Sonar surfaces relevant content from your immediate network — the people you follow and who follow you. Your network is already a curated signal layer. Sonar's job is to surface what's moving through that graph before it reaches mainstream feeds.
|
|
182
142
|
|
|
183
143
|
What this means in practice:
|
|
184
144
|
|
|
@@ -187,67 +147,6 @@ What this means in practice:
|
|
|
187
147
|
* Bookmarking and liking content improves your recommendations over time
|
|
188
148
|
* Topics sharpen what Sonar surfaces within your graph
|
|
189
149
|
|
|
190
|
-
---
|
|
191
|
-
|
|
192
|
-
## Pair with OpenClaw
|
|
193
|
-
|
|
194
|
-
[OpenClaw](https://github.com/openclaw/openclaw) is a local-first autonomous AI agent that runs on your machine and talks to you through WhatsApp, Telegram, Discord, Slack, or iMessage. It can execute shell commands, run on a schedule, and be extended with custom skills.
|
|
195
|
-
|
|
196
|
-
Sonar + OpenClaw is a natural stack: **Sonar handles the signal filtering and curation, OpenClaw handles delivery and action.** Together they turn your social feed into an ambient intelligence layer you don't have to babysit.
|
|
197
|
-
|
|
198
|
-
### Morning briefing delivered to your phone
|
|
199
|
-
|
|
200
|
-
Set up a cron job in OpenClaw to run your Sonar digest every morning:
|
|
201
|
-
|
|
202
|
-
```
|
|
203
|
-
# In OpenClaw: schedule a daily 8am briefing
|
|
204
|
-
"Every morning at 8am, run `sonar --hours 8 --json` and summarize the top 5 posts for me"
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
OpenClaw will execute the CLI, pass the JSON output to your LLM, and send a clean summary straight to your phone.
|
|
208
|
-
|
|
209
|
-
### Ask your feed questions in natural language
|
|
210
|
-
|
|
211
|
-
Because `--json` makes Sonar output composable, OpenClaw can reason over it:
|
|
212
|
-
|
|
213
|
-
```
|
|
214
|
-
# Example prompts you can send OpenClaw via WhatsApp:
|
|
215
|
-
"What's the most discussed topic in my Sonar feed today?"
|
|
216
|
-
"Did anyone in my feed mention Uniswap V4 in the last 48 hours?"
|
|
217
|
-
"Summarize my Sonar suggestions"
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
### Get alerted when a topic spikes
|
|
221
|
-
|
|
222
|
-
Use OpenClaw's Heartbeat to watch for signal surges:
|
|
223
|
-
|
|
224
|
-
```
|
|
225
|
-
# OpenClaw cron: check every 2 hours
|
|
226
|
-
"Run `sonar --hours 2 --json` — if there are more than 10 posts about
|
|
227
|
-
'token launchpad' or 'LVR', send me a Telegram alert with the highlights"
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
### Build a Sonar skill for OpenClaw
|
|
231
|
-
|
|
232
|
-
Wrap Sonar as a reusable OpenClaw skill:
|
|
233
|
-
|
|
234
|
-
```typescript
|
|
235
|
-
// skills/sonar.ts
|
|
236
|
-
export async function getSuggestions(hours = 12) {
|
|
237
|
-
const { stdout } = await exec(`sonar --hours ${hours} --json`);
|
|
238
|
-
return JSON.parse(stdout);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
export async function getStatus() {
|
|
242
|
-
const { stdout } = await exec(`sonar status --json`);
|
|
243
|
-
return JSON.parse(stdout);
|
|
244
|
-
}
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
Once registered, OpenClaw can call these tools autonomously whenever it decides they're relevant.
|
|
248
|
-
|
|
249
|
-
---
|
|
250
|
-
|
|
251
150
|
## Setup
|
|
252
151
|
|
|
253
152
|
### Prerequisites
|
|
@@ -317,7 +216,9 @@ Press `q` to quit follow mode.
|
|
|
317
216
|
sonar topics # list all topics
|
|
318
217
|
sonar topics --json # JSON output
|
|
319
218
|
sonar topics add "AI agents" # add a topic
|
|
320
|
-
sonar topics
|
|
219
|
+
sonar topics view <id> # view a topic
|
|
220
|
+
sonar topics edit <id> --name "New Name"
|
|
221
|
+
sonar topics delete <id> # delete a topic
|
|
321
222
|
```
|
|
322
223
|
|
|
323
224
|
#### AI-powered topic suggestions
|
|
@@ -346,7 +247,7 @@ sonar status --watch # poll every 2s
|
|
|
346
247
|
```bash
|
|
347
248
|
sonar skip --id <suggestion_id> # skip a suggestion
|
|
348
249
|
sonar later --id <suggestion_id> # save for later
|
|
349
|
-
sonar archive
|
|
250
|
+
sonar archive --id <suggestion_id> # archive a suggestion
|
|
350
251
|
```
|
|
351
252
|
|
|
352
253
|
### Config
|
|
@@ -356,30 +257,30 @@ sonar config # show current config
|
|
|
356
257
|
sonar config setup key=<API_KEY> # set API key
|
|
357
258
|
```
|
|
358
259
|
|
|
359
|
-
###
|
|
260
|
+
### Sync
|
|
360
261
|
|
|
361
262
|
```bash
|
|
362
|
-
sonar sync
|
|
263
|
+
sonar sync bookmarks # sync bookmarks to local SQLite
|
|
363
264
|
```
|
|
364
265
|
|
|
365
266
|
---
|
|
366
267
|
|
|
367
268
|
## Environment Variables
|
|
368
269
|
|
|
369
|
-
| Variable
|
|
370
|
-
|
|
371
|
-
| `SONAR_API_KEY`
|
|
372
|
-
| `SONAR_API_URL`
|
|
373
|
-
| `SONAR_MAX_RETRIES` | No
|
|
374
|
-
| `OPENAI_API_KEY`
|
|
375
|
-
| `ANTHROPIC_API_KEY` | For `topics suggest` | Required when using Anthropic vendor for AI suggestions
|
|
270
|
+
| Variable | Required | Purpose |
|
|
271
|
+
| ------------------- | -------------------- | ------------------------------------------------------------------- |
|
|
272
|
+
| `SONAR_API_KEY` | Yes | Auth token from [sonar.8640p.info](https://sonar.8640p.info/) |
|
|
273
|
+
| `SONAR_API_URL` | No | GraphQL endpoint (default: production API) |
|
|
274
|
+
| `SONAR_MAX_RETRIES` | No | Max retry attempts on transient failures (default: 3, 0 to disable) |
|
|
275
|
+
| `OPENAI_API_KEY` | For `topics suggest` | Required when using OpenAI vendor for AI suggestions |
|
|
276
|
+
| `ANTHROPIC_API_KEY` | For `topics suggest` | Required when using Anthropic vendor for AI suggestions |
|
|
376
277
|
|
|
377
278
|
## Local Files
|
|
378
279
|
|
|
379
|
-
| Path
|
|
380
|
-
|
|
280
|
+
| Path | Contents |
|
|
281
|
+
| ---------------------- | ---------------------------- |
|
|
381
282
|
| `~/.sonar/config.json` | Token, API URL, CLI defaults |
|
|
382
|
-
| `~/.sonar/data.db`
|
|
283
|
+
| `~/.sonar/data.db` | Local synced SQLite database |
|
|
383
284
|
|
|
384
285
|
---
|
|
385
286
|
|