mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-11-07 01:35:36 +00:00
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>
50 lines
1.3 KiB
TOML
50 lines
1.3 KiB
TOML
[package]
|
|
name = "idx-cli"
|
|
version = "0.2.4"
|
|
edition = "2024"
|
|
rust-version = "1.85"
|
|
description = "CLI tool for Indonesian stock market (IDX) analysis"
|
|
license = "MIT"
|
|
repository = "https://github.com/0xrsydn/idx-cli"
|
|
homepage = "https://github.com/0xrsydn/idx-cli"
|
|
keywords = ["idx", "stocks", "indonesia", "cli", "finance"]
|
|
categories = ["command-line-utilities", "finance"]
|
|
include = [
|
|
"/Cargo.toml",
|
|
"/Cargo.lock",
|
|
"/LICENSE",
|
|
"/README.md",
|
|
"/src/**",
|
|
"/tests/cli.rs",
|
|
"/tests/fixtures/**",
|
|
]
|
|
|
|
[[bin]]
|
|
name = "idx"
|
|
path = "src/main.rs"
|
|
|
|
[features]
|
|
default = ["ownership"]
|
|
ownership = ["dep:rusqlite", "dep:quick-xml", "dep:sha2", "dep:zip"]
|
|
|
|
[dependencies]
|
|
clap = { version = "4", features = ["derive"] }
|
|
clap_complete = "4"
|
|
ureq = { version = "3", features = ["json", "cookies"] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = { version = "1", features = ["raw_value"] }
|
|
comfy-table = "7"
|
|
owo-colors = "4"
|
|
toml = "0.8"
|
|
directories = "5"
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
thiserror = "2"
|
|
fastrand = "2"
|
|
rusqlite = { version = "0.32", features = ["bundled-full"], optional = true }
|
|
quick-xml = { version = "0.37", optional = true }
|
|
sha2 = { version = "0.10", optional = true }
|
|
zip = { version = "2", default-features = false, features = ["deflate"], optional = true }
|
|
|
|
[dev-dependencies]
|
|
assert_cmd = "2"
|
|
predicates = "3"
|