trendsagi 0.0.0-stage → 0.19.0
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/LICENSE +21 -0
- package/README.md +71 -2
- package/bin/trendsagi.js +4 -0
- package/cli_spec.json +799 -0
- package/package.json +47 -4
- package/src/cli.js +783 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) [2025] [TrendsAGI]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,72 @@
|
|
|
1
|
-
#
|
|
1
|
+
# trendsagi
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The TrendsAGI command line: what is trending on social platforms right now, with measured volume, velocity and growth, AI insights on why each topic is moving, evidence-backed recommendations, crisis events, your watchlist and read-only SQL, from a terminal or a shell script. No dependencies; Node.js 18 or later.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx trendsagi login # paste an API key from app.trendsagi.com > Profile > API Keys
|
|
7
|
+
npx trendsagi trends list --category Technology --sort velocity --limit 10
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Or install it once:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install -g trendsagi
|
|
14
|
+
trendsagi --help
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Examples
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
trendsagi trends list --sort velocity --limit 10 # fastest-moving topics
|
|
21
|
+
trendsagi trends analytics 123 --period 7d # one trend's readings over time
|
|
22
|
+
trendsagi trends dossier 123 # source-backed story, timeline and channels
|
|
23
|
+
trendsagi trends enrich 123 --module search_demand # on-demand Deep Dive (can reserve credits)
|
|
24
|
+
trendsagi trends social-evidence get 123 # stored post-level evidence
|
|
25
|
+
trendsagi trends social-evidence run 123 --module posts # refresh it (reserves one credit)
|
|
26
|
+
trendsagi credits social-evidence # balance and one-time packs
|
|
27
|
+
trendsagi insights get 123 # audience, sentiment and marketing angles
|
|
28
|
+
trendsagi insights generate 123 --wait # build fresh insights, then print them
|
|
29
|
+
trendsagi recommendations list --priority high # prioritised actions with their evidence
|
|
30
|
+
trendsagi crisis list --status active
|
|
31
|
+
trendsagi watchlist add "oat milk" --threshold 50000 --email
|
|
32
|
+
trendsagi schema # tables the sql command can read
|
|
33
|
+
trendsagi sql "SELECT category, count(*) FROM trends GROUP BY 1 ORDER BY 2 DESC"
|
|
34
|
+
trendsagi webhooks create --url https://example.com/hooks/trends --trigger trend_velocity --threshold 50
|
|
35
|
+
trendsagi ads preview meta_ads --trend 123 --level ad_group
|
|
36
|
+
trendsagi stream --follow "AI,#SaaS" # live updates as JSON lines (Node.js 22+)
|
|
37
|
+
trendsagi api /api/integrations/delivery/health -q lookback_hours=24 # any endpoint
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
| Commands | What they do |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| `login`, `logout`, `whoami` | Save, forget and check the API key |
|
|
43
|
+
| `trends` | Trending topics: `list`, `get`, `analytics`, `categories`, `autocomplete`, `dossier`, `discoveries`, `enrich`, `search-demand`, `brand-momentum`, `creators`, `ask`, `social-evidence get\|run` |
|
|
44
|
+
| `credits` | `social-evidence` balance, `buy-social-evidence` checkout |
|
|
45
|
+
| `insights` | AI insights: `get`, `generate`, `status`, `search` |
|
|
46
|
+
| `recommendations` (`recs`) | `list`, `action`, `feedback` |
|
|
47
|
+
| `crisis` | `list`, `action` (acknowledge, archive, reopen) |
|
|
48
|
+
| `watchlist` | `list`, `add`, `remove` |
|
|
49
|
+
| `sql`, `schema` | One read-only PostgreSQL SELECT over your data, and the tables it can read |
|
|
50
|
+
| `tools`, `find` | The agent tools (`list`, `call`), and whether TrendsAGI can do a task |
|
|
51
|
+
| `webhooks`, `exports` | Create, change, test and run webhooks and data exports |
|
|
52
|
+
| `ads` | Connected ad platforms: `providers`, `resources`, `preview`, `apply`, `streams`, `report`, `report-export` |
|
|
53
|
+
| `integrations` | `availability`, `status`, `health`, `value` |
|
|
54
|
+
| `stream` | Live trend updates |
|
|
55
|
+
| `usage`, `status`, `api` | API usage, service status, and any endpoint without its own command |
|
|
56
|
+
|
|
57
|
+
## How it behaves
|
|
58
|
+
|
|
59
|
+
- **Key:** `--api-key`, then `TRENDSAGI_API_KEY`, then the key `trendsagi login` saved to `~/.config/trendsagi/config.json` (`%APPDATA%\trendsagi` on Windows). The Python CLI (`pip install trendsagi`) reads the same file.
|
|
60
|
+
- **Output:** lists print as tables in a terminal, and as JSON when piped or with `--json`: `trendsagi trends list | jq '.trends[].name'`.
|
|
61
|
+
- **Safety:** commands that delete something or change live ads ask first; pass `--yes` in scripts.
|
|
62
|
+
- **Exit codes:** 0 success, 1 API or request error, 2 invalid usage, 4 missing or rejected API key.
|
|
63
|
+
- **Usage:** each command is the API request it makes and counts against your plan's daily limit.
|
|
64
|
+
|
|
65
|
+
Run `trendsagi <command> --help` for every option. Guide: [trendsagi.com/api-docs/integrations/cli](https://trendsagi.com/api-docs/integrations/cli). API reference: [trendsagi.com/api-docs/reference](https://trendsagi.com/api-docs/reference).
|
|
66
|
+
|
|
67
|
+
## Also from TrendsAGI
|
|
68
|
+
|
|
69
|
+
- Python client, agent tools and a local MCP server: `pip install trendsagi`
|
|
70
|
+
- Hosted MCP server for Claude, ChatGPT, Grok and Cursor: `https://api.trendsagi.com/mcp` ([setup](https://trendsagi.com/mcp))
|
|
71
|
+
|
|
72
|
+
Source: [github.com/TrendsAGI/TrendsAGI](https://github.com/TrendsAGI/TrendsAGI/tree/main/npm). MIT licensed.
|
package/bin/trendsagi.js
ADDED