kwcli 0.1.0__py3-none-any.whl
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.
- kiwoom/__init__.py +47 -0
- kiwoom/_data/kiwoom_api_spec.json +66372 -0
- kiwoom/core/__init__.py +6 -0
- kiwoom/core/auth.py +349 -0
- kiwoom/core/client.py +244 -0
- kiwoom/core/errors.py +177 -0
- kiwoom/core/platform_paths.py +68 -0
- kiwoom/core/profiles.py +143 -0
- kiwoom/core/runtime.py +153 -0
- kiwoom/core/secrets.py +217 -0
- kiwoom/core/settings.py +64 -0
- kiwoom/core/token_store.py +186 -0
- kiwoom/core/types.py +28 -0
- kiwoom/core/ws_client.py +262 -0
- kiwoom/realtime/__init__.py +30 -0
- kiwoom/realtime/decoders.py +171 -0
- kiwoom/realtime/events.py +98 -0
- kiwoom/realtime/packets.py +65 -0
- kiwoom/realtime/schemas.py +76 -0
- kiwoom/realtime/stream.py +213 -0
- kiwoom/specs.py +272 -0
- kiwoom_cli/README.md +671 -0
- kiwoom_cli/__init__.py +9 -0
- kiwoom_cli/__main__.py +5 -0
- kiwoom_cli/argument_maps.py +561 -0
- kiwoom_cli/arguments.py +147 -0
- kiwoom_cli/auth_context.py +64 -0
- kiwoom_cli/banner.py +125 -0
- kiwoom_cli/commands/__init__.py +1 -0
- kiwoom_cli/commands/auth.py +406 -0
- kiwoom_cli/commands/groups.py +281 -0
- kiwoom_cli/commands/mapped.py +74 -0
- kiwoom_cli/commands/orders.py +158 -0
- kiwoom_cli/commands/spec.py +98 -0
- kiwoom_cli/commands/stocks.py +100 -0
- kiwoom_cli/commands/streams.py +470 -0
- kiwoom_cli/doctor.py +324 -0
- kiwoom_cli/errors.py +24 -0
- kiwoom_cli/executor/__init__.py +33 -0
- kiwoom_cli/executor/condition.py +374 -0
- kiwoom_cli/executor/rest.py +132 -0
- kiwoom_cli/executor/waits.py +34 -0
- kiwoom_cli/executor/websocket.py +131 -0
- kiwoom_cli/main.py +203 -0
- kiwoom_cli/maps/README.md +99 -0
- kiwoom_cli/maps/api_commands.csv +209 -0
- kiwoom_cli/maps/arguments.csv +731 -0
- kiwoom_cli/maps/order_confirmation_commands.csv +13 -0
- kiwoom_cli/maps/order_confirmation_fields.csv +71 -0
- kiwoom_cli/maps/order_price_policies.csv +47 -0
- kiwoom_cli/maps/order_value_labels.csv +28 -0
- kiwoom_cli/maps/positional_arguments.csv +21 -0
- kiwoom_cli/order_confirmation.py +167 -0
- kiwoom_cli/output.py +136 -0
- kiwoom_cli/registry.py +95 -0
- kiwoom_cli/safety.py +30 -0
- kiwoom_cli/setup.py +533 -0
- kwcli-0.1.0.dist-info/METADATA +215 -0
- kwcli-0.1.0.dist-info/RECORD +62 -0
- kwcli-0.1.0.dist-info/WHEEL +4 -0
- kwcli-0.1.0.dist-info/entry_points.txt +2 -0
- kwcli-0.1.0.dist-info/licenses/LICENSE.md +36 -0
kiwoom_cli/README.md
ADDED
|
@@ -0,0 +1,671 @@
|
|
|
1
|
+
# Kiwoom CLI
|
|
2
|
+
|
|
3
|
+
This directory owns the installed customer-facing command:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
kiwoom
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Do not document `uv run kiwoom` as the customer-facing invocation.
|
|
10
|
+
|
|
11
|
+
The CLI is the natural operation surface for humans and AI agents that need to
|
|
12
|
+
inspect Kiwoom OpenAPI data, manage auth state, and eventually perform guarded
|
|
13
|
+
trading actions. Runtime/auth logic stays in `kiwoom/core/`; CLI use cases stay
|
|
14
|
+
under `kiwoom_cli/`; generated examples stay under `Examples/`; maintenance
|
|
15
|
+
generation utilities stay under `utils/`.
|
|
16
|
+
|
|
17
|
+
## Quickstart
|
|
18
|
+
|
|
19
|
+
The everyday flow for both humans and AI agents is discovery first, then a
|
|
20
|
+
single command. The exhaustive per-command reference lives in
|
|
21
|
+
[docs/cli/command-contracts.md](../docs/cli/command-contracts.md); use `-h` on
|
|
22
|
+
any command for its live, mapped contract.
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
1. kiwoomcli setup # onboard: alias, demo/real, keys, verify
|
|
26
|
+
2. kiwoomcli spec search "<term>" # find the API/command you need
|
|
27
|
+
3. kiwoom <group> <command> -h # Summary/Behavior/Examples/OpenAPI map
|
|
28
|
+
4. kiwoom <group> <command> --format json
|
|
29
|
+
5. kiwoomcli domestic orders buy ... # writes need --confirm; otherwise preview only
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The full command inventory below is the audited reference surface. Day-to-day
|
|
33
|
+
use should go through `spec search` and `-h` rather than scanning the inventory.
|
|
34
|
+
|
|
35
|
+
## Usage Notes
|
|
36
|
+
|
|
37
|
+
- `kiwoomcli setup` is the onboarding bootstrap: it first runs an environment
|
|
38
|
+
pre-flight (OS credential-store availability plus a PATH ambiguity warning),
|
|
39
|
+
then creates an account alias, chooses demo/real, stores App Key / Secret,
|
|
40
|
+
validates with a safe read-only call (re-prompting on validation failure in a
|
|
41
|
+
terminal), sets the current profile, and prints a readiness summary. In a
|
|
42
|
+
non-interactive shell it fails with guidance instead of hanging (pass
|
|
43
|
+
`--mode`). `kiwoomcli doctor` is the read-only state
|
|
44
|
+
diagnostic: it explains which auth context is selected now (priority of
|
|
45
|
+
`--profile`/`KIWOOM_PROFILE` > `--mode`/`KIWOOM_MODE` > current profile),
|
|
46
|
+
shows per-profile credential/token/refresh health, and recommends fixes (for
|
|
47
|
+
example, it warns when `KIWOOM_MODE` overrides the current profile).
|
|
48
|
+
- `kiwoomcli auth clear` removes only the secret material for a target: by default
|
|
49
|
+
the local token cache, and with `--all` also the OS credential-store App
|
|
50
|
+
Key/Secret. It does NOT unregister the account, so the alias still appears in
|
|
51
|
+
`kiwoomcli auth list` with `credentials=아니오`. To fully unregister an account,
|
|
52
|
+
use `kiwoomcli auth remove <alias>`, which deletes the profile entry, its token
|
|
53
|
+
cache, and its stored credentials in one step (and clears the current-profile
|
|
54
|
+
selection if that alias was current).
|
|
55
|
+
- `kiwoomcli auth export [alias] [--dir FOLDER] [--yes]` writes the stored App
|
|
56
|
+
Key/Secret to a `.env` file (mode-specific keys like `APP_KEY`/`APP_SECRET`);
|
|
57
|
+
it never prints the secrets. Exporting plaintext credentials is guarded: it
|
|
58
|
+
asks for confirmation (`--yes` skips; a non-interactive shell requires
|
|
59
|
+
`--yes`), writes the file with `0600` permissions, and auto-registers the
|
|
60
|
+
file in the enclosing repo's `.gitignore` to prevent accidental commits.
|
|
61
|
+
Without `--dir` it saves to the current folder and says so before writing.
|
|
62
|
+
- If `kiwoomcli auth list` or `kiwoomcli doctor` shows a saved alias with
|
|
63
|
+
`credentials=아니오`, an expired/non-reusable token, and `지금 호출=불가`, the
|
|
64
|
+
alias was not necessarily deleted; the OS credential-store App Key/Secret is
|
|
65
|
+
missing or unreadable. Re-login the same alias to restore credentials and a
|
|
66
|
+
fresh token, for example:
|
|
67
|
+
`kiwoomcli auth login --alias '실전계좌' --mode real`, then verify with
|
|
68
|
+
`kiwoomcli auth status --profile '실전계좌'`.
|
|
69
|
+
- `--profile NAME` uses a stored account alias (App Key / Secret in the OS
|
|
70
|
+
credential store). `--mode demo|real` does not use a stored alias; mode-only
|
|
71
|
+
execution needs `APP_KEY` / `APP_SECRET` environment variables (or mode-level
|
|
72
|
+
credentials). A missing-credentials error therefore differs by entry path,
|
|
73
|
+
and the message names the matching fix.
|
|
74
|
+
- `kiwoomcli domestic stocks watchlist-info --codes` expects a pipe-delimited Kiwoom code
|
|
75
|
+
list, for example `--codes '005930|000660'`. Comma-delimited input is not the
|
|
76
|
+
documented API shape.
|
|
77
|
+
- `kiwoomcli domestic stocks credit-loanable-check` preserves the Kiwoom `crd_alow_yn`
|
|
78
|
+
field and adds `loanable`: `true`, `false`, or `null` when the response text
|
|
79
|
+
cannot be classified.
|
|
80
|
+
- Gold spot examples use `M04020000` (`금 99.99_1kg`) as the sample instrument
|
|
81
|
+
code. Gold development-endpoint credentials, when needed, must remain outside
|
|
82
|
+
command output and committed files.
|
|
83
|
+
- ELW sample parameters should come from current/proven ELW evidence. ELW
|
|
84
|
+
instruments expire, so a previously valid `--code` can later return an empty
|
|
85
|
+
list even when the command mapping is correct.
|
|
86
|
+
- Account/order history commands are account/date-state dependent. Realized PnL,
|
|
87
|
+
return-rate, fill-history, and open-order queries can return an empty list
|
|
88
|
+
when the selected account and date have no matching holdings, fills, or open
|
|
89
|
+
orders. Treat this as an account-state-dependent zero-row result, not as a
|
|
90
|
+
synthetic success proof or an automatic command mapping failure.
|
|
91
|
+
- Program-trading aggregate commands are market-time and condition dependent.
|
|
92
|
+
Empty lists with `return_code=0` should be recorded as zero rows and not
|
|
93
|
+
over-counted as investor-useful data evidence. For `--market-code`, use the
|
|
94
|
+
program-trading market code family from the samplecode, such as `P00101` for
|
|
95
|
+
KRX KOSPI or `P10102` for KRX KOSDAQ; ordinary market selectors like `000`
|
|
96
|
+
are weak evidence for these APIs.
|
|
97
|
+
|
|
98
|
+
## Current Commands
|
|
99
|
+
|
|
100
|
+
Implemented:
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
kiwoomcli setup [NAME] [--alias NAME] [--mode demo|real]
|
|
104
|
+
kiwoomcli doctor
|
|
105
|
+
kiwoomcli auth login [NAME] [--alias NAME] [--mode demo|real]
|
|
106
|
+
kiwoomcli auth list
|
|
107
|
+
kiwoomcli auth switch <alias>
|
|
108
|
+
kiwoomcli auth status [NAME] [--profile NAME | --mode demo|real]
|
|
109
|
+
kiwoomcli auth refresh [NAME] [--profile NAME | --mode demo|real]
|
|
110
|
+
kiwoomcli auth revoke [NAME] [--profile NAME | --mode demo|real]
|
|
111
|
+
kiwoomcli auth clear [NAME] [--profile NAME | --mode demo|real] [--all]
|
|
112
|
+
kiwoomcli auth remove <alias>
|
|
113
|
+
kiwoomcli spec search <query> [--limit N]
|
|
114
|
+
kiwoomcli spec show <api-id> [--format pretty|json|yaml]
|
|
115
|
+
kiwoomcli spec groups [--format pretty|json|yaml]
|
|
116
|
+
kiwoomcli spec apis [--group <text>] [--limit N] [--format pretty|json|yaml]
|
|
117
|
+
kiwoomcli domestic stocks info --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
118
|
+
kiwoomcli domestic stocks trend --code <code> --date <yyyymmdd> --kind financing|loan [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
119
|
+
kiwoomcli domestic stocks realtime-rank --window 1m|10m|1h|today|30s [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
120
|
+
kiwoomcli domestic stocks brokers --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
121
|
+
kiwoomcli domestic stocks fills --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
122
|
+
kiwoomcli domestic stocks daily-trades --code <code> --from <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
123
|
+
kiwoomcli domestic stocks new-high-low --market all|kospi|kosdaq --kind new-high|new-low --price-basis high-low|close --stock-condition <value> --volume-condition <value> --credit-condition <value> --include-limit yes|no --period-days 5|10|20|60|250 --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
124
|
+
kiwoomcli domestic stocks limit-move --market all|kospi|kosdaq --direction upper|rise|flat|lower|fall|prev-upper|prev-lower --sort code|count|change-rate --stock-condition <value> --volume-condition <value> --credit-condition <value> --price-condition <value> --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
125
|
+
kiwoomcli domestic stocks high-low-near --kind high|low --near-rate <value> --market all|kospi|kosdaq --volume-condition <value> --stock-condition <value> --credit-condition <value> --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
126
|
+
kiwoomcli domestic stocks price-spike --market all|kospi|kosdaq|kospi200 --direction rise|fall --time-unit minute|day --time <n> --volume-condition <value> --stock-condition <value> --credit-condition <value> --price-condition <value> --include-limit yes|no --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
127
|
+
kiwoomcli domestic stocks volume-renewal --market all|kospi|kosdaq --period-days 5|10|20|60|250 --volume-condition <value> --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
128
|
+
kiwoomcli domestic stocks volume-zone --market all|kospi|kosdaq --concentration-rate <value> --include-current yes|no --zone-count <n> --period-days 50|100|150|200|250|300 --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
129
|
+
kiwoomcli domestic stocks valuation-rank --kind low-pbr|high-pbr|low-per|high-per|low-roe|high-roe --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
130
|
+
kiwoomcli domestic stocks open-change --basis open|high|low|base --volume-condition <value> --market all|kospi|kosdaq --include-limit yes|no --stock-condition <value> --credit-condition <value> --amount-condition <value> --direction top|bottom --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
131
|
+
kiwoomcli domestic stocks broker-volume-zone --code <code> --from <yyyymmdd> --to <yyyymmdd> --date-mode period|start-end --position today|previous --period-days 5|10|20|40|60|120 --sort close|date --broker-code <value> --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
132
|
+
kiwoomcli domestic stocks broker-instant-volume --broker-code <value> [--code <code>] --market all|kospi|kosdaq|stock --quantity-condition <value> --price-condition <value> --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
133
|
+
kiwoomcli domestic stocks vi-triggered --market all|kospi|kosdaq --session all|regular|after-hours [--code <code>] --vi-type all|static|dynamic|both --skip-stocks <value> --use-volume yes|no --min-volume <value> --max-volume <value> --use-amount yes|no --min-amount <value> --max-amount <value> --direction all|rise|fall --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
134
|
+
kiwoomcli domestic stocks today-previous-fills --code <code> --day today|previous [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
135
|
+
kiwoomcli domestic stocks investor-daily --from <yyyymmdd> --to <yyyymmdd> --side net-sell|net-buy --market kospi|kosdaq --investor individual|foreign|financial-investment|investment-trust|private-fund|other-financial|bank|insurance|pension|state|other-corporate|institution --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
136
|
+
kiwoomcli domestic stocks investor-by-stock --date <yyyymmdd> --code <code> --basis amount|quantity --side net-buy|buy|sell --unit thousand|share [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
137
|
+
kiwoomcli domestic stocks investor-by-stock-total --code <code> --from <yyyymmdd> --to <yyyymmdd> --basis amount|quantity --side net-buy --unit thousand|share [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
138
|
+
kiwoomcli domestic stocks today-previous-trades --code <code> --day today|previous --interval-type tick|minute [--time <value>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
139
|
+
kiwoomcli domestic stocks watchlist-info --codes <value> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
140
|
+
kiwoomcli domestic stocks info-list --market-type kospi|kosdaq|kotc|konex|etn|loss-limit-etn|gold|volatility-etn|infrastructure|elw|mutual-fund|warrant|reit|warrant-certificate|etf|high-yield-fund [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
141
|
+
kiwoomcli domestic stocks info-detail --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
142
|
+
kiwoomcli domestic stocks sector-codes --market kospi|kosdaq|kospi200|kospi100|krx100 [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
143
|
+
kiwoomcli domestic stocks member-firms [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
144
|
+
kiwoomcli domestic stocks program-net-top --side net-sell|net-buy --basis amount|quantity --market-code <value> --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
145
|
+
kiwoomcli domestic stocks program-by-stock --date <yyyymmdd> --market-code <value> --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
146
|
+
kiwoomcli domestic stocks credit-loanable [--credit-grade all|a|b|c|d|e] [--market all|kospi|kosdaq] [--code <code>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
147
|
+
kiwoomcli domestic stocks credit-loanable-check --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
148
|
+
kiwoomcli domestic quotes price --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
149
|
+
kiwoomcli domestic quotes balance --date <yyyymmdd> --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
150
|
+
kiwoomcli domestic quotes by-stock --code <code> --from <yyyymmdd> --to <yyyymmdd> --institution-price buy|sell --foreign-price buy|sell [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
151
|
+
kiwoomcli domestic quotes list --kind all|warrant-security|warrant-certificate [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
152
|
+
kiwoomcli domestic quotes gold-price --code <gold-code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
153
|
+
kiwoomcli domestic quotes gold-fills --code <gold-code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
154
|
+
kiwoomcli domestic quotes gold-daily --code <gold-code> --date <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
155
|
+
kiwoomcli domestic quotes gold-expected --code <gold-code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
156
|
+
kiwoomcli domestic quotes multi-period --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
157
|
+
kiwoomcli domestic quotes intraday-minute --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
158
|
+
kiwoomcli domestic quotes institution-daily --from <yyyymmdd> --to <yyyymmdd> --side net-sell|net-buy --market kospi|kosdaq --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
159
|
+
kiwoomcli domestic quotes strength-time --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
160
|
+
kiwoomcli domestic quotes strength-daily --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
161
|
+
kiwoomcli domestic quotes investor-intraday --market all|kospi|kosdaq --basis combined --investor foreign|institution|investment-trust|insurance|bank|pension|state|other-corporate --foreign-all yes|no --same-net-buy yes|no --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
162
|
+
kiwoomcli domestic quotes investor-after-close --market all|kospi|kosdaq --basis amount|quantity --side net-buy|buy|sell --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
163
|
+
kiwoomcli domestic quotes broker-trend --broker-code <value> --code <code> --from <yyyymmdd> --to <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
164
|
+
kiwoomcli domestic quotes daily-price --code <code> --date <yyyymmdd> --basis quantity|amount [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
165
|
+
kiwoomcli domestic quotes after-hours --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
166
|
+
kiwoomcli domestic quotes program-time --date <yyyymmdd> --basis amount|quantity --market-code <value> --interval-type tick|minute --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
167
|
+
kiwoomcli domestic quotes program-cumulative --date <yyyymmdd> --basis amount|quantity --market kospi|kosdaq --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
168
|
+
kiwoomcli domestic quotes program-by-stock --basis amount|quantity --code <code> --date <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
169
|
+
kiwoomcli domestic quotes program-daily --date <yyyymmdd> --basis amount|quantity --market-code <value> --interval-type tick|minute --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
170
|
+
kiwoomcli domestic quotes stock-program-daily [--basis amount|quantity] --code <code> [--date <yyyymmdd>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
171
|
+
kiwoomcli domestic orderbooks list --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
172
|
+
kiwoomcli domestic orderbooks gold --code <gold-code> --tick 1|3|5|10|30 [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
173
|
+
kiwoomcli domestic candles daily --code <code> --date <yyyymmdd> [--adjusted 0|1] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
174
|
+
kiwoomcli domestic candles by-stock --date <yyyymmdd> --code <code> --basis amount|quantity --side net-buy|buy|sell --unit thousand|share [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
175
|
+
kiwoomcli domestic candles lookup --market all|kospi|kosdaq --basis amount|quantity --side net-buy|buy|sell --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
176
|
+
kiwoomcli domestic candles stock-tick --code <code> --interval <n> [--adjusted 0|1] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
177
|
+
kiwoomcli domestic candles stock-minute --code <code> --interval <n> [--adjusted 0|1] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
178
|
+
kiwoomcli domestic candles stock-weekly --code <code> --date <yyyymmdd> [--adjusted 0|1] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
179
|
+
kiwoomcli domestic candles stock-monthly --code <code> --date <yyyymmdd> [--adjusted 0|1] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
180
|
+
kiwoomcli domestic candles stock-yearly --code <code> --date <yyyymmdd> [--adjusted 0|1] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
181
|
+
kiwoomcli domestic candles sector-tick --code <sector-code> --interval <n> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
182
|
+
kiwoomcli domestic candles sector-minute --code <sector-code> --interval <n> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
183
|
+
kiwoomcli domestic candles sector-daily --code <sector-code> --date <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
184
|
+
kiwoomcli domestic candles sector-weekly --code <sector-code> --date <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
185
|
+
kiwoomcli domestic candles sector-monthly --code <sector-code> --date <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
186
|
+
kiwoomcli domestic candles sector-yearly --code <sector-code> --date <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
187
|
+
kiwoomcli domestic candles gold-tick --code <gold-code> --interval <n> [--adjusted 0|1] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
188
|
+
kiwoomcli domestic candles gold-minute --code <gold-code> --interval <n> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
189
|
+
kiwoomcli domestic candles gold-daily --code <gold-code> --date <yyyymmdd> [--adjusted 0|1] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
190
|
+
kiwoomcli domestic candles gold-weekly --code <gold-code> --date <yyyymmdd> [--adjusted 0|1] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
191
|
+
kiwoomcli domestic candles gold-monthly --code <gold-code> --date <yyyymmdd> [--adjusted 0|1] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
192
|
+
kiwoomcli domestic candles gold-today-tick --code <gold-code> --interval <n> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
193
|
+
kiwoomcli domestic candles gold-today-minute --code <gold-code> --interval <n> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
194
|
+
kiwoomcli domestic rankings orderbook-balance --market kospi|kosdaq --sort net-buy-balance|net-sell-balance|buy-ratio|sell-ratio --volume preopen|10k|50k|100k --stock-condition all|exclude-managed|exclude-margin-100|only-margin-100|only-margin-40|only-margin-30|only-margin-20 --credit-condition all|a|b|c|d|e|all-financing --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
195
|
+
kiwoomcli domestic rankings orderbook-balance-spike --market kospi|kosdaq --side buy-balance|sell-balance --sort spike-quantity|spike-rate --interval <n> --volume 1k|5k|10k|50k|100k --stock-condition all|exclude-managed|exclude-margin-100|only-margin-100|only-margin-40|only-margin-30|only-margin-20 --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
196
|
+
kiwoomcli domestic rankings balance-rate-spike --market kospi|kosdaq --ratio buy-to-sell|sell-to-buy --interval <n> --volume 5k|10k|50k|100k --stock-condition all|exclude-managed|exclude-margin-100|only-margin-100|only-margin-40|only-margin-30|only-margin-20 --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
197
|
+
kiwoomcli domestic rankings volume-spike --market all|kospi|kosdaq --sort spike-quantity|spike-rate|drop-quantity|drop-rate --time-unit minute|previous-day --volume-condition <value> [--time <n>] --stock-condition <value> --price-condition <value> --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
198
|
+
kiwoomcli domestic rankings previous-change-rate --market all|kospi|kosdaq --sort rise-rate|rise-price|fall-rate|fall-price|flat --volume all|10k|50k|100k|150k|200k|300k|500k|1000k --stock-condition all|exclude-managed|exclude-preferred|exclude-managed-preferred|exclude-margin-100|only-margin-100|only-margin-40|only-margin-30|only-margin-20|exclude-liquidation|only-margin-50|only-margin-60|exclude-etf|exclude-spac|exclude-etf-etn --credit-condition all|a|b|c|d|e|all-financing --include-limit yes|no --price-condition all|under-1k|1k-2k|2k-5k|5k-10k|over-10k|over-1k|under-10k --amount-condition <value> --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
199
|
+
kiwoomcli domestic rankings list-fills --market all|kospi|kosdaq --sort rise-rate|rise-price|flat|fall-rate|fall-price|volume|upper-limit|lower-limit --volume all|1k|3k|5k|10k|50k|100k --stock-condition all|exclude-managed|exclude-preferred|exclude-managed-preferred|exclude-margin-100|only-margin-100|only-margin-40|only-margin-30|only-margin-20|exclude-liquidation|only-margin-50|only-margin-60|exclude-etf|exclude-spac|exclude-etf-etn --credit-condition all|a|b|c|d|exclude-overlimit|e|short|all-financing --price-condition all|under-1k|1k-2k|2k-5k|5k-10k|over-10k|over-1k|under-10k --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
200
|
+
kiwoomcli domestic rankings today-volume --market all|kospi|kosdaq --sort volume|turnover|amount --stock-condition <value> --credit-type all|all-financing|a|b|c|d|short --volume-condition <value> --price-condition <value> --amount-condition <value> --session all|regular|pre-open|after-hours --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
201
|
+
kiwoomcli domestic rankings previous-volume --market all|kospi|kosdaq --kind volume|amount --rank-from <n> --rank-to <n> --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
202
|
+
kiwoomcli domestic rankings amount --market all|kospi|kosdaq --include-managed yes|no --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
203
|
+
kiwoomcli domestic rankings credit-ratio --market all|kospi|kosdaq --volume-condition <value> --stock-condition all|exclude-managed|exclude-margin-100|only-margin-100|only-margin-40|only-margin-30|only-margin-20 --include-limit yes|no --credit-condition all|a|b|c|d|e|all-financing --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
204
|
+
kiwoomcli domestic rankings foreign-period-trades --market all|kospi|kosdaq --side net-sell|net-buy|net-trade --period today|previous|5d|10d|20d|60d --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
205
|
+
kiwoomcli domestic rankings foreign-continuous-net --market all|kospi|kosdaq --side net-sell|net-buy --base-date today|previous --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
206
|
+
kiwoomcli domestic rankings foreign-limit-usage --market all|kospi|kosdaq --period today|previous|5d|10d|20d|60d --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
207
|
+
kiwoomcli domestic rankings foreign-broker-trades --market all|kospi|kosdaq --period today|previous|5d|10d|20d|60d --side net-buy|net-sell|buy|sell --sort amount|quantity --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
208
|
+
kiwoomcli domestic rankings broker-by-stock --code <code> --from <yyyymmdd> --to <yyyymmdd> --side net-sell|net-buy [--period previous|5d|10d|20d|40d|60d|120d] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
209
|
+
kiwoomcli domestic rankings broker-trades --broker-code <value> --volume-condition <value> --side net-buy|net-sell --period previous|5d|10d|60d --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
210
|
+
kiwoomcli domestic rankings stock-main-brokers --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
211
|
+
kiwoomcli domestic rankings net-buy-brokers --code <code> [--from <yyyymmdd>] [--to <yyyymmdd>] --date-mode period|start-end --point today|previous [--period 5d|10d|20d|40d|60d|120d] --sort close|date [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
212
|
+
kiwoomcli domestic rankings top-exit-brokers --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
213
|
+
kiwoomcli domestic rankings same-net-trades --from <yyyymmdd> [--to <yyyymmdd>] --market all|kospi|kosdaq --side net-buy|net-sell --basis quantity|amount --unit share|thousand --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
214
|
+
kiwoomcli domestic rankings investor-intraday --side net-buy|net-sell --market all|kospi|kosdaq --investor foreign|foreign-broker|financial-investment|investment-trust|other-financial|bank|insurance|pension|state|other-corporate|institution [--basis amount|quantity] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
215
|
+
kiwoomcli domestic rankings after-hours-change-rate --market all|kospi|kosdaq --sort rise-rate|rise-price|fall-rate|fall-price|flat --stock-condition <value> --volume <value> --credit-condition all|a|b|c|d|exclude-overlimit|e|short|all-financing --amount-condition <value> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
216
|
+
kiwoomcli domestic rankings foreign-institution-trades --market all|kospi|kosdaq --basis amount|quantity --include-date yes|no [--date <yyyymmdd>] --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
217
|
+
kiwoomcli domestic sectors program --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
218
|
+
kiwoomcli domestic sectors investor-flows --market kospi|kosdaq --basis amount|quantity --exchange KRX|NXT|ALL [--date <yyyymmdd>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
219
|
+
kiwoomcli domestic sectors price --market kospi|kosdaq|kospi200 --code <sector-code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
220
|
+
kiwoomcli domestic sectors stocks --market kospi|kosdaq|kospi200 --code <sector-code> --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
221
|
+
kiwoomcli domestic sectors indices --code <sector-code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
222
|
+
kiwoomcli domestic sectors daily --market kospi|kosdaq|kospi200 --code <sector-code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
223
|
+
kiwoomcli domestic etfs info --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
224
|
+
kiwoomcli domestic etfs daily --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
225
|
+
kiwoomcli domestic etfs profit --code <code> --index-code <code> --period week|month|six-months|year [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
226
|
+
kiwoomcli domestic etfs list --tax-type all|tax-free|holding-tax|company|foreign|foreign-tax-free --nav-compare all|nav-gt-close|nav-lt-close --manager <code> --taxable all|taxable|tax-free --tracking-index <code> --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
227
|
+
kiwoomcli domestic etfs intraday-trend --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
228
|
+
kiwoomcli domestic etfs intraday-fills --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
229
|
+
kiwoomcli domestic etfs daily-fills --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
230
|
+
kiwoomcli domestic etfs nav --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
231
|
+
kiwoomcli domestic etfs foreign-trend --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
232
|
+
kiwoomcli domestic elws daily --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
233
|
+
kiwoomcli domestic elws balance --code <code> --date <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
234
|
+
kiwoomcli domestic elws conditions --issuer-code <code> --underlying-code <code> --right-type all|call|put|dc|dp|ex|early-call|early-put --lp-code <code> --sort none|rise-rate|rise-price|fall-rate|fall-price|volume|amount|days-left [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
235
|
+
kiwoomcli domestic elws sensitivity --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
236
|
+
kiwoomcli domestic elws price-move --direction rise|fall --time-unit minute|day --time <n> --volume all|10k|50k|100k|300k|500k|1000k --issuer-code <code> --underlying-code <code> --right-type all|call|put|dc|dp|ex|early-call|early-put --lp-code <code> --include-ended yes|no [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
237
|
+
kiwoomcli domestic elws broker-net --issuer-code <code> --volume all|5k|10k|50k|100k|500k|1000k --side net-buy|net-sell --period previous|5d|10d|40d|60d --include-ended yes|no [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
238
|
+
kiwoomcli domestic elws divergence --issuer-code <code> --underlying-code <code> --right-type all|call|put|dc|dp|ex|early-call|early-put --lp-code <code> --include-ended yes|no [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
239
|
+
kiwoomcli domestic elws change-rank --sort rise-rate|rise-price|fall-rate|fall-price --right-type all|call|put|dc|dp|early-call|early-put --include-ended yes|no [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
240
|
+
kiwoomcli domestic elws balance-rank --sort buy-balance|sell-balance --right-type all|call|put|dc|dp|early-call|early-put --include-ended yes|no [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
241
|
+
kiwoomcli domestic elws proximity --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
242
|
+
kiwoomcli domestic elws details --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
243
|
+
kiwoomcli domestic investors by-stock --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
244
|
+
kiwoomcli domestic investors lookup --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
245
|
+
kiwoomcli domestic investors trend --period recent|3d|5d|10d|20d|120d|range [--from <yyyymmdd>] [--to <yyyymmdd>] --market kospi|kosdaq --side net-buy --target stock|sector --basis amount|quantity --exchange KRX|NXT|ALL [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
246
|
+
kiwoomcli domestic investors gold-status [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
247
|
+
kiwoomcli domestic short-selling trend --code <code> --from <yyyymmdd> --to <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
248
|
+
kiwoomcli domestic securities-lending by-stock --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
249
|
+
kiwoomcli domestic securities-lending trend [--from <yyyymmdd>] [--to <yyyymmdd>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
250
|
+
kiwoomcli domestic securities-lending list --from <yyyymmdd> --market kospi|kosdaq [--to <yyyymmdd>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
251
|
+
kiwoomcli domestic securities-lending lookup --date <yyyymmdd> --market kospi|kosdaq [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
252
|
+
kiwoomcli domestic themes lookup --kind all|theme|stock --days <n> --sort profit-top|profit-bottom|change-top|change-bottom --exchange KRX|NXT|ALL [--code <code>] [--name <text>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
253
|
+
kiwoomcli domestic themes by-stock --code <code> --exchange KRX|NXT|ALL [--days <n>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
254
|
+
kiwoomcli domestic streams conditions-list [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
255
|
+
kiwoomcli domestic streams conditions-search [--seq <value>] --exchange KRX|NXT|ALL [--cont yes|no] [--next-key <value>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
256
|
+
kiwoomcli domestic streams conditions-subscribe [--seq <value>] --exchange KRX|NXT|ALL [--count <n>] [--duration <seconds>] [--check] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
257
|
+
kiwoomcli domestic streams conditions-unsubscribe [--seq <value>] [--exchange KRX|NXT|ALL] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
258
|
+
kiwoomcli domestic streams order-fills [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] [--code <value>] [--codes <codes>] [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
259
|
+
kiwoomcli domestic streams balance [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] [--code <value>] [--codes <codes>] [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
260
|
+
kiwoomcli domestic streams momentum [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
261
|
+
kiwoomcli domestic streams trades [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
262
|
+
kiwoomcli domestic streams best-quotes [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
263
|
+
kiwoomcli domestic streams orderbook [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
264
|
+
kiwoomcli domestic streams after-hours-orderbook [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
265
|
+
kiwoomcli domestic streams brokers [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
266
|
+
kiwoomcli domestic streams etf-nav [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
267
|
+
kiwoomcli domestic streams expected-fills [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
268
|
+
kiwoomcli domestic streams gold-conversion [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
269
|
+
kiwoomcli domestic streams sector-index [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
270
|
+
kiwoomcli domestic streams sector-change [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
271
|
+
kiwoomcli domestic streams stock-info [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
272
|
+
kiwoomcli domestic streams elw-theory [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
273
|
+
kiwoomcli domestic streams market-open [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] [--code <value>] [--codes <codes>] [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
274
|
+
kiwoomcli domestic streams elw-indicator [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
275
|
+
kiwoomcli domestic streams program-trades [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] (--code <value> | --codes <codes>) [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
276
|
+
kiwoomcli domestic streams vi [--action subscribe|unsubscribe] [--group <n>] [--refresh yes|no] [--code <value>] [--codes <codes>] [--count <n>] [--duration <seconds>] [--watch] [--check] [--named] [--output <path>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
277
|
+
kiwoomcli domestic accounts list [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
278
|
+
kiwoomcli domestic accounts daily-balance-return --date <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
279
|
+
kiwoomcli domestic accounts realized-profit-stock-daily [--code <code>] --date <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
280
|
+
kiwoomcli domestic accounts realized-profit-period-stock [--code <code>] --from <yyyymmdd> --to <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
281
|
+
kiwoomcli domestic accounts realized-profit-daily --from <yyyymmdd> --to <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
282
|
+
kiwoomcli domestic accounts realized-profit-today-detail --code <code> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
283
|
+
kiwoomcli domestic accounts return-rate --exchange ALL|KRX|NXT [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
284
|
+
kiwoomcli domestic accounts day-trading-log [--date <yyyymmdd>] --sell-scope same-day-buy-sell|all-sells --cash-credit all|cash|credit [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
285
|
+
kiwoomcli domestic accounts cash --cash-basis estimated|normal [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
286
|
+
kiwoomcli domestic accounts estimated-assets-daily --from <yyyymmdd> --to <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
287
|
+
kiwoomcli domestic accounts assets --include-delisted yes|no [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
288
|
+
kiwoomcli domestic accounts valuation --include-delisted yes|no --exchange KRX|NXT [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
289
|
+
kiwoomcli domestic accounts fill-balance --exchange KRX|NXT [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
290
|
+
kiwoomcli domestic accounts order-fill-detail [--date <yyyymmdd>] (--order order|reverse | --fill-status open|filled) --asset-kind all|stock|bond --side all|sell|buy [--code <code>] [--order-id <id>] --exchange ALL|KRX|NXT|SOR [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
291
|
+
kiwoomcli domestic accounts next-settlement [--settlement-id <value>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
292
|
+
kiwoomcli domestic accounts order-fill-status [--date <yyyymmdd>] --asset-kind all|stock|bond --market all|kospi|kosdaq|otcbb|ecn --side all|sell|buy --fill-status all|filled [--code <code>] [--order-id <id>] --exchange ALL|KRX|NXT|SOR [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
293
|
+
kiwoomcli domestic accounts credit-margin --code <code> [--price <price>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
294
|
+
kiwoomcli domestic accounts margin-details [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
295
|
+
kiwoomcli domestic accounts transaction-history --from <yyyymmdd> --to <yyyymmdd> --kind <value> [--code <value>] [--currency <value>] --product all|domestic-stock|fund|overseas-stock|financial-product [--overseas-exchange <value>] --exchange ALL|KRX|NXT [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
296
|
+
kiwoomcli domestic accounts daily-return-detail --from <yyyymmdd> --to <yyyymmdd> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
297
|
+
kiwoomcli domestic accounts today-status [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
298
|
+
kiwoomcli domestic accounts holdings --basis total|individual --exchange KRX|NXT [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
299
|
+
kiwoomcli domestic accounts gold-balance [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
300
|
+
kiwoomcli domestic accounts gold-cash [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
301
|
+
kiwoomcli domestic accounts gold-all-order-fills --date <yyyymmdd> [--order order|reverse] --market-deal <value> --asset-kind all|stock|bond --side all|sell|buy [--code <value>] [--order-id <id>] [--exchange ALL|KRX|NXT|SOR] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
302
|
+
kiwoomcli domestic accounts gold-order-fills [--date <yyyymmdd>] (--order order|reverse | --fill-status open|filled) --asset-kind all|stock|bond --side all|sell|buy [--code <value>] [--order-id <id>] --exchange ALL|KRX|NXT|SOR [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
303
|
+
kiwoomcli domestic accounts gold-transactions [--from <yyyymmdd>] [--to <yyyymmdd>] [--kind all|deposit-withdrawal|release|trade|buy|sell|deposit|withdrawal] [--code <value>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
304
|
+
kiwoomcli domestic accounts gold-open-orders --date <yyyymmdd> [--order order|reverse] --market-deal <value> --asset-kind all|stock|bond --side all|sell|buy [--code <value>] [--order-id <id>] [--exchange ALL|KRX|NXT|SOR] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
305
|
+
kiwoomcli domestic orders chance --code <code> --side sell|buy --price <price> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
306
|
+
kiwoomcli domestic orders margin --code <code> [--price <price>] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
307
|
+
kiwoomcli domestic orders list-open --stock-scope all|stock --side all|sell|buy [--code <code>] --exchange ALL|KRX|NXT [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
308
|
+
kiwoomcli domestic orders list-fills --stock-scope all|stock --side all|sell|buy [--code <code>] [--order-id <id>] --exchange ALL|KRX|NXT [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
309
|
+
kiwoomcli domestic orders open-detail --order-id <id> [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
310
|
+
kiwoomcli domestic orders buy [--exchange KRX|NXT|SOR] --code <code> --qty <n> [--price <price>] --order-type limit|market [--confirm] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
311
|
+
kiwoomcli domestic orders sell [--exchange KRX|NXT|SOR] --code <code> --qty <n> [--price <price>] --order-type limit|market [--confirm] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
312
|
+
kiwoomcli domestic orders modify [--exchange KRX|NXT|SOR] --order-id <id> --code <code> --qty <n> --price <price> [--confirm] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
313
|
+
kiwoomcli domestic orders cancel [--exchange KRX|NXT|SOR] --order-id <id> --code <code> --qty <n> [--confirm] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
314
|
+
kiwoomcli domestic orders credit-buy --exchange KRX|NXT|SOR --code <code> --qty <n> [--price <price>] --order-type limit|market|conditional-limit|after-hours-close|pre-open|after-hours-single|best-limit|top-priority|limit-ioc|market-ioc|best-ioc|limit-fok|market-fok|best-fok|stop-limit|mid|mid-ioc|mid-fok [--condition-price <price>] [--confirm] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
315
|
+
kiwoomcli domestic orders credit-sell --exchange KRX|NXT|SOR --code <code> --qty <n> [--price <price>] --order-type limit|market|conditional-limit|after-hours-close|pre-open|after-hours-single|best-limit|top-priority|limit-ioc|market-ioc|best-ioc|limit-fok|market-fok|best-fok|stop-limit|mid|mid-ioc|mid-fok --credit-deal financing|financing-all [--loan-date <yyyymmdd>] [--condition-price <price>] [--confirm] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
316
|
+
kiwoomcli domestic orders credit-modify --exchange KRX|NXT|SOR --order-id <id> --code <code> --qty <n> --price <price> [--condition-price <price>] [--confirm] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
317
|
+
kiwoomcli domestic orders credit-cancel --exchange KRX|NXT|SOR --order-id <id> --code <code> --qty <n> [--confirm] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
318
|
+
kiwoomcli domestic orders gold-buy --code <value> --qty <n> [--price <price>] --order-type limit|limit-ioc|limit-fok [--confirm] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
319
|
+
kiwoomcli domestic orders gold-sell --code <value> --qty <n> [--price <price>] --order-type limit|limit-ioc|limit-fok [--confirm] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
320
|
+
kiwoomcli domestic orders gold-modify --code <value> --order-id <id> --qty <n> --price <price> [--confirm] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
321
|
+
kiwoomcli domestic orders gold-cancel --order-id <id> --code <value> --qty <n> [--confirm] [--format pretty|json|jsonl|yaml] [--profile NAME | --mode demo|real]
|
|
322
|
+
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Design backlog / TODO command candidates:
|
|
326
|
+
|
|
327
|
+
These lines are not `coverage_status=planned` by themselves. They are retained
|
|
328
|
+
as design notes or TODO placeholders. Runtime-exposed commands are
|
|
329
|
+
listed in the implemented block above.
|
|
330
|
+
|
|
331
|
+
```sh
|
|
332
|
+
kiwoomcli domestic stocks search --query <text>
|
|
333
|
+
kiwoomcli domestic stocks financials --code <code>
|
|
334
|
+
kiwoomcli domestic stocks disclosures --code <code>
|
|
335
|
+
|
|
336
|
+
kiwoomcli domestic rankings list --kind <kind> --market <market>
|
|
337
|
+
|
|
338
|
+
kiwoomcli domestic etfs components --code <code>
|
|
339
|
+
kiwoomcli domestic etfs quotes --code <code>
|
|
340
|
+
|
|
341
|
+
kiwoomcli domestic investors by-market --market <market>
|
|
342
|
+
|
|
343
|
+
kiwoomcli domestic short-selling by-market --market <market>
|
|
344
|
+
|
|
345
|
+
kiwoomcli domestic accounts balance
|
|
346
|
+
kiwoomcli domestic accounts withdrawable
|
|
347
|
+
kiwoomcli domestic accounts profit
|
|
348
|
+
kiwoomcli domestic accounts positions
|
|
349
|
+
kiwoomcli domestic accounts executions
|
|
350
|
+
|
|
351
|
+
kiwoomcli domestic orders history --from <yyyymmdd> --to <yyyymmdd>
|
|
352
|
+
|
|
353
|
+
# Superseded by implemented stream commands above:
|
|
354
|
+
# kiwoomcli domestic streams quotes --code <code>
|
|
355
|
+
# kiwoomcli domestic streams orderbooks --code <code>
|
|
356
|
+
# kiwoomcli domestic streams order-events --account <alias>
|
|
357
|
+
# kiwoomcli domestic streams conditions
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
WebSocket stream commands output Kiwoom server messages only. For bounded
|
|
361
|
+
`--format pretty`/`json`/`yaml` runs, stdout is one list of received server
|
|
362
|
+
messages; `--format jsonl` streams one server message per line. `REG`, `REMOVE`,
|
|
363
|
+
and `SYSTEM` are control messages and may appear in stdout, but `--count`
|
|
364
|
+
counts only `REAL` data messages. Foreground stream commands also accept repeated
|
|
365
|
+
`--code`, comma-separated `--codes`, `--count`, `--duration`, `--watch`, `--check`, and
|
|
366
|
+
`--named`; prefer `--count`/`--duration` for bounded stream runs. Use
|
|
367
|
+
`--check` for a finite registration/collection run that exits successfully even
|
|
368
|
+
if no `REAL` tick arrives. CLI timeout/error explanations are written to stderr
|
|
369
|
+
and are not injected as synthetic JSON payloads.
|
|
370
|
+
With `--named`, only `REAL` frames are converted: `data[*].values` FID keys are
|
|
371
|
+
emitted under `data[*].data` using the built-in schema derived from the packaged
|
|
372
|
+
Kiwoom spec. Control frames remain raw, unknown FIDs are preserved under
|
|
373
|
+
`unknown`, and values stay strings.
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
kiwoomcli domestic streams trades --code 005930 --count 1 --named --format json
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
Stream commands run in the foreground. To capture a long-running subscription
|
|
380
|
+
without keeping the terminal attached, redirect `--output` (or stdout) to a file
|
|
381
|
+
and background the process with your OS tools instead of a built-in job manager:
|
|
382
|
+
|
|
383
|
+
```bash
|
|
384
|
+
# 계속 수신하며 이벤트를 파일에 기록
|
|
385
|
+
kiwoomcli domestic streams trades --codes 005930,000660 --watch --format jsonl --output trades.jsonl
|
|
386
|
+
|
|
387
|
+
# Linux/macOS: 터미널을 닫아도 유지 (nohup / tmux / systemd --user 등)
|
|
388
|
+
nohup kiwoomcli domestic streams trades --codes 005930,000660 --watch --format jsonl --output trades.jsonl &
|
|
389
|
+
|
|
390
|
+
# Windows PowerShell: 별도 프로세스로 분리
|
|
391
|
+
Start-Process kiwoom -ArgumentList 'streams trades --codes 005930,000660 --watch --format jsonl --output trades.jsonl'
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
The OS (shell job control, `nohup`, `tmux`, `systemd --user`, Windows 작업
|
|
395
|
+
스케줄러/`Start-Process`) already provides process detachment, supervision, and
|
|
396
|
+
restart, so the CLI does not ship its own job manager.
|
|
397
|
+
|
|
398
|
+
Condition search formulas are created and changed in Kiwoom Hero Moon HTS
|
|
399
|
+
(영웅문 HTS). The CLI only lists, selects, requests, subscribes to, and clears
|
|
400
|
+
conditions already saved in HTS.
|
|
401
|
+
|
|
402
|
+
Account identifiers are redacted by the CLI output layer for guarded
|
|
403
|
+
account/order reads and account/order streams. Order numbers (`ord_no`,
|
|
404
|
+
`orig_ord_no`, …) are NOT redacted: they are operational identifiers the user
|
|
405
|
+
needs to read from a buy/list response and pass to `orders modify`/`cancel`.
|
|
406
|
+
Redaction applies consistently to `pretty`, `json`, `jsonl`, and `yaml` and does
|
|
407
|
+
not expose configured account identifier fields.
|
|
408
|
+
Domestic order write commands (`orders buy/sell/modify/cancel`, `credit-*`,
|
|
409
|
+
`gold-*`) are `guarded`/`order_write`: without `--confirm` they show a short
|
|
410
|
+
미전송 주문 확인 message plus order summary and never call the order API, and with
|
|
411
|
+
`--confirm` they submit to the real endpoint. Order-type price rules are validated before any
|
|
412
|
+
submission path from `kiwoom_cli/maps/order_price_policies.csv`; for example,
|
|
413
|
+
`--order-type limit` requires `--price`, while `--order-type market` must not
|
|
414
|
+
include `--price`. Invalid order identifiers are returned before any submission
|
|
415
|
+
path.
|
|
416
|
+
Order writes select their auth target with `--profile`/`--mode` like other
|
|
417
|
+
runtime commands; verify them against the demo (모의투자) server, using a
|
|
418
|
+
separate account/`.env` for 금현물 where the demo account differs.
|
|
419
|
+
|
|
420
|
+
See [docs/cli/command-system.md](../docs/cli/command-system.md) for the CLI
|
|
421
|
+
command-system principles and
|
|
422
|
+
[docs/cli/feature-matrix.md](../docs/cli/feature-matrix.md) for the full
|
|
423
|
+
command matrix and implementation status.
|
|
424
|
+
|
|
425
|
+
## User-Facing Terminology
|
|
426
|
+
|
|
427
|
+
Keep CLI terms stable and hide Kiwoom source field names such as `stk_cd` in the
|
|
428
|
+
maps. Command context decides the concrete code type.
|
|
429
|
+
|
|
430
|
+
| Concept | Canonical option | Example | Notes |
|
|
431
|
+
| --- | --- | --- | --- |
|
|
432
|
+
| Stock, sector, theme, ETF, or ELW symbol code | `--code`, `-c` | `--code 005930` | Do not use `--sector-code`, `--theme-code`, or `--symbol` as canonical options. |
|
|
433
|
+
| Account selection | `--account` | `--account main` | Account/order commands should prefer a local alias over a raw account number. |
|
|
434
|
+
| Auth profile selection | `--profile` | `--profile demo-main` | Runtime/auth selection only; keep separate from `--account`. |
|
|
435
|
+
| Runtime mode | `--mode` | `--mode demo` | Choices: `demo`, `real`. |
|
|
436
|
+
| Market/exchange selector | `--market` | `--market kospi` | Choices come from maps/specs. |
|
|
437
|
+
| Search text | `--query` | `--query 삼성` | Search commands only. |
|
|
438
|
+
| Quantity | `--qty` | `--qty 10` | Accepted short form for order quantity. |
|
|
439
|
+
| Price | `--price` | `--price 70000` | Unit price or price condition. |
|
|
440
|
+
| Buy/sell side | `--side` | `--side buy` | Choices: `buy`, `sell`. |
|
|
441
|
+
| Order type | `--order-type` | `--order-type limit` | Choices must come from command maps. |
|
|
442
|
+
| Order identifier | `--order-id` | `--order-id 123` | Do not abbreviate safety-critical identifiers. |
|
|
443
|
+
| Original order identifier | `--orig-order-id` | `--orig-order-id 123` | Use for modify/cancel APIs when the spec requires an original order number. |
|
|
444
|
+
| Start date | `--from` | `--from 20250101` | Period queries. |
|
|
445
|
+
| End date | `--to` | `--to 20260528` | Period queries. |
|
|
446
|
+
| Single base date | `--date` | `--date 20260528` | Single-date queries. |
|
|
447
|
+
| Minute interval | `--interval` | `--interval 1` | Minute candles and similar interval queries. |
|
|
448
|
+
| Maximum result count | `--limit` | `--limit 200` | Prefer this over `--max-items` for new commands. |
|
|
449
|
+
| Output format | `--format` | `--format json` | Choices: `pretty`, `json`, `jsonl`, `yaml`. |
|
|
450
|
+
| Transform/extract path | `--transform` | `--transform data.items` | Add only after parser and redaction policy are approved. |
|
|
451
|
+
| Diagnostics | `--debug` | `--debug` | Must redact tokens and account numbers (order numbers are shown). |
|
|
452
|
+
| Condition search formula | `--seq` | `--seq 2` | Create or edit saved condition formulas in Kiwoom Hero Moon HTS; CLI uses saved formulas only. |
|
|
453
|
+
| Write confirmation | `--confirm` | `--confirm` | Candidate confirmation flag for order/transfer-like writes; final policy is decided per command group. |
|
|
454
|
+
|
|
455
|
+
Rules:
|
|
456
|
+
|
|
457
|
+
- Use `--code` whenever command context already identifies the code type.
|
|
458
|
+
- Keep Kiwoom source field names in `kiwoom_cli/maps/`, not in user help text.
|
|
459
|
+
- Abbreviate only common trading terms with low ambiguity, such as `--qty`.
|
|
460
|
+
- Do not abbreviate safety-critical terms such as `--account` or `--order-id`.
|
|
461
|
+
- Use the same date, output, pagination, mode, and profile options across all
|
|
462
|
+
command groups.
|
|
463
|
+
|
|
464
|
+
## Spec-Driven Development Rules
|
|
465
|
+
|
|
466
|
+
The CLI is curated, not raw-spec generated.
|
|
467
|
+
|
|
468
|
+
Use `kiwoomcli spec search` for discovery and fallback, but expose stable
|
|
469
|
+
user-facing operations as resource commands such as `stocks info`,
|
|
470
|
+
`accounts balance`, or `orders list-open`.
|
|
471
|
+
|
|
472
|
+
Rules:
|
|
473
|
+
|
|
474
|
+
- API IDs, paths, methods, required fields, and response fields must be validated
|
|
475
|
+
against `kiwoom_api_spec.json`.
|
|
476
|
+
- User-facing command names, friendly option names, output policy, pagination
|
|
477
|
+
policy, and safety policy must come from editable maps or explicit docs.
|
|
478
|
+
- Do not hide command behavior in Python handlers when a spec, map, or explicit
|
|
479
|
+
config can define it.
|
|
480
|
+
- Do not add or revive a broad public `kiwoom/apis/` wrapper layer.
|
|
481
|
+
- Do not import generated examples as stable public CLI APIs.
|
|
482
|
+
- Do not add example-local auth helpers such as `Examples/auth.py`,
|
|
483
|
+
`examples/auth.py`, or `kis_auth.py`.
|
|
484
|
+
- New CLI behavior must acquire runtime objects through the package facade:
|
|
485
|
+
`get_auth`, `get_client`, or `get_ws_client`.
|
|
486
|
+
- New implemented CLI behavior must update this README and the docs under
|
|
487
|
+
`docs/cli/` at the repo root.
|
|
488
|
+
|
|
489
|
+
Preferred runtime pattern:
|
|
490
|
+
|
|
491
|
+
```python
|
|
492
|
+
from kiwoom import get_client, get_ws_client
|
|
493
|
+
|
|
494
|
+
client = get_client(mode=args.mode, profile=args.profile)
|
|
495
|
+
response = client.fetch_page(api_id=api_id, path=path, body=body, method=method)
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
## Internal Layout
|
|
499
|
+
|
|
500
|
+
Current CLI implementation layout:
|
|
501
|
+
|
|
502
|
+
```text
|
|
503
|
+
kiwoom_cli/
|
|
504
|
+
main.py # router only: parse args, dispatch to args.handler, error funnel
|
|
505
|
+
arguments.py
|
|
506
|
+
executor.py
|
|
507
|
+
output.py
|
|
508
|
+
registry.py
|
|
509
|
+
safety.py
|
|
510
|
+
setup.py # setup command parser/handler + onboarding logic
|
|
511
|
+
doctor.py # doctor command parser/handler
|
|
512
|
+
order_confirmation.py
|
|
513
|
+
README.md
|
|
514
|
+
commands/ # one module per command group, each add_*_parser + handlers
|
|
515
|
+
auth.py
|
|
516
|
+
spec.py
|
|
517
|
+
accounts.py
|
|
518
|
+
candles.py
|
|
519
|
+
elws.py
|
|
520
|
+
etfs.py
|
|
521
|
+
investors.py
|
|
522
|
+
orderbooks.py
|
|
523
|
+
orders.py
|
|
524
|
+
quotes.py
|
|
525
|
+
rankings.py
|
|
526
|
+
securities_lending.py
|
|
527
|
+
short_selling.py
|
|
528
|
+
stocks.py
|
|
529
|
+
streams.py
|
|
530
|
+
themes.py
|
|
531
|
+
maps/
|
|
532
|
+
api_commands.csv
|
|
533
|
+
arguments.csv
|
|
534
|
+
README.md
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
Repo-internal validation/audit tooling lives outside the package under
|
|
538
|
+
`utils/audit/` and `utils/prove/`; CLI design docs live under `docs/cli/` at
|
|
539
|
+
the repo root. Neither ships in the wheel.
|
|
540
|
+
|
|
541
|
+
`api_commands.csv` must include every local API exactly once.
|
|
542
|
+
`coverage_status` records whether each row is `public`, `guarded`,
|
|
543
|
+
`preview-only`, or `planned`.
|
|
544
|
+
|
|
545
|
+
As additional domain commands are implemented, add small modules and maps:
|
|
546
|
+
|
|
547
|
+
```text
|
|
548
|
+
kiwoom_cli/
|
|
549
|
+
registry.py
|
|
550
|
+
arguments.py
|
|
551
|
+
executor.py
|
|
552
|
+
output.py
|
|
553
|
+
safety.py
|
|
554
|
+
commands/
|
|
555
|
+
accounts.py
|
|
556
|
+
stocks.py
|
|
557
|
+
quotes.py
|
|
558
|
+
orderbooks.py
|
|
559
|
+
candles.py
|
|
560
|
+
rankings.py
|
|
561
|
+
etfs.py
|
|
562
|
+
elws.py
|
|
563
|
+
investors.py
|
|
564
|
+
short_selling.py
|
|
565
|
+
securities_lending.py
|
|
566
|
+
themes.py
|
|
567
|
+
orders.py
|
|
568
|
+
streams.py
|
|
569
|
+
maps/
|
|
570
|
+
api_commands.csv
|
|
571
|
+
arguments.csv
|
|
572
|
+
output.csv
|
|
573
|
+
safety.csv
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
Domain modules should register command groups and delegate to shared execution.
|
|
577
|
+
They should not call `requests` directly, issue tokens directly, construct
|
|
578
|
+
ad-hoc request bodies, or bypass common safety checks.
|
|
579
|
+
|
|
580
|
+
## Docs Contract
|
|
581
|
+
|
|
582
|
+
The repo-root `docs/cli/` folder is intended to be good enough to publish as
|
|
583
|
+
command documentation or transform into an agent skill reference bundle.
|
|
584
|
+
|
|
585
|
+
Docs currently provided:
|
|
586
|
+
|
|
587
|
+
- [docs/cli/README.md](../docs/cli/README.md): docs index and status labels.
|
|
588
|
+
- [docs/cli/command-system.md](../docs/cli/command-system.md): the only
|
|
589
|
+
maintained CLI command-system principles document.
|
|
590
|
+
- [docs/cli/feature-matrix.md](../docs/cli/feature-matrix.md): resource groups,
|
|
591
|
+
command status, API candidates, auth, safety, and feature notes.
|
|
592
|
+
- [docs/cli/api-coverage.md](../docs/cli/api-coverage.md): local API counts and
|
|
593
|
+
coverage evidence.
|
|
594
|
+
- [docs/cli/command-contracts.md](../docs/cli/command-contracts.md):
|
|
595
|
+
command-by-command argument contracts, Kiwoom field mappings, and examples.
|
|
596
|
+
- [docs/cli/implementation-status.md](../docs/cli/implementation-status.md):
|
|
597
|
+
current implementation evidence and blocked real-call items.
|
|
598
|
+
- [docs/cli/types.md](../docs/cli/types.md): shared CLI types, validation
|
|
599
|
+
rules, choices, redaction types, and safety policies.
|
|
600
|
+
|
|
601
|
+
When maps exist, docs should be generated from maps plus `kiwoom_api_spec.json`
|
|
602
|
+
and then reviewed. Do not let docs drift from parser behavior.
|
|
603
|
+
|
|
604
|
+
Every implemented command must satisfy:
|
|
605
|
+
|
|
606
|
+
- `kiwoom <resource> <command> --help` renders the documented flags.
|
|
607
|
+
- The command appears in the feature matrix with status `Implemented`.
|
|
608
|
+
- Required request fields are validated against the spec.
|
|
609
|
+
- Output and redaction behavior is documented.
|
|
610
|
+
- Safety policy is explicit.
|
|
611
|
+
|
|
612
|
+
## Agent Reference Direction
|
|
613
|
+
|
|
614
|
+
Upbit's CLI is useful to agents because it has both a resource-shaped CLI and
|
|
615
|
+
focused reference files that define flags, types, examples, safety rules, setup,
|
|
616
|
+
output, and terminology.
|
|
617
|
+
|
|
618
|
+
Kiwoom should follow that pattern after the first domain commands are stable:
|
|
619
|
+
|
|
620
|
+
```text
|
|
621
|
+
.agents/skills/kiwoom/kiwoom/
|
|
622
|
+
SKILL.md
|
|
623
|
+
references/
|
|
624
|
+
setup.md
|
|
625
|
+
accounts.md
|
|
626
|
+
orders.md
|
|
627
|
+
stocks.md
|
|
628
|
+
quotes.md
|
|
629
|
+
orderbooks.md
|
|
630
|
+
candles.md
|
|
631
|
+
streams.md
|
|
632
|
+
output.md
|
|
633
|
+
glossary.md
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
Those references should be derived from the same maps and specs as the CLI docs,
|
|
637
|
+
not maintained as unrelated prose.
|
|
638
|
+
|
|
639
|
+
## Safety Rules
|
|
640
|
+
|
|
641
|
+
Order and transfer-like commands have real account side effects.
|
|
642
|
+
|
|
643
|
+
- Prefer `demo` mode during development and verification.
|
|
644
|
+
- Write commands must support preview/check workflows before submission.
|
|
645
|
+
- Order write confirmation policy is not finalized; the current candidate is a
|
|
646
|
+
single `--confirm` flag plus command-specific preview/check behavior.
|
|
647
|
+
- Deposit/withdraw execution commands are blocked until explicit spec support and
|
|
648
|
+
safety policy are approved.
|
|
649
|
+
- Do not prove behavior with mocks, fake clients, fake transports, replay logs,
|
|
650
|
+
cassettes, or simulated Kiwoom payloads.
|
|
651
|
+
- If credentials, network, or account-safety constraints block real
|
|
652
|
+
verification, report it as blocked/not-run.
|
|
653
|
+
- Never log or commit credentials, tokens, account numbers, order IDs, or
|
|
654
|
+
unsanitized real-call output.
|
|
655
|
+
|
|
656
|
+
## Verification
|
|
657
|
+
|
|
658
|
+
Static checks for CLI/doc changes:
|
|
659
|
+
|
|
660
|
+
```sh
|
|
661
|
+
.venv/bin/python -m compileall kiwoom kiwoom_cli Examples
|
|
662
|
+
kiwoomcli --help
|
|
663
|
+
kiwoomcli spec search ka10001 --limit 3
|
|
664
|
+
! rg -n "unittest\\.mock|MagicMock|\\bMock\\b|\\bpatch\\b|fake|stub|monkeypatch|cassette|replay" kiwoom kiwoom_cli Examples utils -g '!**/*.md' -g '!**/*.csv'
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
When command maps exist, add:
|
|
668
|
+
|
|
669
|
+
```sh
|
|
670
|
+
.venv/bin/python -m utils.audit.validate_maps
|
|
671
|
+
```
|