mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-08-07 01:33:52 +00:00
No description
- Rust 92.9%
- Shell 6.7%
- Nix 0.4%
Newer KSEI above1 PDFs use spaces in column headers (SHARE CODE, INVESTOR NAME, INVESTOR CLASSIFICATION) instead of the underscored form (SHARE_CODE, INVESTOR_NAME, INVESTOR_TYPE) that the parser schema markers expected. This caused valid holder-register PDFs to be misclassified as LegacyAboveFivePercent (false positive on REKENING TAMPUNGAN KSEI text in the data), blocking import. Changes: - Add normalize_stext_for_classification() that replaces spaces with underscores inside text="..." attributes before schema marker matching, so both old and new header layouts are recognized - Add INVESTOR_CLASSIFICATION to HOLDER_REGISTER_SCHEMA_MARKERS and HEADER_LABELS to match the renamed column - Update ANNOUNCEMENT_WRAPPER and ABOVE_FIVE marker constants to use underscores (matching the normalized text) - Add test fixture and test case for the spaced-header layout - Bump version to 0.2.3 Tested against the live June 2026 KSEI PDF (as_of 2026-05-29): idx ownership import --url <latest-pdf-url> -> Imported 7124 rows for 956 tickers (as of 2026-05-29) |
||
|---|---|---|
| .codex/skills/idx-release | ||
| .github/workflows | ||
| contrib/systemd | ||
| docs | ||
| scripts | ||
| src | ||
| tests | ||
| .envrc | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| FEATURE_SPEC.md | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
| TODO.md | ||
idx-cli
CLI tool for Indonesian stock market (IDX) analysis, built in Rust for humans and AI agents.
Installation
Cargo
cargo install idx-cli
This installs the idx binary. idx-cli currently requires Rust 1.85+.
If you use the Cargo install path directly, some commands also require helper tools at runtime:
- Yahoo-authenticated flows require a
curl_chrome*binary fromcurl-impersonate-chromeinPATH, orIDX_CURL_IMPERSONATE_BINpointing at that binary. - Ownership PDF import requires
mutoolfrom MuPDF inPATH.
Install those helpers with your OS package manager, or use the Nix app/package below so they are wrapped automatically.
Nix
nix run github:0xrsydn/idx-cli -- version
nix profile install github:0xrsydn/idx-cli#default
The Nix app wraps idx with curl-impersonate and mupdf, so the Yahoo auth and ownership PDF helper tools are available automatically.
Quick start
idx stocks quote BBCA
idx stocks quote BBCA,BBRI,BMRI
idx -o json stocks quote BBCA
idx stocks history BBCA --period 3mo
idx config init
idx cache info
idx --offline stocks quote BBCA
Features
- Provider abstraction (swap data sources behind one interface)
- Local file cache with TTL
- Offline mode with stale-cache fallback
- Human table output and machine-friendly JSON output
Configuration
Config file location:
~/.config/idx/config.toml
You can configure using:
- Config file (
idx config init,idx config set) - Environment variables
- CLI flags
Precedence order:
- CLI flags
- Environment variables
- Config file
- Built-in defaults
Agent-friendly usage
- Use
idx --helpand subcommand help for discoverability - Use
-o json/--output jsonfor structured output
Development
nix develop
cargo test
Prek hooks are configured for quality gates:
- pre-commit:
cargo fmt --check+cargo clippy -- -D warnings - pre-push:
cargo test
License
MIT