docs(cli): help for config keys and output, changes dates, alias search

`idx config --help` lists the keys and says when it prints JSON;
`ownership changes` says both dates must be imported releases and that
accounts are summed; `ownership search` and `entity` describe alias and
substring matching. Regenerated the CLI reference page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V3syn2fN2LNo5pvTSqc6eh
This commit is contained in:
hermes 2026-10-18 02:13:50 +00:00
commit 5cff14bf90
5 changed files with 177 additions and 42 deletions

View file

@ -5,7 +5,11 @@ use crate::output::{OutputSetting, json};
use idx_core::error::IdxError; use idx_core::error::IdxError;
#[derive(Debug, Args)] #[derive(Debug, Args)]
#[command(about = "Manage configuration")] #[command(
about = "Manage configuration",
long_about = "Manage configuration in ~/.config/idx/config.toml (or $XDG_CONFIG_HOME/idx/config.toml).\n\nResults print as plain text, even when piped, so `$(idx config path)` works in scripts. Ask for JSON with `-o json`, `IDX_OUTPUT=json`, or `general.output = \"json\"`.",
after_help = "Keys:\n general.provider, general.history_provider, general.exchange, general.output,\n general.color, cache.quote_ttl, cache.fundamental_ttl, ownership.db_path,\n ownership.snapshot_manifest\n\nExamples:\n idx config init\n idx config set general.output json\n idx config get cache.quote_ttl\n idx config path"
)]
pub struct ConfigCmd { pub struct ConfigCmd {
#[command(subcommand)] #[command(subcommand)]
pub command: ConfigSubcommand, pub command: ConfigSubcommand,
@ -16,9 +20,16 @@ pub enum ConfigSubcommand {
#[command(about = "Create default configuration file")] #[command(about = "Create default configuration file")]
Init, Init,
#[command(about = "Get a configuration value by key")] #[command(about = "Get a configuration value by key")]
Get { key: String }, Get {
/// Key such as general.provider (see `idx config --help`).
key: String,
},
#[command(about = "Set a configuration value by key")] #[command(about = "Set a configuration value by key")]
Set { key: String, value: String }, Set {
/// Key such as general.provider (see `idx config --help`).
key: String,
value: String,
},
#[command(about = "Print configuration file path")] #[command(about = "Print configuration file path")]
Path, Path,
} }

View file

@ -50,8 +50,15 @@ pub enum OwnershipCommand {
/// Show all holders for a ticker (KSEI + Bing combined). /// Show all holders for a ticker (KSEI + Bing combined).
Ticker(TickerArgs), Ticker(TickerArgs),
/// Show all holdings for an entity across tickers. /// Show all holdings for an entity across tickers.
#[command(
after_help = "Examples:\n idx ownership entity \"ASTRA INTERNATIONAL\"\n idx ownership search astra # list candidates first"
)]
Entity(EntityArgs), Entity(EntityArgs),
/// Search entities by name. /// Search entities by name or KSEI alias.
#[command(
long_about = "Search entities by name or KSEI alias.\n\nMatches canonical names and the raw names KSEI prints (e.g. `PT ASTRA INTERNATIONAL TBK`), case-insensitively. Ranked: exact name, exact alias, prefix, then substring.",
after_help = "Examples:\n idx ownership search astra\n idx ownership search \"PT ASTRA INTERNATIONAL TBK\" --limit 5"
)]
Search(SearchArgs), Search(SearchArgs),
/// Rank entities by cross-ownership breadth. /// Rank entities by cross-ownership breadth.
CrossHolders(CrossHolderArgs), CrossHolders(CrossHolderArgs),
@ -60,6 +67,10 @@ pub enum OwnershipCommand {
/// Show Bing institutional flow for a ticker. /// Show Bing institutional flow for a ticker.
Flow(FlowArgs), Flow(FlowArgs),
/// Diff two KSEI releases. /// Diff two KSEI releases.
#[command(
long_about = "Diff two KSEI releases: new, exited, increased, and decreased holders.\n\nBoth dates must be imported releases (`idx ownership releases` lists them), with --from before --to. A holder's accounts in a ticker are summed, so an investor with several accounts compares by its total stake.",
after_help = "Examples:\n idx ownership releases\n idx ownership changes --from 2026-08-31 --to 2026-09-30"
)]
Changes(ChangesArgs), Changes(ChangesArgs),
/// Ownership network graph. /// Ownership network graph.
Graph(GraphArgs), Graph(GraphArgs),
@ -114,11 +125,13 @@ pub struct TickerArgs {
#[derive(Debug, Args)] #[derive(Debug, Args)]
pub struct EntityArgs { pub struct EntityArgs {
/// Entity name or part of one, case-insensitive; the shortest match is shown.
pub name: String, pub name: String,
} }
#[derive(Debug, Args)] #[derive(Debug, Args)]
pub struct SearchArgs { pub struct SearchArgs {
/// Name, KSEI alias, or part of one.
pub query: String, pub query: String,
#[arg(long, default_value_t = 20)] #[arg(long, default_value_t = 20)]
pub limit: usize, pub limit: usize,
@ -147,8 +160,10 @@ pub struct FlowArgs {
#[derive(Debug, Args)] #[derive(Debug, Args)]
pub struct ChangesArgs { pub struct ChangesArgs {
/// Earlier release date, YYYY-MM-DD.
#[arg(long)] #[arg(long)]
pub from: String, pub from: String,
/// Later release date, YYYY-MM-DD.
#[arg(long)] #[arg(long)]
pub to: String, pub to: String,
} }

View file

@ -1,6 +1,8 @@
exit: 0 exit: 0
--- stdout --- stdout
Manage configuration Manage configuration in ~/.config/idx/config.toml (or $XDG_CONFIG_HOME/idx/config.toml).
Results print as plain text, even when piped, so `$(idx config path)` works in scripts. Ask for JSON with `-o json`, `IDX_OUTPUT=json`, or `general.output = "json"`.
Usage: idx config [OPTIONS] <COMMAND> Usage: idx config [OPTIONS] <COMMAND>
@ -12,11 +14,37 @@ Commands:
help Print this message or the help of the given subcommand(s) help Print this message or the help of the given subcommand(s)
Options: Options:
-o, --output <OUTPUT> Output format [default: auto = table on a terminal, json when piped] [possible values: auto, table, json, jsonl] -o, --output <OUTPUT>
--no-color Disable colored output Output format [default: auto = table on a terminal, json when piped]
-q, --quiet Suppress non-essential output
-v, --verbose... Increase verbosity (-v, -vv) [possible values: auto, table, json, jsonl]
--offline Run without network requests
--no-cache Bypass local cache --no-color
-h, --help Print help Disable colored output
-q, --quiet
Suppress non-essential output
-v, --verbose...
Increase verbosity (-v, -vv)
--offline
Run without network requests
--no-cache
Bypass local cache
-h, --help
Print help (see a summary with '-h')
Keys:
general.provider, general.history_provider, general.exchange, general.output,
general.color, cache.quote_ttl, cache.fundamental_ttl, ownership.db_path,
ownership.snapshot_manifest
Examples:
idx config init
idx config set general.output json
idx config get cache.quote_ttl
idx config path
--- stderr --- stderr

View file

@ -15,7 +15,7 @@ Commands:
sync Install or refresh a maintained ownership SQLite snapshot sync Install or refresh a maintained ownership SQLite snapshot
ticker Show all holders for a ticker (KSEI + Bing combined) ticker Show all holders for a ticker (KSEI + Bing combined)
entity Show all holdings for an entity across tickers entity Show all holdings for an entity across tickers
search Search entities by name search Search entities by name or KSEI alias
cross-holders Rank entities by cross-ownership breadth cross-holders Rank entities by cross-ownership breadth
concentration Rank tickers by ownership concentration concentration Rank tickers by ownership concentration
flow Show Bing institutional flow for a ticker flow Show Bing institutional flow for a ticker

View file

@ -463,7 +463,9 @@ Examples:
## `idx config` ## `idx config`
```text ```text
Manage configuration Manage configuration in ~/.config/idx/config.toml (or $XDG_CONFIG_HOME/idx/config.toml).
Results print as plain text, even when piped, so `$(idx config path)` works in scripts. Ask for JSON with `-o json`, `IDX_OUTPUT=json`, or `general.output = "json"`.
Usage: idx config [OPTIONS] <COMMAND> Usage: idx config [OPTIONS] <COMMAND>
@ -475,13 +477,39 @@ Commands:
help Print this message or the help of the given subcommand(s) help Print this message or the help of the given subcommand(s)
Options: Options:
-o, --output <OUTPUT> Output format [default: auto = table on a terminal, json when piped] [possible values: auto, table, json, jsonl] -o, --output <OUTPUT>
--no-color Disable colored output Output format [default: auto = table on a terminal, json when piped]
-q, --quiet Suppress non-essential output
-v, --verbose... Increase verbosity (-v, -vv) [possible values: auto, table, json, jsonl]
--offline Run without network requests
--no-cache Bypass local cache --no-color
-h, --help Print help Disable colored output
-q, --quiet
Suppress non-essential output
-v, --verbose...
Increase verbosity (-v, -vv)
--offline
Run without network requests
--no-cache
Bypass local cache
-h, --help
Print help (see a summary with '-h')
Keys:
general.provider, general.history_provider, general.exchange, general.output,
general.color, cache.quote_ttl, cache.fundamental_ttl, ownership.db_path,
ownership.snapshot_manifest
Examples:
idx config init
idx config set general.output json
idx config get cache.quote_ttl
idx config path
``` ```
### `idx config init` ### `idx config init`
@ -509,7 +537,7 @@ Get a configuration value by key
Usage: idx config get [OPTIONS] <KEY> Usage: idx config get [OPTIONS] <KEY>
Arguments: Arguments:
<KEY> <KEY> Key such as general.provider (see `idx config --help`)
Options: Options:
-o, --output <OUTPUT> Output format [default: auto = table on a terminal, json when piped] [possible values: auto, table, json, jsonl] -o, --output <OUTPUT> Output format [default: auto = table on a terminal, json when piped] [possible values: auto, table, json, jsonl]
@ -529,7 +557,7 @@ Set a configuration value by key
Usage: idx config set [OPTIONS] <KEY> <VALUE> Usage: idx config set [OPTIONS] <KEY> <VALUE>
Arguments: Arguments:
<KEY> <KEY> Key such as general.provider (see `idx config --help`)
<VALUE> <VALUE>
Options: Options:
@ -633,7 +661,7 @@ Commands:
sync Install or refresh a maintained ownership SQLite snapshot sync Install or refresh a maintained ownership SQLite snapshot
ticker Show all holders for a ticker (KSEI + Bing combined) ticker Show all holders for a ticker (KSEI + Bing combined)
entity Show all holdings for an entity across tickers entity Show all holdings for an entity across tickers
search Search entities by name search Search entities by name or KSEI alias
cross-holders Rank entities by cross-ownership breadth cross-holders Rank entities by cross-ownership breadth
concentration Rank tickers by ownership concentration concentration Rank tickers by ownership concentration
flow Show Bing institutional flow for a ticker flow Show Bing institutional flow for a ticker
@ -833,7 +861,7 @@ Show all holdings for an entity across tickers
Usage: idx ownership entity [OPTIONS] <NAME> Usage: idx ownership entity [OPTIONS] <NAME>
Arguments: Arguments:
<NAME> <NAME> Entity name or part of one, case-insensitive; the shortest match is shown
Options: Options:
-o, --output <OUTPUT> Output format [default: auto = table on a terminal, json when piped] [possible values: auto, table, json, jsonl] -o, --output <OUTPUT> Output format [default: auto = table on a terminal, json when piped] [possible values: auto, table, json, jsonl]
@ -843,27 +871,55 @@ Options:
--offline Run without network requests --offline Run without network requests
--no-cache Bypass local cache --no-cache Bypass local cache
-h, --help Print help -h, --help Print help
Examples:
idx ownership entity "ASTRA INTERNATIONAL"
idx ownership search astra # list candidates first
``` ```
### `idx ownership search` ### `idx ownership search`
```text ```text
Search entities by name Search entities by name or KSEI alias.
Matches canonical names and the raw names KSEI prints (e.g. `PT ASTRA INTERNATIONAL TBK`), case-insensitively. Ranked: exact name, exact alias, prefix, then substring.
Usage: idx ownership search [OPTIONS] <QUERY> Usage: idx ownership search [OPTIONS] <QUERY>
Arguments: Arguments:
<QUERY> <QUERY>
Name, KSEI alias, or part of one
Options: Options:
--limit <LIMIT> [default: 20] --limit <LIMIT>
-o, --output <OUTPUT> Output format [default: auto = table on a terminal, json when piped] [possible values: auto, table, json, jsonl] [default: 20]
--no-color Disable colored output
-q, --quiet Suppress non-essential output -o, --output <OUTPUT>
-v, --verbose... Increase verbosity (-v, -vv) Output format [default: auto = table on a terminal, json when piped]
--offline Run without network requests
--no-cache Bypass local cache [possible values: auto, table, json, jsonl]
-h, --help Print help
--no-color
Disable colored output
-q, --quiet
Suppress non-essential output
-v, --verbose...
Increase verbosity (-v, -vv)
--offline
Run without network requests
--no-cache
Bypass local cache
-h, --help
Print help (see a summary with '-h')
Examples:
idx ownership search astra
idx ownership search "PT ASTRA INTERNATIONAL TBK" --limit 5
``` ```
### `idx ownership cross-holders` ### `idx ownership cross-holders`
@ -927,20 +983,45 @@ Options:
### `idx ownership changes` ### `idx ownership changes`
```text ```text
Diff two KSEI releases Diff two KSEI releases: new, exited, increased, and decreased holders.
Both dates must be imported releases (`idx ownership releases` lists them), with --from before --to. A holder's accounts in a ticker are summed, so an investor with several accounts compares by its total stake.
Usage: idx ownership changes [OPTIONS] --from <FROM> --to <TO> Usage: idx ownership changes [OPTIONS] --from <FROM> --to <TO>
Options: Options:
--from <FROM> --from <FROM>
-o, --output <OUTPUT> Output format [default: auto = table on a terminal, json when piped] [possible values: auto, table, json, jsonl] Earlier release date, YYYY-MM-DD
--no-color Disable colored output
-o, --output <OUTPUT>
Output format [default: auto = table on a terminal, json when piped]
[possible values: auto, table, json, jsonl]
--no-color
Disable colored output
--to <TO> --to <TO>
-q, --quiet Suppress non-essential output Later release date, YYYY-MM-DD
-v, --verbose... Increase verbosity (-v, -vv)
--offline Run without network requests -q, --quiet
--no-cache Bypass local cache Suppress non-essential output
-h, --help Print help
-v, --verbose...
Increase verbosity (-v, -vv)
--offline
Run without network requests
--no-cache
Bypass local cache
-h, --help
Print help (see a summary with '-h')
Examples:
idx ownership releases
idx ownership changes --from 2026-08-31 --to 2026-09-30
``` ```
### `idx ownership graph` ### `idx ownership graph`