astreus-cli 0.4.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/CHANGELOG.md ADDED
@@ -0,0 +1,88 @@
1
+ # Changelog
2
+
3
+ ## 0.4.0 — unreleased
4
+
5
+ - Renamed: the package is now `astreus-cli` (`npm install -g astreus-cli`) and the
6
+ command is `astreus`. It replaces `prometheus-terminal` and its `prom`
7
+ command; every subcommand and flag is unchanged.
8
+ - `ASTREUS_API_KEY`, `ASTREUS_BASE_URL` and `ASTREUS_CONFIG_DIR` replace the
9
+ `PROMETHEUS_*` variables, which are still read when the new ones are unset.
10
+ - The config file moves to `~/.config/astreus/config.json`; a key saved by
11
+ `prometheus-terminal` in `~/.config/prometheus` keeps working until the next
12
+ `astreus login` or `astreus logout` writes the new file.
13
+ - Default API origin is `https://astreus.ai`.
14
+ - New: `astreus transcript-search <words>` (full-text search over every
15
+ transcript; `--summary` for counts by quarter and company) and
16
+ `astreus mentioned-by <id>` (where other companies name this one).
17
+ - New: `astreus government <iso> [view]`, `astreus executive-orders <iso>`,
18
+ `astreus officials <iso>` (`--changes`, `--schedule`), `astreus awards <id>`
19
+ (federal awards) and `astreus regulation <id>`.
20
+ - `astreus commodities --fundamentals` (EIA-style supply series),
21
+ `astreus narratives --facets`, and `astreus debt --instrument <uuid>` now
22
+ works without a company id.
23
+
24
+ ## 0.3.0 — unreleased
25
+
26
+ (0.2.0 was never published; its changes ship here.)
27
+
28
+ - `prom coverage`: what Prometheus holds, market by market — companies, history
29
+ start, completeness and the share of reporting periods held per data type —
30
+ from the public `GET /api/v1/landing/coverage`. No key needed.
31
+ - `prom as-filed`: the statement exactly as the company filed it — every
32
+ caption it ever printed, one column per period, across the whole history
33
+ (`-s is|ci|bs|bsp|cf|eq|all`, `-q` / `--semiannual`, `--ytd` for the
34
+ cumulative year-to-date column as printed, `--vintage original|latest`,
35
+ `--documents` for the filings the grid was read from). Distinct from
36
+ `prom financials --as-reported`, which is one filing's XBRL tree.
37
+ - `prom note-tables`, `prom note-table`, `prom note-series`: the tables inside
38
+ the notes to the financial statements — a company's families and one
39
+ family's gated tables (`--held` shows what a quality gate held, and why),
40
+ one table cell by cell with its gate verdicts and the filing behind it, and
41
+ one family as a time series across filings with every point cited (`*` read
42
+ from a later filing's comparative column, `~` restated by a later filing).
43
+ - Fixed: `-q` reaches the command it belongs to. The global quiet flag was
44
+ `-q, --quiet`, and commander resolved it before the subcommand saw it, so
45
+ `prom financials NVDA -q` silently returned annual periods and
46
+ `prom news -q …` dropped the search. Quiet is `--quiet` only; `-q` is
47
+ `--quarterly` on `financials`, `fact-source`, `as-filed` and `note-series`,
48
+ and `--search` on `news`.
49
+ - `prom fact-source --basis` names its values as the API does: `individual`
50
+ (default, the discrete period) and `as_reported` (the cumulative
51
+ year-to-date column) — a period basis, not a vintage. `restated` is still
52
+ accepted as an alias of the default.
53
+ - All 95 public operations are accounted for: 89 reachable from a command, six
54
+ UI-only helpers (sparklines, tab presence, transcript audio, the intelligence
55
+ presence dot, the browser news stream) intentionally without one.
56
+ - `prom mcp`: serve the Prometheus MCP tool set over stdio — the same 18
57
+ read-only tools as the hosted https://www.prometheus.services/api/mcp
58
+ endpoint (shared definition module), authenticated with the CLI's usual key
59
+ resolution. Connect: `claude mcp add prometheus --env
60
+ PROMETHEUS_API_KEY=pk_live_... -- prom mcp`. New tools since 0.1.0:
61
+ `get_news` (the attributed intraday news tape) and `get_coverage` (the live
62
+ coverage inventory — agents answer "do you cover X?" from it, not memory).
63
+ - `prom news`: the intraday news tape — market-wide with ticker, topic, source
64
+ and importance filters, one company's tape (`-c`), full-text search, `--top`
65
+ storylines, and `--follow` polling.
66
+ - `prom monthly-revenue`: monthly revenue filings for Taiwan-listed companies.
67
+ - Identifiers: platform keys for non-SEC issuers (`XSAU000001`, `XDFM000002`,
68
+ …) are accepted wherever a ticker or CIK is; a bare ticker resolves to the
69
+ SEC registrant.
70
+ - The MCP SDK, zod and the shared tool package are inlined at build time — no
71
+ new runtime dependencies in the published package.
72
+
73
+ ## 0.1.0 — 2026-08-24
74
+
75
+ First release.
76
+
77
+ - Every public API operation reachable from a command (77 operations; the two
78
+ sparkline helpers are UI-only and intentionally omitted).
79
+ - `login` / `logout` / `auth status` / `me` with a hidden prompt, stdin mode for CI,
80
+ validation against `GET /api/v1/me` before saving, 0600 config file.
81
+ - Citation footer on every financial figure; `fact-source` prints the filing, XBRL
82
+ facts and revisions behind a cell.
83
+ - Transcript date and 8-K item auto-resolution.
84
+ - `--json` verbatim payloads, stdout/stderr discipline, stable exit codes 0–7,
85
+ single retry on short `Retry-After`, low-quota warning.
86
+ - Descriptor mini-DSL for `correlate` and `chart`.
87
+ - Build-time spec-hash guard; `prom --version` prints the contract hash.
88
+ - Shell completion for bash, zsh and fish.
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # astreus
2
+
3
+ `astreus` — [Astreus](https://astreus.ai) from the terminal. Astreus is
4
+ the financial data terminal that turns the world's financial disclosure — filings, results
5
+ announcements, investor decks, earnings calls, 8-Ks and central-bank text across the US,
6
+ the Gulf, Japan, Taiwan, Korea and Europe — into structured, traceable data: standardized
7
+ statements, segments and KPIs, note tables, transcripts, guidance scorecards, events, news,
8
+ ownership, macro, markets and the causal claim graph, with the source filing printed under
9
+ every number.
10
+
11
+ ```bash
12
+ npm install -g astreus-cli
13
+ astreus coverage # what is covered, market by market — no key needed
14
+ astreus login # hidden prompt; key validated before it is saved
15
+ astreus financials NVDA # standardized income statement, cited
16
+ astreus fact-source NVDA std:revenue 2025-01-26
17
+ astreus transcript NVDA | less # latest earnings call
18
+ astreus --json company NVDA | jq # the raw API payload, verbatim
19
+ ```
20
+
21
+ Node 18+. Two runtime dependencies (`commander`, `picocolors`), no native modules.
22
+
23
+ ## What it does well
24
+
25
+ - **Citations by default.** Any command that prints a financial figure ends with a
26
+ `source:` line — accession, period, basis — and `astreus fact-source` is one keystroke
27
+ away for any cell.
28
+ - **Fills in what the raw API makes you look up.** `astreus transcript NVDA` resolves the
29
+ transcript id and its required date from the index; `astreus event NVDA <accession>`
30
+ resolves the 8-K item code.
31
+ - **Built for scripts and agents.** `--json` is exactly one JSON document on stdout;
32
+ stderr carries everything else; exit codes are stable (`astreus help exit-codes`); text
33
+ endpoints stream so they pipe.
34
+ - **Never drifts from the API.** The build embeds the SHA-256 of the OpenAPI contract and
35
+ fails if the spec changed; `astreus --version` prints the hash.
36
+ - **Nulls are never zeros.** `—` means "not reported for that period".
37
+
38
+ ## Commands
39
+
40
+ `astreus --help` lists them all. Groups:
41
+
42
+ | Group | Commands |
43
+ | --- | --- |
44
+ | Auth & meta | `login`, `logout`, `auth status`, `me`, `health`, `stats`, `coverage`, `docs`, `llms`, `completion` |
45
+ | Companies | `search`, `company`, `companies`, `prices`, `segments`, `regions`, `dividends`, `calendar`, `capital-structure`, `management`, `compute`, `logo` |
46
+ | Financials | `financials`, `as-filed`, `fact-source`, `monthly-revenue` |
47
+ | Filings & 8-K | `filings`, `filing`, `sections`, `section`, `note-tables`, `note-table`, `note-series`, `events`, `event`, `wire`, `observations` |
48
+ | Calls & guidance | `transcripts`, `transcript`, `guidance`, `earnings`, `presentations`, `deck-page` |
49
+ | Ownership & people | `ownership`, `people`, `person` |
50
+ | Macro | `countries`, `macro`, `policy` |
51
+ | Markets | `indices`, `commodities` |
52
+ | Intelligence | `narratives`, `pulse`, `intel`, `graph`, `edge`, `simulate` |
53
+ | Analytics | `catalog`, `correlate`, `chart` |
54
+ | Scorecards | `scorecards events\|event\|executives`, `scorecard`, `signals` |
55
+ | Transcript search | `transcript-search` (full text over every call, `--summary`), `mentioned-by` (where other companies name this one) |
56
+ | Government | `government`, `executive-orders`, `officials` (`--changes`, `--schedule`), `awards`, `regulation` |
57
+ | News | `news` — the attributed intraday tape, one company's tape (`-c`), search, `--top`, `--follow` |
58
+ | MCP | `mcp` — serve the 18 Astreus MCP tools over stdio (`claude mcp add astreus --env ASTREUS_API_KEY=pk_live_... -- astreus mcp`) |
59
+
60
+ ## Configuration
61
+
62
+ Key: `--api-key` → `ASTREUS_API_KEY` → `~/.config/astreus/config.json` (0600).
63
+ Origin: `--base-url` → `ASTREUS_BASE_URL` → config file → `https://astreus.ai`.
64
+ `NO_COLOR` is honoured; `ASTREUS_CONFIG_DIR` relocates the config file.
65
+
66
+ ## Exit codes
67
+
68
+ `0` ok · `1` unexpected · `2` usage · `3` auth (401) · `4` payment (402) · `5` not found (404)
69
+ · `6` rate limited / quota (429) · `7` server (5xx).
70
+
71
+ ## Development
72
+
73
+ ```bash
74
+ npm run build # gen types from ../web/public/openapi.json → tsup → spec-hash guard
75
+ npm test # node:test — transport, config, formatting, descriptor DSL, and every
76
+ # command replayed against the OpenAPI examples
77
+ ASTREUS_API_KEY=… ASTREUS_BASE_URL=http://localhost:3000 npm run test:e2e
78
+ ```
79
+
80
+ Docs: <https://doc.astreus.ai/cli>. Licence: MIT.