mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-11-07 09:45:36 +00:00
feat(cli): agent-native output, stdin symbols, and exit-code classes
Phase 1 of docs/DESIGN.md: - Output format resolves -o > IDX_OUTPUT > general.output > auto; auto is a table on a terminal and JSON when stdout is piped or captured. `config init` now writes output = "auto". - JSON is pretty only on a terminal and compact otherwise. New `-o jsonl` prints one array item per line with the same key order. - No ANSI color when stdout is not a terminal (direct owo-colors calls now go through output::style). - `stocks quote -` and `stocks compare -` read symbols from stdin. - Exit codes by class: 2 invalid input/config, 3 not found or cache miss, 4 upstream unavailable, 5 unsupported, 1 other. Golden changes are limited to those documented kinds and were verified mechanically: JSON goldens are semantically identical, tables differ only by removed ANSI codes and the column padding comfy-table had reserved for them (cell contents identical), exit codes match each error's class, and help/completions only gain the new --output values. 17 new golden cases cover auto, jsonl, stdin, and the new errors. tests/cli.rs now pins IDX_OUTPUT=table in its harness (its tests assert table text and run piped) and parses discover JSON instead of matching pretty-printed whitespace. Live A/B against main: 16/16 stocks cases identical; ownership discover got IDX 403 on both binaries, now exiting 4 instead of 1 as intended. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
fe627496dd
commit
22b6dabaeb
119 changed files with 920 additions and 1896 deletions
|
|
@ -1,49 +1,49 @@
|
|||
exit: 0
|
||||
--- stdout
|
||||
[1mFundamental Analysis for BBCA.JK[0m
|
||||
Fundamental Analysis for BBCA.JK
|
||||
|
||||
[1mGrowth Analysis for BBCA.JK[0m
|
||||
┌─────────────────┬─────────┬────────────────────┐
|
||||
│ METRIC ┆ VALUE ┆ SIGNAL │
|
||||
╞═════════════════╪═════════╪════════════════════╡
|
||||
│ Revenue Growth ┆ +8.10% ┆ [33mslow[39m │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ Earnings Growth ┆ +12.10% ┆ [32mmoderate[39m │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ Overall ┆ - ┆ [33mmixed[39m │
|
||||
└─────────────────┴─────────┴────────────────────┘
|
||||
Growth Analysis for BBCA.JK
|
||||
┌─────────────────┬─────────┬──────────┐
|
||||
│ METRIC ┆ VALUE ┆ SIGNAL │
|
||||
╞═════════════════╪═════════╪══════════╡
|
||||
│ Revenue Growth ┆ +8.10% ┆ slow │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ Earnings Growth ┆ +12.10% ┆ moderate │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ Overall ┆ - ┆ mixed │
|
||||
└─────────────────┴─────────┴──────────┘
|
||||
|
||||
[1mValuation Analysis for BBCA.JK[0m
|
||||
┌────────────────┬─────────┬─────────────────────┐
|
||||
│ METRIC ┆ VALUE ┆ SIGNAL │
|
||||
╞════════════════╪═════════╪═════════════════════╡
|
||||
│ P/E (Trailing) ┆ 25.40 ┆ [33mpremium[39m │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ P/E (Forward) ┆ - ┆ - │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ Price/Book ┆ 4.60 ┆ [31mexpensive[39m │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ ROE ┆ +19.80% ┆ [32mstrong[39m │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ Net Margin ┆ +32.40% ┆ [32mexcellent[39m │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ EV/EBITDA ┆ - ┆ [33mno data[39m │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ Overall ┆ - ┆ [31mexpensive[39m │
|
||||
└────────────────┴─────────┴─────────────────────┘
|
||||
Valuation Analysis for BBCA.JK
|
||||
┌────────────────┬─────────┬───────────┐
|
||||
│ METRIC ┆ VALUE ┆ SIGNAL │
|
||||
╞════════════════╪═════════╪═══════════╡
|
||||
│ P/E (Trailing) ┆ 25.40 ┆ premium │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ P/E (Forward) ┆ - ┆ - │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ Price/Book ┆ 4.60 ┆ expensive │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ ROE ┆ +19.80% ┆ strong │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ Net Margin ┆ +32.40% ┆ excellent │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ EV/EBITDA ┆ - ┆ no data │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ Overall ┆ - ┆ expensive │
|
||||
└────────────────┴─────────┴───────────┘
|
||||
|
||||
[1mRisk Analysis for BBCA.JK[0m
|
||||
┌───────────────┬────────┬─────────────────────────┐
|
||||
│ METRIC ┆ VALUE ┆ SIGNAL │
|
||||
╞═══════════════╪════════╪═════════════════════════╡
|
||||
│ Debt/Equity ┆ 0.42 ┆ [32mconservative[39m │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ Current Ratio ┆ 1.18 ┆ [33mtight[39m │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ ROA ┆ +3.10% ┆ - │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ Overall ┆ - ┆ [33mmoderate risk[39m │
|
||||
└───────────────┴────────┴─────────────────────────┘
|
||||
Risk Analysis for BBCA.JK
|
||||
┌───────────────┬────────┬───────────────┐
|
||||
│ METRIC ┆ VALUE ┆ SIGNAL │
|
||||
╞═══════════════╪════════╪═══════════════╡
|
||||
│ Debt/Equity ┆ 0.42 ┆ conservative │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ Current Ratio ┆ 1.18 ┆ tight │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ ROA ┆ +3.10% ┆ - │
|
||||
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
||||
│ Overall ┆ - ┆ moderate risk │
|
||||
└───────────────┴────────┴───────────────┘
|
||||
|
||||
[1mOverall Signal:[0m [33mmixed[39m
|
||||
Overall Signal: mixed
|
||||
--- stderr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue