@emergentmethods/asknews-cli 0.1.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.
Files changed (38) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +121 -0
  3. package/dist/bin.js +12287 -0
  4. package/dist/bin.js.map +7 -0
  5. package/package.json +79 -0
  6. package/scripts/postinstall.mjs +26 -0
  7. package/skills/asknews-cli/SKILL.md +94 -0
  8. package/skills/asknews-cli/references/commands/alerts.md +135 -0
  9. package/skills/asknews-cli/references/commands/api-alerts.md +186 -0
  10. package/skills/asknews-cli/references/commands/api-analytics.md +31 -0
  11. package/skills/asknews-cli/references/commands/api-autofilter.md +31 -0
  12. package/skills/asknews-cli/references/commands/api-byok.md +72 -0
  13. package/skills/asknews-cli/references/commands/api-charts.md +28 -0
  14. package/skills/asknews-cli/references/commands/api-chat.md +108 -0
  15. package/skills/asknews-cli/references/commands/api-distribution.md +46 -0
  16. package/skills/asknews-cli/references/commands/api-forecast.md +44 -0
  17. package/skills/asknews-cli/references/commands/api-graph.md +41 -0
  18. package/skills/asknews-cli/references/commands/api-index-urls.md +32 -0
  19. package/skills/asknews-cli/references/commands/api-news.md +164 -0
  20. package/skills/asknews-cli/references/commands/api-newsletters.md +236 -0
  21. package/skills/asknews-cli/references/commands/api-ping.md +19 -0
  22. package/skills/asknews-cli/references/commands/api-profile.md +27 -0
  23. package/skills/asknews-cli/references/commands/api-reddit.md +34 -0
  24. package/skills/asknews-cli/references/commands/api-stories.md +75 -0
  25. package/skills/asknews-cli/references/commands/api-websearch.md +37 -0
  26. package/skills/asknews-cli/references/commands/api-wiki.md +33 -0
  27. package/skills/asknews-cli/references/commands/api.md +52 -0
  28. package/skills/asknews-cli/references/commands/auth.md +50 -0
  29. package/skills/asknews-cli/references/commands/cli.md +31 -0
  30. package/skills/asknews-cli/references/commands/index.md +41 -0
  31. package/skills/asknews-cli/references/commands/news.md +89 -0
  32. package/skills/asknews-cli/references/commands/reddit.md +38 -0
  33. package/skills/asknews-cli/references/commands/request.md +34 -0
  34. package/skills/asknews-cli/references/commands/research.md +73 -0
  35. package/skills/asknews-cli/references/commands/stories.md +74 -0
  36. package/skills/asknews-cli/references/commands/web.md +40 -0
  37. package/skills/asknews-cli/references/commands/wiki.md +39 -0
  38. package/skills/asknews-cli/references/task-recipes.md +164 -0
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@emergentmethods/asknews-cli",
3
+ "version": "0.1.0",
4
+ "description": "The official AskNews CLI for humans, automation, and agents",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Emergent Methods <contact@emergentmethods.ai>",
8
+ "homepage": "https://docs.asknews.app/cli",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/emergentmethods/asknews-cli.git"
12
+ },
13
+ "bugs": "https://github.com/emergentmethods/asknews-cli/issues",
14
+ "keywords": [
15
+ "asknews",
16
+ "news",
17
+ "cli",
18
+ "deepnews",
19
+ "research",
20
+ "agents",
21
+ "openapi"
22
+ ],
23
+ "bin": {
24
+ "asknews": "./dist/bin.js"
25
+ },
26
+ "files": [
27
+ "dist/",
28
+ "skills/",
29
+ "scripts/postinstall.mjs"
30
+ ],
31
+ "engines": {
32
+ "node": ">=22.15"
33
+ },
34
+ "packageManager": "pnpm@10.11.0",
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "scripts": {
39
+ "build": "pnpm generate && pnpm build:bundle",
40
+ "build:bundle": "tsx scripts/build.ts",
41
+ "check": "pnpm lint && pnpm typecheck && pnpm test:coverage",
42
+ "dev": "tsx src/bin.ts",
43
+ "generate": "pnpm generate:openapi && pnpm generate:docs",
44
+ "generate:docs": "tsx scripts/generate-docs.ts",
45
+ "generate:openapi": "tsx scripts/generate-openapi.ts",
46
+ "lint": "biome check .",
47
+ "lint:fix": "biome check --write .",
48
+ "postinstall": "node scripts/postinstall.mjs",
49
+ "package:tarball": "tsx scripts/package-tarball.ts",
50
+ "sync:docs": "tsx scripts/sync-docs-site.ts",
51
+ "sync:docs:check": "tsx scripts/sync-docs-site.ts --check",
52
+ "sync:openapi": "tsx scripts/sync-openapi.ts",
53
+ "sync:openapi:check": "tsx scripts/sync-openapi.ts --check",
54
+ "test": "vitest run",
55
+ "test:coverage": "vitest run --coverage",
56
+ "test:live": "ASKNEWS_LIVE_TESTS=1 vitest run test/live",
57
+ "typecheck": "tsc --noEmit"
58
+ },
59
+ "dependencies": {
60
+ "@clack/prompts": "1.6.0",
61
+ "chalk": "5.6.2",
62
+ "cli-table3": "0.6.5",
63
+ "commander": "14.0.3",
64
+ "terminal-link": "^5.0.0",
65
+ "yaml": "2.8.3",
66
+ "zod": "3.25.76"
67
+ },
68
+ "devDependencies": {
69
+ "@biomejs/biome": "2.5.0",
70
+ "@types/node": "22.19.1",
71
+ "@vitest/coverage-v8": "4.1.9",
72
+ "esbuild": "0.28.1",
73
+ "fast-check": "4.8.0",
74
+ "openapi-types": "12.1.3",
75
+ "tsx": "4.22.4",
76
+ "typescript": "5.9.3",
77
+ "vitest": "4.1.9"
78
+ }
79
+ }
@@ -0,0 +1,26 @@
1
+ import { cpSync, existsSync, mkdirSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { dirname, join, resolve } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+
6
+ if (process.env.ASKNEWS_NO_AGENT_SKILLS !== "1") {
7
+ const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
8
+ const source = resolve(packageRoot, "skills/asknews-cli");
9
+ const agentHome =
10
+ process.env.ASKNEWS_AGENT_HOME || process.env.npm_config_asknews_agent_home || homedir();
11
+ if (existsSync(source) && !existsSync(resolve(packageRoot, ".git"))) {
12
+ const agentRoots = [join(agentHome, ".agents")];
13
+ const claudeRoot = join(agentHome, ".claude");
14
+ if (existsSync(claudeRoot)) agentRoots.push(claudeRoot);
15
+ for (const agentRoot of agentRoots) {
16
+ const target = join(agentRoot, "skills", "asknews-cli");
17
+ try {
18
+ mkdirSync(dirname(target), { recursive: true });
19
+ cpSync(source, target, { recursive: true, force: true });
20
+ } catch (error) {
21
+ const message = error instanceof Error ? error.message : String(error);
22
+ process.stderr.write(`AskNews agent skill setup skipped for ${agentRoot}: ${message}\n`);
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: asknews-cli
3
+ description: Use the AskNews CLI for current or historical news retrieval, story tracking, multi-source DeepNews research, web/Reddit/Wikipedia search, alerts, and any customer-facing AskNews API operation. Use when an agent needs sourced real-world information, news context, structured AskNews data, or safe AskNews automation.
4
+ ---
5
+
6
+ # AskNews CLI
7
+
8
+ Use `asknews` instead of constructing HTTP requests. The CLI handles authentication, schema-derived
9
+ parameters, API errors, output formats, and mutation safeguards.
10
+
11
+ ## Workflow
12
+
13
+ 1. Verify availability with `asknews --version`. If it is missing, tell the user how to install it;
14
+ do not invent an API fallback.
15
+ 2. Check credentials with `asknews auth status --offline --output json`. Never display credentials.
16
+ 3. Select the narrowest command family that answers the request.
17
+ 4. For unfamiliar or advanced options, run that command's `--help` before execution. The installed
18
+ help is authoritative because it is generated from the current OpenAPI schema.
19
+ 5. Start with a small result set, inspect structured output, then broaden only when needed.
20
+ 6. Report the answer with dates and source provenance. Distinguish retrieved facts from your own
21
+ synthesis.
22
+
23
+ ## Select the command
24
+
25
+ | Need | Use |
26
+ | --- | --- |
27
+ | Individual current or historical articles | `asknews news search` |
28
+ | Clustered narratives and evolving events | `asknews stories list`, then `stories get` |
29
+ | A synthesized answer across multiple sources | `asknews research` |
30
+ | Live web, Reddit, or Wikipedia context | `asknews web`, `asknews reddit`, `asknews wiki` |
31
+ | Existing monitoring configuration | `asknews alerts` |
32
+ | A less common public API capability | `asknews api list`, then a generated command |
33
+ | An API path with no generated command | `asknews request` as a last resort |
34
+
35
+ Use article search when the user needs evidence or a source set. Use stories when they need the
36
+ shape and development of an event. Use DeepNews only when synthesis is requested or materially
37
+ useful; it is slower and potentially more expensive than retrieval.
38
+
39
+ ## Output and context discipline
40
+
41
+ - Use `--output json` for agent inspection and transformation.
42
+ - Use `--output jsonl` with `--stream` when incremental DeepNews events are useful.
43
+ - Use human/table output only for a person reading the terminal.
44
+ - Result data is on stdout; diagnostics are on stderr. Do not parse diagnostics as data.
45
+ - Begin with `--limit 5` for article or story discovery unless the user requests broader coverage.
46
+ - Prefer exact UTC timestamps or explicit lookback windows for time-sensitive work.
47
+ - Preserve source names, URLs, publication dates, article/story IDs, and citations needed to audit
48
+ the answer. Do not paste the entire raw response when a concise synthesis is enough.
49
+ - If results are empty or weak, say so; adjust one search dimension at a time rather than silently
50
+ presenting unrelated results.
51
+
52
+ ## Discovery
53
+
54
+ ```bash
55
+ asknews <command> --help
56
+ asknews api list --output json
57
+ asknews api list --tag news --output json
58
+ asknews api list --safety high-cost --output json
59
+ asknews api <group> <operation> --help
60
+ ```
61
+
62
+ Generated flags use kebab-case: OpenAPI `start_timestamp` becomes `--start-timestamp`. Use
63
+ schema-derived flags first and repeat array options when documented. Use `--param name=value` only
64
+ as an escape hatch.
65
+
66
+ Read [references/task-recipes.md](references/task-recipes.md) when the task needs advanced news
67
+ filters, research tuning, source-specific search, generated API operations, or mutations. Do not
68
+ load it for a straightforward search.
69
+
70
+ For exact command arguments and options, read
71
+ [references/commands/index.md](references/commands/index.md), then load only the relevant route
72
+ reference. These files are generated from the same Commander/OpenAPI metadata as `--help`.
73
+
74
+ ## Authentication, cost, and safety
75
+
76
+ - Prefer OAuth for people and `ASKNEWS_API_KEY` for CI/agents. Avoid `--api-key` because command-line
77
+ arguments can appear in process listings and shell history.
78
+ - If credentials are absent, ask the user to run `asknews auth login` or configure
79
+ `ASKNEWS_API_KEY`; never request that they paste a secret into chat.
80
+ - Treat historical search, DeepNews, web search, graph, forecast, and explicitly labeled high-cost
81
+ operations as billable. Keep scope narrow and do not automatically retry chargeable failures.
82
+ - Read-only retrieval may proceed when it directly answers the request. Creating, updating,
83
+ deleting, sending, running, or triggering a resource requires clear user authorization.
84
+ - Before a mutation, inspect operation help, summarize the intended effect, and use `--yes` only
85
+ after authorization. Never infer permission from access to credentials.
86
+
87
+ ## Failure handling
88
+
89
+ - Unknown option or validation error: inspect the exact command's `--help`; do not guess enum values.
90
+ - `401`: authentication is absent or expired; recheck `auth status`.
91
+ - `403`: the account or plan may not permit the operation; do not evade the restriction.
92
+ - `429`: report rate limiting and respect retry guidance; do not loop aggressively.
93
+ - Timeout or transient server error: retry read-only work at most once unless the user asks for
94
+ persistence. Do not automatically retry mutations or expensive research.
@@ -0,0 +1,135 @@
1
+ # alerts
2
+
3
+ Create and manage AskNews alerts
4
+
5
+ ## Commands
6
+
7
+ ### `asknews alerts list`
8
+
9
+ List alerts
10
+
11
+ **Options:**
12
+
13
+ | Option | Description |
14
+ | --- | --- |
15
+ | `--user-id <value>` | The ID of the user to get alerts for [query, string, optional] |
16
+ | `--page <value>` | The page number to get [query, integer, optional, default: 1] |
17
+ | `--per-page <value>` | The number of items per page [query, integer, optional, default: 10] |
18
+ | `--all [boolean]` | Whether to get all the alerts [query, boolean, optional, default: false] |
19
+ | `--include-deleted [boolean]` | Whether to include soft-deleted alerts [query, boolean, optional, default: false] |
20
+
21
+ **Examples:**
22
+
23
+ ```bash
24
+ asknews alerts list --output json
25
+ ```
26
+
27
+ ### `asknews alerts get <alert-id>`
28
+
29
+ Get an alert
30
+
31
+ **Arguments:**
32
+
33
+ | Argument | Description |
34
+ | --- | --- |
35
+ | `<alert-id>` | alert UUID |
36
+
37
+ **Options:**
38
+
39
+ | Option | Description |
40
+ | --- | --- |
41
+ | `--user-id <value>` | The ID of the user to get logs for [query, string, optional] |
42
+
43
+ ### `asknews alerts create`
44
+
45
+ Create an alert
46
+
47
+ **Options:**
48
+
49
+ | Option | Description |
50
+ | --- | --- |
51
+ | `--body <json-or-file>` | complete alert JSON or @file.json |
52
+ | `-y, --yes` | confirm alert create |
53
+ | `--query <value>` | The query to run for retrieving information from sources, and for checking the alert. If you have defined one or more reports, specify each report's individual query in the report prompt. [body, string\|null, optional] |
54
+ | `--sources <value>` | The sources to use for retrieving information related to the alert query. Available sources are: AskNewsSource, TelegramSource, BlueskySource, WebSource, DeepNewsSource [body, array\|null, optional] |
55
+ | `--alert-type <value>` | The type of alert. If specified, overrides `repeat` and `always_trigger`. 'AlwaysAlertWhen': trigger alert actions any time the alert query is satisfied (`repeat=True`, `always_trigger=False`). Add Report model if you want a report when this is triggered. 'AlertOnceIf': trigger alert actions when the alert query is satisfied and then disable the alert (`repeat=False`, `always_trigger=False`). Add Report model if you want a report when this is triggered. 'ReportAbout': always trigger alert actions according to cron schedule and write a report (`repeat=True`, `always_trigger=True`). Defaults to using DeepNews for the report unless specified. [body, string\|null, optional] Choices: AlwaysAlertWhen, AlertOnceIf, ReportAbout. |
56
+ | `--model <value>` | The model that is used to check if the alert conditions are satisfied by sources (this is not the same as the model used to write the report.)Defaults to gpt-4o. [body, string, optional, default: "gpt-4o"] Choices: meta-llama/Meta-Llama-3.1-8B-Instruct, gpt-4o-mini, gpt-5-mini, gpt-5-nano, gpt-4o, o3-mini, meta-llama/Meta-Llama-3.3-70B-Instruct, gpt-4.1-2025-04-14, gpt-4.1-nano-2025-04-14, gpt-4.1-mini-2025-04-14. |
57
+ | `--cron <value>` | How often or when to check sources for this alert, specified as a cron expression. Examples: '0 * * * *' (hourly), '0 9 * * *' (daily at 9am), '0 9 * * 1' (Mondays at 9am). See https://crontab.run/ for more examples. [body, string, required] |
58
+ | `--triggers <value>` | body array<object> value [body, array<object>, required] |
59
+ | `--always-trigger [boolean]` | Whether to always trigger the actions when sources are scanned. This skips the check for if the alert conditions are satisfied and run triggers immediately. Defaults to False. [body, boolean, optional, default: false] |
60
+ | `--repeat [boolean]` | Whether to repeat the alert. Default is True. If False, the alert will be disabled after it triggers once. [body, boolean, optional, default: true] |
61
+ | `--active [boolean]` | Whether the alert is active or not. Default is True. [body, boolean, optional, default: true] |
62
+ | `--expires-at <value>` | The expiration date for the alert. Default is None. If set, the alert will be disabled after this date. [body, string\|null, optional] |
63
+ | `--report <value>` | Configuration for generating a written report when the alert triggers. If report is a list, the individual reports will be concatenated into one report in the order they are defined. If not specified, no report is generated. Use ReportRequest(identifier='deepnews', ...) for DeepNews reports.Use ReportRequest(...) or ReportRequest(identifier='legacy', ...) for legacy reports (DEPRECATED). Requests without identifier default to 'deepnews'. Only DeepNews reports can be used in list. [body, array\|null, optional] |
64
+ | `--title <value>` | The title of the alert. If not provided, no title will be used. [body, string\|null, optional] |
65
+ | `--share-link <value>` | The newsplunker share link to update when the alert triggers. [body, string\|null, optional] |
66
+
67
+ ### `asknews alerts update <alert-id>`
68
+
69
+ Update an alert
70
+
71
+ **Arguments:**
72
+
73
+ | Argument | Description |
74
+ | --- | --- |
75
+ | `<alert-id>` | alert UUID |
76
+
77
+ **Options:**
78
+
79
+ | Option | Description |
80
+ | --- | --- |
81
+ | `--body <json-or-file>` | complete alert JSON or @file.json |
82
+ | `-y, --yes` | confirm alert update |
83
+ | `--query <value>` | The query to run for retrieving information from sources, and for checking the alert. If you have defined one or more reports, specify each report's individual query in the report prompt. [body, string\|null, optional] |
84
+ | `--sources <value>` | The sources to use for retrieving information related to the alert query. Available sources are: AskNewsSource, TelegramSource, BlueskySource, WebSource, DeepNewsSource [body, array\|null, optional] |
85
+ | `--alert-type <value>` | The type of alert. If specified, overrides `repeat` and `always_trigger`. 'AlwaysAlertWhen': trigger alert actions any time the alert query is satisfied (`repeat=True`, `always_trigger=False`). Add Report model if you want a report when this is triggered. 'AlertOnceIf': trigger alert actions when the alert query is satisfied and then disable the alert (`repeat=False`, `always_trigger=False`). Add Report model if you want a report when this is triggered. 'ReportAbout': always trigger alert actions according to cron schedule and write a report (`repeat=True`, `always_trigger=True`). Defaults to using DeepNews for the report unless specified. [body, string\|null, optional] Choices: AlwaysAlertWhen, AlertOnceIf, ReportAbout. |
86
+ | `--model <value>` | The model that is used to check if the alert conditions are satisfied by sources (this is not the same as the model used to write the report.) [body, string\|null, optional] Choices: meta-llama/Meta-Llama-3.1-8B-Instruct, gpt-4o-mini, gpt-5-mini, gpt-5-nano, gpt-4o, o3-mini, meta-llama/Meta-Llama-3.3-70B-Instruct, gpt-4.1-2025-04-14, gpt-4.1-nano-2025-04-14, gpt-4.1-mini-2025-04-14. |
87
+ | `--cron <value>` | How often or when to check sources for this alert, specified as a cron expression. Examples: '0 * * * *' (hourly), '0 9 * * *' (daily at 9am), '0 9 * * 1' (Mondays at 9am). See https://crontab.run/ for more examples. [body, string\|null, optional] |
88
+ | `--triggers <value>` | Configuration for actions to trigger for the alert. Available actions are: WebhookAction, EmailAction, ResendBroadcastAction, GoogleDocsAction [body, array\|null, optional] |
89
+ | `--always-trigger [boolean]` | Whether to always trigger the actions when sources are scanned. This skips the check for if the alert conditions are satisfied and run triggers immediately. Defaults to False. [body, boolean\|null, optional] |
90
+ | `--repeat [boolean]` | Whether to repeat the alert. Default is True. If False, the alert will be disabled after it triggers once. [body, boolean\|null, optional] |
91
+ | `--active [boolean]` | Whether the alert is active or not. Default is True. [body, boolean\|null, optional] |
92
+ | `--expires-at <value>` | The expiration date for the alert. Default is None. If set, the alert will be disabled after this date. [body, string\|null, optional] |
93
+ | `--report <value>` | Configuration for generating a written report when the alert triggers. If report is a list, the individual reports will be concatenated into one report in the order they are defined. If not specified, no report is generated. Use ReportRequest(identifier='deepnews', ...) for DeepNews reports.Use ReportRequest(...) or ReportRequest(identifier='legacy', ...) for legacy reports (DEPRECATED). Requests without identifier default to 'deepnews'. Only DeepNews reports can be used in list. [body, object\|array\|null, optional] |
94
+ | `--title <value>` | The title of the alert. If not provided, no title will be used. [body, string\|null, optional] |
95
+ | `--share-link <value>` | The newsplunker share link to update when the alert triggers. [body, string\|null, optional] |
96
+
97
+ ### `asknews alerts delete <alert-id>`
98
+
99
+ Delete an alert
100
+
101
+ **Arguments:**
102
+
103
+ | Argument | Description |
104
+ | --- | --- |
105
+ | `<alert-id>` | alert UUID |
106
+
107
+ **Options:**
108
+
109
+ | Option | Description |
110
+ | --- | --- |
111
+ | `-y, --yes` | confirm alert deletion |
112
+
113
+ ### `asknews alerts run <alert-id>`
114
+
115
+ Run an existing alert
116
+
117
+ **Arguments:**
118
+
119
+ | Argument | Description |
120
+ | --- | --- |
121
+ | `<alert-id>` | alert UUID |
122
+
123
+ **Options:**
124
+
125
+ | Option | Description |
126
+ | --- | --- |
127
+ | `-y, --yes` | confirm billable alert run |
128
+ | `--user-id <value>` | The ID of the user to get logs for [query, string, optional] |
129
+ | `--is-test [boolean]` | Whether this is a test run [query, boolean, optional, default: false] |
130
+
131
+ ## Global options
132
+
133
+ All commands support `--output human|table|json|jsonl|yaml`, `--json`, API/auth URL
134
+ overrides, request timeout, and color control. Result data is written to stdout; diagnostics
135
+ are written to stderr.
@@ -0,0 +1,186 @@
1
+ # api alerts
2
+
3
+ Generated from AskNews API 0.24.95.
4
+
5
+ ## Operations
6
+
7
+ ### `asknews api alerts create-alert`
8
+
9
+ Create an alert.
10
+
11
+ - Request: `POST /v1/chat/alerts`
12
+ - Operation ID: `create_alert`
13
+ - Safety: `mutating`
14
+
15
+ **Request body fields:**
16
+
17
+ | Option | Type | Required | Description |
18
+ | --- | --- | --- | --- |
19
+ | `--query` | string or null | no | The query to run for retrieving information from sources, and for checking the alert. If you have defined one or more reports, specify each report's individual query in the report prompt. |
20
+ | `--sources` | array or null | no | The sources to use for retrieving information related to the alert query. Available sources are: AskNewsSource, TelegramSource, BlueskySource, WebSource, DeepNewsSource |
21
+ | `--alert-type` | string or null | no | The type of alert. If specified, overrides `repeat` and `always_trigger`. 'AlwaysAlertWhen': trigger alert actions any time the alert query is satisfied (`repeat=True`, `always_trigger=False`). Add Report model if you want a report when this is triggered. 'AlertOnceIf': trigger alert actions when the alert query is satisfied and then disable the alert (`repeat=False`, `always_trigger=False`). Add Report model if you want a report when this is triggered. 'ReportAbout': always trigger alert actions according to cron schedule and write a report (`repeat=True`, `always_trigger=True`). Defaults to using DeepNews for the report unless specified. |
22
+ | `--model` | string | no | The model that is used to check if the alert conditions are satisfied by sources (this is not the same as the model used to write the report.)Defaults to gpt-4o. Choices: meta-llama/Meta-Llama-3.1-8B-Instruct, gpt-4o-mini, gpt-5-mini, gpt-5-nano, gpt-4o, o3-mini, meta-llama/Meta-Llama-3.3-70B-Instruct, gpt-4.1-2025-04-14, gpt-4.1-nano-2025-04-14, gpt-4.1-mini-2025-04-14. Default: `"gpt-4o"`. |
23
+ | `--cron` | string | yes | How often or when to check sources for this alert, specified as a cron expression. Examples: '0 * * * *' (hourly), '0 9 * * *' (daily at 9am), '0 9 * * 1' (Mondays at 9am). See https://crontab.run/ for more examples. |
24
+ | `--triggers` | array<object> | yes | |
25
+ | `--always-trigger` | boolean | no | Whether to always trigger the actions when sources are scanned. This skips the check for if the alert conditions are satisfied and run triggers immediately. Defaults to False. Default: `false`. |
26
+ | `--repeat` | boolean | no | Whether to repeat the alert. Default is True. If False, the alert will be disabled after it triggers once. Default: `true`. |
27
+ | `--active` | boolean | no | Whether the alert is active or not. Default is True. Default: `true`. |
28
+ | `--expires-at` | string or null | no | The expiration date for the alert. Default is None. If set, the alert will be disabled after this date. |
29
+ | `--report` | array or null | no | Configuration for generating a written report when the alert triggers. If report is a list, the individual reports will be concatenated into one report in the order they are defined. If not specified, no report is generated. Use ReportRequest(identifier='deepnews', ...) for DeepNews reports.Use ReportRequest(...) or ReportRequest(identifier='legacy', ...) for legacy reports (DEPRECATED). Requests without identifier default to 'deepnews'. Only DeepNews reports can be used in list. |
30
+ | `--title` | string or null | no | The title of the alert. If not provided, no title will be used. |
31
+ | `--share-link` | string or null | no | The newsplunker share link to update when the alert triggers. |
32
+
33
+ Use direct kebab-case body options, `--body '{...}'`, or `--body @request.json`.
34
+ Direct body options override values supplied through `--body`.
35
+
36
+ This operation requires confirmation and `--yes` in non-interactive use.
37
+
38
+ ### `asknews api alerts delete-alert`
39
+
40
+ Delete an alert.
41
+
42
+ - Request: `DELETE /v1/chat/alerts/{alert_id}`
43
+ - Operation ID: `delete_alert`
44
+ - Safety: `mutating`
45
+
46
+ **Options:**
47
+
48
+ | Option | Description |
49
+ | --- | --- |
50
+ | `--alert-id` | The alert ID Location: path. Type: string. Required. Format: uuid. |
51
+
52
+ This operation requires confirmation and `--yes` in non-interactive use.
53
+
54
+ ### `asknews api alerts get-alert`
55
+
56
+ Get an alert.
57
+
58
+ - Request: `GET /v1/chat/alerts/{alert_id}`
59
+ - Operation ID: `get_alert`
60
+ - Safety: `read-only`
61
+
62
+ **Options:**
63
+
64
+ | Option | Description |
65
+ | --- | --- |
66
+ | `--alert-id` | The alert ID Location: path. Type: string. Required. Format: uuid. |
67
+ | `--user-id` | The ID of the user to get logs for Location: query. Type: string. Optional. |
68
+
69
+ ### `asknews api alerts get-alert-logs`
70
+
71
+ Get alert logs.
72
+
73
+ - Request: `GET /v1/chat/alerts/{alert_id}/logs`
74
+ - Operation ID: `get_alert_logs`
75
+ - Safety: `read-only`
76
+
77
+ **Options:**
78
+
79
+ | Option | Description |
80
+ | --- | --- |
81
+ | `--alert-id` | The alert ID Location: path. Type: string. Required. Format: uuid. |
82
+ | `--user-id` | The ID of the user to get logs for Location: query. Type: string. Optional. |
83
+ | `--page` | The page number to get Location: query. Type: integer. Optional. Default: `1`. |
84
+ | `--per-page` | The number of items per page Location: query. Type: integer. Optional. Default: `10`. |
85
+ | `--all` | Whether to get all the alert logs Location: query. Type: boolean. Optional. Default: `false`. |
86
+ | `--start-timestamp` | Timestamp to start search from Location: query. Type: string. Optional. |
87
+ | `--end-timestamp` | Timestamp to end search at Location: query. Type: string. Optional. |
88
+
89
+ ### `asknews api alerts get-alerts`
90
+
91
+ Get all created alerts.
92
+
93
+ - Request: `GET /v1/chat/alerts`
94
+ - Operation ID: `get_alerts`
95
+ - Safety: `read-only`
96
+
97
+ **Options:**
98
+
99
+ | Option | Description |
100
+ | --- | --- |
101
+ | `--user-id` | The ID of the user to get alerts for Location: query. Type: string. Optional. |
102
+ | `--page` | The page number to get Location: query. Type: integer. Optional. Default: `1`. |
103
+ | `--per-page` | The number of items per page Location: query. Type: integer. Optional. Default: `10`. |
104
+ | `--all` | Whether to get all the alerts Location: query. Type: boolean. Optional. Default: `false`. |
105
+ | `--include-deleted` | Whether to include soft-deleted alerts Location: query. Type: boolean. Optional. Default: `false`. |
106
+
107
+ ### `asknews api alerts get-all-alert-logs`
108
+
109
+ Get all alert logs.
110
+
111
+ - Request: `GET /v1/chat/alerts/logs`
112
+ - Operation ID: `get_all_alert_logs`
113
+ - Safety: `read-only`
114
+
115
+ **Options:**
116
+
117
+ | Option | Description |
118
+ | --- | --- |
119
+ | `--alert-id` | The alert ID Location: query. Type: string. Optional. |
120
+ | `--user-id` | The ID of the user to get logs for Location: query. Type: string. Optional. |
121
+ | `--page` | The page number to get Location: query. Type: integer. Optional. Default: `1`. |
122
+ | `--per-page` | The number of items per page Location: query. Type: integer. Optional. Default: `10`. |
123
+ | `--all` | Whether to get all the alert logs Location: query. Type: boolean. Optional. Default: `false`. |
124
+ | `--start-timestamp` | Timestamp to start search from Location: query. Type: string. Optional. |
125
+ | `--end-timestamp` | Timestamp to end search at Location: query. Type: string. Optional. |
126
+
127
+ ### `asknews api alerts put-alert`
128
+
129
+ Update an alert.
130
+
131
+ - Request: `PUT /v1/chat/alerts/{alert_id}`
132
+ - Operation ID: `put_alert`
133
+ - Safety: `mutating`
134
+
135
+ **Options:**
136
+
137
+ | Option | Description |
138
+ | --- | --- |
139
+ | `--alert-id` | The alert ID Location: path. Type: string. Required. Format: uuid. |
140
+
141
+ **Request body fields:**
142
+
143
+ | Option | Type | Required | Description |
144
+ | --- | --- | --- | --- |
145
+ | `--query` | string or null | no | The query to run for retrieving information from sources, and for checking the alert. If you have defined one or more reports, specify each report's individual query in the report prompt. |
146
+ | `--sources` | array or null | no | The sources to use for retrieving information related to the alert query. Available sources are: AskNewsSource, TelegramSource, BlueskySource, WebSource, DeepNewsSource |
147
+ | `--alert-type` | string or null | no | The type of alert. If specified, overrides `repeat` and `always_trigger`. 'AlwaysAlertWhen': trigger alert actions any time the alert query is satisfied (`repeat=True`, `always_trigger=False`). Add Report model if you want a report when this is triggered. 'AlertOnceIf': trigger alert actions when the alert query is satisfied and then disable the alert (`repeat=False`, `always_trigger=False`). Add Report model if you want a report when this is triggered. 'ReportAbout': always trigger alert actions according to cron schedule and write a report (`repeat=True`, `always_trigger=True`). Defaults to using DeepNews for the report unless specified. |
148
+ | `--model` | string or null | no | The model that is used to check if the alert conditions are satisfied by sources (this is not the same as the model used to write the report.) |
149
+ | `--cron` | string or null | no | How often or when to check sources for this alert, specified as a cron expression. Examples: '0 * * * *' (hourly), '0 9 * * *' (daily at 9am), '0 9 * * 1' (Mondays at 9am). See https://crontab.run/ for more examples. |
150
+ | `--triggers` | array or null | no | Configuration for actions to trigger for the alert. Available actions are: WebhookAction, EmailAction, ResendBroadcastAction, GoogleDocsAction |
151
+ | `--always-trigger` | boolean or null | no | Whether to always trigger the actions when sources are scanned. This skips the check for if the alert conditions are satisfied and run triggers immediately. Defaults to False. |
152
+ | `--repeat` | boolean or null | no | Whether to repeat the alert. Default is True. If False, the alert will be disabled after it triggers once. |
153
+ | `--active` | boolean or null | no | Whether the alert is active or not. Default is True. |
154
+ | `--expires-at` | string or null | no | The expiration date for the alert. Default is None. If set, the alert will be disabled after this date. |
155
+ | `--report` | object or array or null | no | Configuration for generating a written report when the alert triggers. If report is a list, the individual reports will be concatenated into one report in the order they are defined. If not specified, no report is generated. Use ReportRequest(identifier='deepnews', ...) for DeepNews reports.Use ReportRequest(...) or ReportRequest(identifier='legacy', ...) for legacy reports (DEPRECATED). Requests without identifier default to 'deepnews'. Only DeepNews reports can be used in list. |
156
+ | `--title` | string or null | no | The title of the alert. If not provided, no title will be used. |
157
+ | `--share-link` | string or null | no | The newsplunker share link to update when the alert triggers. |
158
+
159
+ Use direct kebab-case body options, `--body '{...}'`, or `--body @request.json`.
160
+ Direct body options override values supplied through `--body`.
161
+
162
+ This operation requires confirmation and `--yes` in non-interactive use.
163
+
164
+ ### `asknews api alerts run-alert`
165
+
166
+ Get an alert.
167
+
168
+ - Request: `GET /v1/chat/alerts/{alert_id}/run`
169
+ - Operation ID: `run_alert`
170
+ - Safety: `mutating`
171
+
172
+ **Options:**
173
+
174
+ | Option | Description |
175
+ | --- | --- |
176
+ | `--alert-id` | The alert ID Location: path. Type: string. Required. Format: uuid. |
177
+ | `--user-id` | The ID of the user to get logs for Location: query. Type: string. Optional. |
178
+ | `--is-test` | Whether this is a test run Location: query. Type: boolean. Optional. Default: `false`. |
179
+
180
+ This operation requires confirmation and `--yes` in non-interactive use.
181
+
182
+ ## Global options
183
+
184
+ All commands support `--output human|table|json|jsonl|yaml`, `--json`, API/auth URL
185
+ overrides, request timeout, and color control. Result data is written to stdout; diagnostics
186
+ are written to stderr.
@@ -0,0 +1,31 @@
1
+ # api analytics
2
+
3
+ Generated from AskNews API 0.24.95.
4
+
5
+ ## Operations
6
+
7
+ ### `asknews api analytics get-asset-sentiment`
8
+
9
+ Get the news sentiment for a given asset during a provided period of time.
10
+
11
+ This endpoint is good for narrow AI, like using in combination with a regressor
12
+ to forecast prices etc.
13
+
14
+ - Request: `GET /v1/analytics/finance/sentiment`
15
+ - Operation ID: `get_asset_sentiment`
16
+ - Safety: `read-only`
17
+
18
+ **Options:**
19
+
20
+ | Option | Description |
21
+ | --- | --- |
22
+ | `--asset` | The asset name to query for sentiment. Location: query. Type: string. Required. Choices: bitcoin, ethereum, cardano, uniswap, ripple, solana, polkadot, polygon, chainlink, tether, dogecoin, monero, tron, binance, aave, tesla, microsoft, amazon. |
23
+ | `--metric` | The metric to obtain. Weighted metrics account for page-rank of original source. Higher page rank sources are weighted more heavily. Location: query. Type: string. Optional. Choices: news_positive, news_negative, news_total, news_positive_weighted, news_negative_weighted, news_total_weighted. Default: `"news_positive"`. |
24
+ | `--date-from` | The start date in ISO format Location: query. Type: string. Optional. |
25
+ | `--date-to` | The end date in ISO format Location: query. Type: string. Optional. |
26
+
27
+ ## Global options
28
+
29
+ All commands support `--output human|table|json|jsonl|yaml`, `--json`, API/auth URL
30
+ overrides, request timeout, and color control. Result data is written to stdout; diagnostics
31
+ are written to stderr.
@@ -0,0 +1,31 @@
1
+ # api autofilter
2
+
3
+ Generated from AskNews API 0.24.95.
4
+
5
+ ## Operations
6
+
7
+ ### `asknews api autofilter autofilter`
8
+
9
+ This is a helper endpoint designed to intelligently populate the
10
+ "parameters of the /news search endpoint of AskNews. It takes a description
11
+ of the type of news that you want to access, and then maps it to the available
12
+ parameters automatically.
13
+
14
+ This endpoint returns the parameters, called filter_params, which can be used
15
+ in a variety of other AskNews endpoints, for example, /news, /graph, /chat.
16
+
17
+ - Request: `GET /v1/chat/autofilter`
18
+ - Operation ID: `autofilter`
19
+ - Safety: `read-only`
20
+
21
+ **Options:**
22
+
23
+ | Option | Description |
24
+ | --- | --- |
25
+ | `--query` | A description of what kind of news you want to get. Location: query. Type: string. Required. |
26
+
27
+ ## Global options
28
+
29
+ All commands support `--output human|table|json|jsonl|yaml`, `--json`, API/auth URL
30
+ overrides, request timeout, and color control. Result data is written to stdout; diagnostics
31
+ are written to stderr.
@@ -0,0 +1,72 @@
1
+ # api byok
2
+
3
+ Generated from AskNews API 0.24.95.
4
+
5
+ ## Operations
6
+
7
+ ### `asknews api byok delete-byok-key`
8
+
9
+ Delete a stored BYOK API key for a provider.
10
+ Bring your own key is reserved for enterprise clients.
11
+ If you want to use this feature, please contact us at contact@asknews.app
12
+
13
+ - Request: `DELETE /v1/byok/{provider}`
14
+ - Operation ID: `delete_byok_key`
15
+ - Safety: `mutating`
16
+
17
+ **Options:**
18
+
19
+ | Option | Description |
20
+ | --- | --- |
21
+ | `--provider` | The BYOK provider Location: path. Type: string. Required. Choices: anthropic, google. |
22
+
23
+ This operation requires confirmation and `--yes` in non-interactive use.
24
+
25
+ ### `asknews api byok get-byok-key`
26
+
27
+ Get the stored BYOK API key hint for a provider.
28
+ Bring your own key is reserved for enterprise clients.
29
+ If you want to use this feature, please contact us at contact@asknews.app
30
+
31
+ - Request: `GET /v1/byok/{provider}`
32
+ - Operation ID: `get_byok_key`
33
+ - Safety: `read-only`
34
+
35
+ **Options:**
36
+
37
+ | Option | Description |
38
+ | --- | --- |
39
+ | `--provider` | The BYOK provider Location: path. Type: string. Required. Choices: anthropic, google. |
40
+
41
+ ### `asknews api byok upsert-byok-key`
42
+
43
+ Store a BYOK API key for a provider.
44
+ Bring your own key is reserved for enterprise clients.
45
+ If you want to use this feature, please contact us at contact@asknews.app
46
+
47
+ - Request: `PUT /v1/byok/{provider}`
48
+ - Operation ID: `upsert_byok_key`
49
+ - Safety: `mutating`
50
+
51
+ **Options:**
52
+
53
+ | Option | Description |
54
+ | --- | --- |
55
+ | `--provider` | The BYOK provider Location: path. Type: string. Required. Choices: anthropic, google. |
56
+
57
+ **Request body fields:**
58
+
59
+ | Option | Type | Required | Description |
60
+ | --- | --- | --- | --- |
61
+ | `--api-key` | string | yes | |
62
+
63
+ Use direct kebab-case body options, `--body '{...}'`, or `--body @request.json`.
64
+ Direct body options override values supplied through `--body`.
65
+
66
+ This operation requires confirmation and `--yes` in non-interactive use.
67
+
68
+ ## Global options
69
+
70
+ All commands support `--output human|table|json|jsonl|yaml`, `--json`, API/auth URL
71
+ overrides, request timeout, and color control. Result data is written to stdout; diagnostics
72
+ are written to stderr.