@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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Emergent Methods
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 ADDED
@@ -0,0 +1,121 @@
1
+ # AskNews CLI
2
+
3
+ The official AskNews command-line interface for humans, scripts, CI, and AI agents.
4
+
5
+ ## Install
6
+
7
+ Requires Node.js 22.15 or newer.
8
+
9
+ Run without installing:
10
+
11
+ ```bash
12
+ npx @emergentmethods/asknews-cli --help
13
+ ```
14
+
15
+ Install globally with npm:
16
+
17
+ ```bash
18
+ npm install -g @emergentmethods/asknews-cli
19
+ asknews --help
20
+ ```
21
+
22
+ Or use the install script (installs under `~/.local` by default):
23
+
24
+ ```bash
25
+ curl -fsSL https://docs.asknews.app/cli/install | bash
26
+ asknews --help
27
+ ```
28
+
29
+ Run the install script with `--help` for version, prefix, checksum, PATH, local-tarball, and
30
+ agent-skill options.
31
+
32
+ From a source checkout:
33
+
34
+ ```bash
35
+ pnpm install
36
+ pnpm build
37
+ pnpm package:tarball
38
+ ./install --tarball release/*.tgz
39
+ ```
40
+
41
+ ## Quick start
42
+
43
+ ```bash
44
+ asknews auth login
45
+ asknews news search "latest semiconductor policy" --limit 5
46
+ asknews news search "latest semiconductor policy" --limit 5 --output json
47
+ ```
48
+
49
+ For CI and agents:
50
+
51
+ ```bash
52
+ export ASKNEWS_API_KEY="your-api-key"
53
+ asknews auth status --output json
54
+ ```
55
+
56
+ API keys can also be stored locally with `asknews auth login --api-key`. Authentication precedence
57
+ is `--api-key`, `ASKNEWS_API_KEY`, stored OAuth, then stored API key.
58
+
59
+ ## Command discovery
60
+
61
+ `--help` is the canonical human interface at every command level:
62
+
63
+ ```bash
64
+ asknews --help
65
+ asknews news --help
66
+ asknews api news search-news --help
67
+ ```
68
+
69
+ For programmatic discovery:
70
+
71
+ ```bash
72
+ asknews api list --output json
73
+ ```
74
+
75
+ The CLI provides curated news, stories, DeepNews, alerts, web, Reddit, and Wikipedia workflows.
76
+ Every customer-facing public OpenAPI operation is also available under
77
+ `asknews api <group> <operation>`. A generic authenticated escape hatch is available as
78
+ `asknews request METHOD PATH`.
79
+
80
+ ## Output and safety
81
+
82
+ Use `--output human|table|json|jsonl|yaml` or `--json`. Human mode renders compact domain-specific
83
+ tables for articles, stories, models, and alerts; `table` forces tabular list output. Result data is
84
+ written to stdout and diagnostics to stderr. Noninteractive state-changing operations require
85
+ `--yes`. High-cost operations are labeled in help and the machine-readable operation catalog.
86
+
87
+ Every OpenAPI parameter and request-body field is represented by a kebab-case option with its type,
88
+ required state, default, enum values, format, and numeric range in `--help`.
89
+
90
+ ```bash
91
+ asknews research --help
92
+ asknews research models
93
+ asknews research "Compare current AI regulations" \
94
+ --model claude-sonnet-4-6 \
95
+ --sources asknews \
96
+ --sources reddit \
97
+ --stream
98
+ ```
99
+
100
+ ## Agent skill
101
+
102
+ Package installation embeds the AskNews skill under the standard global agent directory. Opt out
103
+ with `ASKNEWS_NO_AGENT_SKILLS=1`, or install/refresh explicitly:
104
+
105
+ ```bash
106
+ asknews cli setup --scope global
107
+ asknews cli setup --scope project --directory .
108
+ ```
109
+
110
+ ## Development
111
+
112
+ ```bash
113
+ pnpm sync:openapi
114
+ pnpm check
115
+ pnpm build
116
+ pnpm test:live
117
+ ```
118
+
119
+ The production API defaults to `https://api.asknews.app/v1`. Override it with `ASKNEWS_API_URL` or
120
+ `--api-url`. See [docs/README.md](docs/README.md) for architecture, generated coverage, ADRs,
121
+ testing safeguards, and the release process.