kiwoom-cli 1.1.3__tar.gz → 2.1.0__tar.gz
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_cli-2.1.0/LICENSE +90 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/PKG-INFO +49 -22
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/README.md +46 -18
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/__init__.py +1 -1
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/api_spec.py +35 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/commands/account.py +306 -86
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/commands/order.py +95 -30
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/commands/stock.py +103 -21
- kiwoom_cli-2.1.0/kiwoom_cli/commands/us/__init__.py +5 -0
- kiwoom_cli-2.1.0/kiwoom_cli/commands/us/_constants.py +31 -0
- kiwoom_cli-2.1.0/kiwoom_cli/commands/us/account_ops.py +14 -0
- kiwoom_cli-2.1.0/kiwoom_cli/commands/us/detect.py +80 -0
- kiwoom_cli-2.1.0/kiwoom_cli/commands/us/exchange.py +64 -0
- kiwoom_cli-2.1.0/kiwoom_cli/commands/us/order_ops.py +161 -0
- kiwoom_cli-2.1.0/kiwoom_cli/commands/us/stock_ops.py +107 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/config.py +60 -30
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/formatters.py +219 -2
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/main.py +33 -38
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli.egg-info/PKG-INFO +49 -22
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli.egg-info/SOURCES.txt +12 -3
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli.egg-info/requires.txt +0 -1
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/pyproject.toml +2 -3
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/tests/test_account.py +6 -6
- kiwoom_cli-2.1.0/tests/test_auth_cli.py +97 -0
- kiwoom_cli-2.1.0/tests/test_credentials.py +115 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/tests/test_migration.py +22 -21
- kiwoom_cli-2.1.0/tests/test_us.py +530 -0
- kiwoom_cli-2.1.0/tests/test_us_account.py +353 -0
- kiwoom_cli-1.1.3/LICENSE +0 -21
- kiwoom_cli-1.1.3/kiwoom_cli/secure_store.py +0 -133
- kiwoom_cli-1.1.3/tests/test_secure_store.py +0 -137
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/auth.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/client.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/commands/__init__.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/commands/_constants.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/commands/dashboard.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/commands/market.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/commands/stream.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/commands/watch.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/output.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli/streaming.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli.egg-info/dependency_links.txt +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli.egg-info/entry_points.txt +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/kiwoom_cli.egg-info/top_level.txt +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/setup.cfg +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/tests/test_auth.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/tests/test_cli.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/tests/test_client.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/tests/test_formatters.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/tests/test_formatters_property.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/tests/test_market.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/tests/test_order.py +0 -0
- {kiwoom_cli-1.1.3 → kiwoom_cli-2.1.0}/tests/test_stock.py +0 -0
kiwoom_cli-2.1.0/LICENSE
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
kiwoom-cli Source-Available License
|
|
2
|
+
Version 1.0
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2026 gejyn14
|
|
5
|
+
|
|
6
|
+
This license governs use of the accompanying software ("the Software"). By
|
|
7
|
+
using, copying, modifying, or distributing the Software, You accept this
|
|
8
|
+
license. If You do not accept it, do not use the Software.
|
|
9
|
+
|
|
10
|
+
Prior released versions of the Software that were distributed under the MIT
|
|
11
|
+
License remain available under the MIT License. This license applies to this
|
|
12
|
+
version and later versions distributed under it.
|
|
13
|
+
|
|
14
|
+
1. DEFINITIONS
|
|
15
|
+
|
|
16
|
+
"Licensor" means gejyn14, the copyright holder, reachable at
|
|
17
|
+
ge.jyn14@gmail.com.
|
|
18
|
+
|
|
19
|
+
"You" means the individual or entity exercising rights under this license.
|
|
20
|
+
|
|
21
|
+
"Individual" means a natural person acting on their own behalf and not on
|
|
22
|
+
behalf of, or for the benefit of, any organization.
|
|
23
|
+
|
|
24
|
+
"Organization" means any legal entity other than an Individual, including
|
|
25
|
+
companies, partnerships, nonprofits, government bodies, and any natural
|
|
26
|
+
person acting on behalf of or for the benefit of such an entity.
|
|
27
|
+
|
|
28
|
+
"Commercial License" means a separate written agreement purchased from the
|
|
29
|
+
Licensor granting an Organization rights beyond those in this license.
|
|
30
|
+
|
|
31
|
+
"For Profit" means any use in connection with, or in furtherance of, a
|
|
32
|
+
commercial or revenue-generating activity of an Organization.
|
|
33
|
+
|
|
34
|
+
"Modify" means to create a work based on the Software, and a "Modified
|
|
35
|
+
Version" is any such work.
|
|
36
|
+
|
|
37
|
+
2. GRANT FOR INDIVIDUALS
|
|
38
|
+
|
|
39
|
+
If You are an Individual, You are granted a perpetual, worldwide,
|
|
40
|
+
royalty-free right to use, copy, modify, and distribute the Software for any
|
|
41
|
+
purpose, including for Your own profit (for example, trading Your own
|
|
42
|
+
account), subject only to the attribution requirement in Section 5. You have
|
|
43
|
+
no obligation to disclose source code.
|
|
44
|
+
|
|
45
|
+
3. GRANT FOR ORGANIZATIONS — UNMODIFIED USE
|
|
46
|
+
|
|
47
|
+
If You are an Organization and You use the Software without modification For
|
|
48
|
+
Profit, You must obtain a Commercial License from the Licensor. Use for
|
|
49
|
+
internal evaluation, testing, or non-profit purposes is permitted without a
|
|
50
|
+
Commercial License, subject to the attribution requirement in Section 5.
|
|
51
|
+
|
|
52
|
+
4. GRANT FOR ORGANIZATIONS — MODIFIED USE
|
|
53
|
+
|
|
54
|
+
If You are an Organization and You use a Modified Version For Profit, You must
|
|
55
|
+
do EITHER (a) or (b):
|
|
56
|
+
|
|
57
|
+
(a) Obtain a Commercial License from the Licensor, in which case You may
|
|
58
|
+
keep Your Modified Version's source code closed to the public; OR
|
|
59
|
+
|
|
60
|
+
(b) Publish the complete source code of Your entire work incorporating the
|
|
61
|
+
Software to the public under this same license.
|
|
62
|
+
|
|
63
|
+
In BOTH cases — whether or not You have purchased a Commercial License — You
|
|
64
|
+
must deliver the complete source code of Your Modified Version to the
|
|
65
|
+
Licensor at ge.jyn14@gmail.com promptly upon first use For Profit and upon
|
|
66
|
+
each subsequent material change.
|
|
67
|
+
|
|
68
|
+
5. ATTRIBUTION
|
|
69
|
+
|
|
70
|
+
All copies or substantial portions of the Software, and all distributions of
|
|
71
|
+
Modified Versions, must retain this license, the above copyright notice, and
|
|
72
|
+
a notice identifying gejyn14 as the original author.
|
|
73
|
+
|
|
74
|
+
6. TERMINATION
|
|
75
|
+
|
|
76
|
+
Any use in breach of this license automatically terminates Your rights under
|
|
77
|
+
it. Rights may be reinstated by the Licensor in writing.
|
|
78
|
+
|
|
79
|
+
7. DISCLAIMER OF WARRANTY AND LIMITATION OF LIABILITY
|
|
80
|
+
|
|
81
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
82
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
83
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
84
|
+
LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
85
|
+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
86
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
87
|
+
|
|
88
|
+
8. COMMERCIAL LICENSES
|
|
89
|
+
|
|
90
|
+
For commercial licensing, contact ge.jyn14@gmail.com.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kiwoom-cli
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: User-friendly CLI for the Kiwoom Securities REST API (키움증권)
|
|
5
|
-
License:
|
|
5
|
+
License: LicenseRef-kiwoom-cli-Source-Available-1.0
|
|
6
6
|
Project-URL: Homepage, https://github.com/gejyn14/kiwoom-cli
|
|
7
7
|
Project-URL: Repository, https://github.com/gejyn14/kiwoom-cli
|
|
8
8
|
Project-URL: Issues, https://github.com/gejyn14/kiwoom-cli/issues
|
|
@@ -10,7 +10,7 @@ Keywords: kiwoom,stock,trading,cli,korea,finance
|
|
|
10
10
|
Classifier: Development Status :: 5 - Production/Stable
|
|
11
11
|
Classifier: Environment :: Console
|
|
12
12
|
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
13
|
-
Classifier: License ::
|
|
13
|
+
Classifier: License :: Other/Proprietary License
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -26,7 +26,6 @@ Requires-Dist: tomli>=2.0; python_version < "3.11"
|
|
|
26
26
|
Requires-Dist: tomli-w>=1.0
|
|
27
27
|
Requires-Dist: keyring>=25.0
|
|
28
28
|
Requires-Dist: websockets>=12.0
|
|
29
|
-
Requires-Dist: cryptography>=42.0
|
|
30
29
|
Provides-Extra: dev
|
|
31
30
|
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
32
31
|
Requires-Dist: pytest-httpx>=0.30; extra == "dev"
|
|
@@ -55,13 +54,13 @@ pip install kiwoom-cli
|
|
|
55
54
|
## 시작하기
|
|
56
55
|
|
|
57
56
|
```bash
|
|
58
|
-
# 1. 초기 설정 (appkey, secretkey 입력
|
|
57
|
+
# 1. 초기 설정 (appkey, secretkey 입력)
|
|
59
58
|
kiwoom config setup
|
|
60
59
|
|
|
61
|
-
# 2. 토큰 발급
|
|
60
|
+
# 2. 토큰 발급
|
|
62
61
|
kiwoom auth login
|
|
63
62
|
|
|
64
|
-
# 3. 사용 (
|
|
63
|
+
# 3. 사용 (프롬프트 없음)
|
|
65
64
|
kiwoom stock info 005930
|
|
66
65
|
```
|
|
67
66
|
|
|
@@ -87,7 +86,7 @@ export KIWOOM_DOMAIN="prod" # prod 또는 mock
|
|
|
87
86
|
export KIWOOM_ACCOUNT="1234567" # 선택
|
|
88
87
|
```
|
|
89
88
|
|
|
90
|
-
appkey/secretkey는 보안을 위해 환경변수를 지원하지 않습니다. 반드시 `kiwoom config setup`으로
|
|
89
|
+
appkey/secretkey는 보안을 위해 환경변수를 지원하지 않습니다. 반드시 `kiwoom config setup`으로 OS 키체인에 저장하세요.
|
|
91
90
|
|
|
92
91
|
### 멀티 프로필
|
|
93
92
|
|
|
@@ -261,6 +260,29 @@ kiwoom account orderable amount 005930 --side buy --price 70000
|
|
|
261
260
|
|
|
262
261
|
---
|
|
263
262
|
|
|
263
|
+
## 미국주식 (US Stocks)
|
|
264
|
+
|
|
265
|
+
티커를 입력하면 자동으로 미국 시장으로 라우팅됩니다 (6자리 숫자 = 국내, 알파벳 = 미국).
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
kiwoom order buy NVDA 10 --price 213.04 # 매수 (거래소 자동 판별)
|
|
269
|
+
kiwoom order sell NVDA 5 --type stop-limit --price 200.5 --stop 199.99 --confirm
|
|
270
|
+
kiwoom stock price NVDA # 현재가
|
|
271
|
+
kiwoom stock chart day NVDA --base-date 20260701 # 일봉
|
|
272
|
+
kiwoom stock search apple --market us # 종목 검색
|
|
273
|
+
kiwoom account balance # 국내+미국 통합 잔고 (원화 총계)
|
|
274
|
+
kiwoom account balance --market us # 미국만
|
|
275
|
+
kiwoom account exchange rate # 환율
|
|
276
|
+
kiwoom account exchange apply 1000000 --confirm # 원화 → 달러 환전
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
- 거래소(`--exchange nasdaq|nyse|amex`)는 자동 판별되며, 복수 상장 종목만 직접 지정이 필요합니다.
|
|
280
|
+
- 미국 주문 유형: limit/market/vwap/twap/vwap-limit/twap-limit/loc (매수·매도), moc/stop/stop-limit (매도 전용).
|
|
281
|
+
- 정정은 가격만 가능(전량), 취소는 전량 취소만 지원됩니다 (키움 API 제약).
|
|
282
|
+
- 계좌 조회 명령(`balance/deposit/pnl/orders/history`)은 기본 통합 표시이며 `--market kr|us`로 필터링합니다.
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
264
286
|
## order - 주문
|
|
265
287
|
|
|
266
288
|
모든 주문에 `--confirm` 필수.
|
|
@@ -279,8 +301,8 @@ kiwoom order credit sell 005930 10 --type market --confirm
|
|
|
279
301
|
|
|
280
302
|
# 금현물
|
|
281
303
|
kiwoom order gold buy M04020000 1 --type market --confirm
|
|
282
|
-
kiwoom order gold balance
|
|
283
|
-
kiwoom order gold pending
|
|
304
|
+
kiwoom order gold balance # 잔고
|
|
305
|
+
kiwoom order gold pending # 미체결
|
|
284
306
|
|
|
285
307
|
# 조건검색
|
|
286
308
|
kiwoom order condition list
|
|
@@ -449,7 +471,7 @@ eval (env _KIWOOM_COMPLETE=fish_source kiwoom)
|
|
|
449
471
|
| 항목 | 값 |
|
|
450
472
|
| ---------------- | ---------------------------------------- |
|
|
451
473
|
| 설정 파일 | `~/.kiwoom/config.toml` (도메인, 계좌만) |
|
|
452
|
-
| appkey/secretkey | OS 키체인
|
|
474
|
+
| appkey/secretkey | OS 키체인 |
|
|
453
475
|
| 토큰 | OS 키체인 |
|
|
454
476
|
| 캐시 디렉터리 | `~/.kiwoom/cache/` |
|
|
455
477
|
| 운영 도메인 | `https://api.kiwoom.com` |
|
|
@@ -464,19 +486,24 @@ eval (env _KIWOOM_COMPLETE=fish_source kiwoom)
|
|
|
464
486
|
|
|
465
487
|
## 보안
|
|
466
488
|
|
|
467
|
-
인증정보(appkey, secretkey)는 **OS
|
|
489
|
+
모든 인증정보(appkey, secretkey, 토큰)는 **OS 키체인**(macOS Keychain / Windows Credential Manager / Linux Secret Service)에 저장됩니다. 파일로 존재하지 않으며, 키체인이 디스크 저장 시 암호화를 담당합니다. `gh`, `aws`, `docker` CLI와 동일한 모델입니다.
|
|
468
490
|
|
|
469
|
-
| 항목 | 저장 방식 |
|
|
470
|
-
| ------------------ | ------------------ |
|
|
471
|
-
| appkey / secretkey |
|
|
472
|
-
| 토큰 | OS 키체인
|
|
473
|
-
| config.toml | 도메인, 계좌번호만 |
|
|
491
|
+
| 항목 | 저장 방식 | 프롬프트 |
|
|
492
|
+
| ------------------ | ------------------ | :------: |
|
|
493
|
+
| appkey / secretkey | OS 키체인 | X |
|
|
494
|
+
| 토큰 | OS 키체인 | X |
|
|
495
|
+
| config.toml | 도메인, 계좌번호만 | X |
|
|
474
496
|
|
|
475
|
-
-
|
|
476
|
-
-
|
|
477
|
-
-
|
|
478
|
-
- `keyring.get_password()`로 직접 접근해도 암호화된 값만 반환
|
|
497
|
+
- 모든 명령어는 비밀번호/생체인증 프롬프트 없이 동작 (AI 에이전트·자동화 친화적)
|
|
498
|
+
- 앱 자체 암호화 계층은 의도적으로 두지 않음 — 추가 계층은 명령마다 잠금 해제 프롬프트를 요구하게 되어 CLI 사용성을 해침
|
|
499
|
+
- v2.0 이하에서 업그레이드한 경우: 암호화 저장소 형식이 제거되어 `kiwoom config setup`을 한 번 다시 실행해야 합니다
|
|
479
500
|
|
|
480
501
|
## License
|
|
481
502
|
|
|
482
|
-
|
|
503
|
+
kiwoom-cli **Source-Available License, Version 1.0** — see [LICENSE](LICENSE).
|
|
504
|
+
|
|
505
|
+
- **Individuals** (natural persons, on their own behalf): free to use, modify, and distribute for any purpose, including profit (e.g. trading your own account). Attribution only; no source-disclosure obligation.
|
|
506
|
+
- **Organizations, unmodified use for profit**: require a commercial license.
|
|
507
|
+
- **Organizations, modified use for profit**: either buy a commercial license (source may stay closed) or publish your entire codebase under this same license — and in both cases deliver the full modified source to the Licensor.
|
|
508
|
+
|
|
509
|
+
Versions released before v2.0 remain available under the MIT License. For commercial licensing, contact ge.jyn14@gmail.com — see [COMMERCIAL.md](COMMERCIAL.md).
|
|
@@ -17,13 +17,13 @@ pip install kiwoom-cli
|
|
|
17
17
|
## 시작하기
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
# 1. 초기 설정 (appkey, secretkey 입력
|
|
20
|
+
# 1. 초기 설정 (appkey, secretkey 입력)
|
|
21
21
|
kiwoom config setup
|
|
22
22
|
|
|
23
|
-
# 2. 토큰 발급
|
|
23
|
+
# 2. 토큰 발급
|
|
24
24
|
kiwoom auth login
|
|
25
25
|
|
|
26
|
-
# 3. 사용 (
|
|
26
|
+
# 3. 사용 (프롬프트 없음)
|
|
27
27
|
kiwoom stock info 005930
|
|
28
28
|
```
|
|
29
29
|
|
|
@@ -49,7 +49,7 @@ export KIWOOM_DOMAIN="prod" # prod 또는 mock
|
|
|
49
49
|
export KIWOOM_ACCOUNT="1234567" # 선택
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
appkey/secretkey는 보안을 위해 환경변수를 지원하지 않습니다. 반드시 `kiwoom config setup`으로
|
|
52
|
+
appkey/secretkey는 보안을 위해 환경변수를 지원하지 않습니다. 반드시 `kiwoom config setup`으로 OS 키체인에 저장하세요.
|
|
53
53
|
|
|
54
54
|
### 멀티 프로필
|
|
55
55
|
|
|
@@ -223,6 +223,29 @@ kiwoom account orderable amount 005930 --side buy --price 70000
|
|
|
223
223
|
|
|
224
224
|
---
|
|
225
225
|
|
|
226
|
+
## 미국주식 (US Stocks)
|
|
227
|
+
|
|
228
|
+
티커를 입력하면 자동으로 미국 시장으로 라우팅됩니다 (6자리 숫자 = 국내, 알파벳 = 미국).
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
kiwoom order buy NVDA 10 --price 213.04 # 매수 (거래소 자동 판별)
|
|
232
|
+
kiwoom order sell NVDA 5 --type stop-limit --price 200.5 --stop 199.99 --confirm
|
|
233
|
+
kiwoom stock price NVDA # 현재가
|
|
234
|
+
kiwoom stock chart day NVDA --base-date 20260701 # 일봉
|
|
235
|
+
kiwoom stock search apple --market us # 종목 검색
|
|
236
|
+
kiwoom account balance # 국내+미국 통합 잔고 (원화 총계)
|
|
237
|
+
kiwoom account balance --market us # 미국만
|
|
238
|
+
kiwoom account exchange rate # 환율
|
|
239
|
+
kiwoom account exchange apply 1000000 --confirm # 원화 → 달러 환전
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
- 거래소(`--exchange nasdaq|nyse|amex`)는 자동 판별되며, 복수 상장 종목만 직접 지정이 필요합니다.
|
|
243
|
+
- 미국 주문 유형: limit/market/vwap/twap/vwap-limit/twap-limit/loc (매수·매도), moc/stop/stop-limit (매도 전용).
|
|
244
|
+
- 정정은 가격만 가능(전량), 취소는 전량 취소만 지원됩니다 (키움 API 제약).
|
|
245
|
+
- 계좌 조회 명령(`balance/deposit/pnl/orders/history`)은 기본 통합 표시이며 `--market kr|us`로 필터링합니다.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
226
249
|
## order - 주문
|
|
227
250
|
|
|
228
251
|
모든 주문에 `--confirm` 필수.
|
|
@@ -241,8 +264,8 @@ kiwoom order credit sell 005930 10 --type market --confirm
|
|
|
241
264
|
|
|
242
265
|
# 금현물
|
|
243
266
|
kiwoom order gold buy M04020000 1 --type market --confirm
|
|
244
|
-
kiwoom order gold balance
|
|
245
|
-
kiwoom order gold pending
|
|
267
|
+
kiwoom order gold balance # 잔고
|
|
268
|
+
kiwoom order gold pending # 미체결
|
|
246
269
|
|
|
247
270
|
# 조건검색
|
|
248
271
|
kiwoom order condition list
|
|
@@ -411,7 +434,7 @@ eval (env _KIWOOM_COMPLETE=fish_source kiwoom)
|
|
|
411
434
|
| 항목 | 값 |
|
|
412
435
|
| ---------------- | ---------------------------------------- |
|
|
413
436
|
| 설정 파일 | `~/.kiwoom/config.toml` (도메인, 계좌만) |
|
|
414
|
-
| appkey/secretkey | OS 키체인
|
|
437
|
+
| appkey/secretkey | OS 키체인 |
|
|
415
438
|
| 토큰 | OS 키체인 |
|
|
416
439
|
| 캐시 디렉터리 | `~/.kiwoom/cache/` |
|
|
417
440
|
| 운영 도메인 | `https://api.kiwoom.com` |
|
|
@@ -426,19 +449,24 @@ eval (env _KIWOOM_COMPLETE=fish_source kiwoom)
|
|
|
426
449
|
|
|
427
450
|
## 보안
|
|
428
451
|
|
|
429
|
-
인증정보(appkey, secretkey)는 **OS
|
|
452
|
+
모든 인증정보(appkey, secretkey, 토큰)는 **OS 키체인**(macOS Keychain / Windows Credential Manager / Linux Secret Service)에 저장됩니다. 파일로 존재하지 않으며, 키체인이 디스크 저장 시 암호화를 담당합니다. `gh`, `aws`, `docker` CLI와 동일한 모델입니다.
|
|
430
453
|
|
|
431
|
-
| 항목 | 저장 방식 |
|
|
432
|
-
| ------------------ | ------------------ |
|
|
433
|
-
| appkey / secretkey |
|
|
434
|
-
| 토큰 | OS 키체인
|
|
435
|
-
| config.toml | 도메인, 계좌번호만 |
|
|
454
|
+
| 항목 | 저장 방식 | 프롬프트 |
|
|
455
|
+
| ------------------ | ------------------ | :------: |
|
|
456
|
+
| appkey / secretkey | OS 키체인 | X |
|
|
457
|
+
| 토큰 | OS 키체인 | X |
|
|
458
|
+
| config.toml | 도메인, 계좌번호만 | X |
|
|
436
459
|
|
|
437
|
-
-
|
|
438
|
-
-
|
|
439
|
-
-
|
|
440
|
-
- `keyring.get_password()`로 직접 접근해도 암호화된 값만 반환
|
|
460
|
+
- 모든 명령어는 비밀번호/생체인증 프롬프트 없이 동작 (AI 에이전트·자동화 친화적)
|
|
461
|
+
- 앱 자체 암호화 계층은 의도적으로 두지 않음 — 추가 계층은 명령마다 잠금 해제 프롬프트를 요구하게 되어 CLI 사용성을 해침
|
|
462
|
+
- v2.0 이하에서 업그레이드한 경우: 암호화 저장소 형식이 제거되어 `kiwoom config setup`을 한 번 다시 실행해야 합니다
|
|
441
463
|
|
|
442
464
|
## License
|
|
443
465
|
|
|
444
|
-
|
|
466
|
+
kiwoom-cli **Source-Available License, Version 1.0** — see [LICENSE](LICENSE).
|
|
467
|
+
|
|
468
|
+
- **Individuals** (natural persons, on their own behalf): free to use, modify, and distribute for any purpose, including profit (e.g. trading your own account). Attribution only; no source-disclosure obligation.
|
|
469
|
+
- **Organizations, unmodified use for profit**: require a commercial license.
|
|
470
|
+
- **Organizations, modified use for profit**: either buy a commercial license (source may stay closed) or publish your entire codebase under this same license — and in both cases deliver the full modified source to the Licensor.
|
|
471
|
+
|
|
472
|
+
Versions released before v2.0 remain available under the MIT License. For commercial licensing, contact ge.jyn14@gmail.com — see [COMMERCIAL.md](COMMERCIAL.md).
|
|
@@ -212,6 +212,41 @@ API_REGISTRY: dict[str, tuple[str, str]] = {
|
|
|
212
212
|
"ka10172": ("/api/dostk/websocket", "조건검색 요청 일반"),
|
|
213
213
|
"ka10173": ("/api/dostk/websocket", "조건검색 요청 실시간"),
|
|
214
214
|
"ka10174": ("/api/dostk/websocket", "조건검색 실시간 해제"),
|
|
215
|
+
# === 미국주식 주문 (US Orders) ===
|
|
216
|
+
"ust20000": ("/api/us/ordr", "미국주식 매수 주문"),
|
|
217
|
+
"ust20001": ("/api/us/ordr", "미국주식 매도 주문"),
|
|
218
|
+
"ust20002": ("/api/us/ordr", "미국주식 정정 주문"),
|
|
219
|
+
"ust20003": ("/api/us/ordr", "미국주식 취소 주문"),
|
|
220
|
+
"ust31490": ("/api/us/ordr", "미국주식 주문가능수량"),
|
|
221
|
+
# === 미국주식 계좌 (US Account) ===
|
|
222
|
+
"ust21070": ("/api/us/acnt", "미국주식 원장잔고확인"),
|
|
223
|
+
"ust21160": ("/api/us/acnt", "미국주식 예수금 상세"),
|
|
224
|
+
"ust21110": ("/api/us/acnt", "해외주식 예수금"),
|
|
225
|
+
"ust21530": ("/api/us/acnt", "미국주식 실현손익"),
|
|
226
|
+
"ust21170": ("/api/us/acnt", "미국주식 당일 종목별 실현손익"),
|
|
227
|
+
"ust21050": ("/api/us/acnt", "미국주식 원장 미체결"),
|
|
228
|
+
"ust21150": ("/api/us/acnt", "미국주식 일별 주문체결내역"),
|
|
229
|
+
"ust21510": ("/api/us/acnt", "미국주식 당일 주문체결 확인"),
|
|
230
|
+
"ust21180": ("/api/us/acnt", "미국주식 기간별 주문내역"),
|
|
231
|
+
"ust21100": ("/api/us/acnt", "미국주식 거래내역"),
|
|
232
|
+
# === 미국주식 종목정보 (US Stock Info) ===
|
|
233
|
+
"usa10098": ("/api/us/stkinfo", "미국주식 거래소구분 조회"),
|
|
234
|
+
"usa10099": ("/api/us/stkinfo", "미국주식 종목리스트"),
|
|
235
|
+
"usa10100": ("/api/us/stkinfo", "미국주식 종목 조회"),
|
|
236
|
+
# === 미국주식 시세 (US Quotes) ===
|
|
237
|
+
"usa20100": ("/api/us/mrkcond", "미국주식 현재가 종목정보"),
|
|
238
|
+
"usa20101": ("/api/us/mrkcond", "미국주식 현재가 10호가"),
|
|
239
|
+
# === 미국주식 차트 (US Charts) ===
|
|
240
|
+
"usa06010": ("/api/us/chart", "미국주식 틱 차트"),
|
|
241
|
+
"usa06011": ("/api/us/chart", "미국주식 분 차트"),
|
|
242
|
+
"usa06012": ("/api/us/chart", "미국주식 일 차트"),
|
|
243
|
+
"usa06013": ("/api/us/chart", "미국주식 주 차트"),
|
|
244
|
+
"usa06014": ("/api/us/chart", "미국주식 월 차트"),
|
|
245
|
+
"usa06015": ("/api/us/chart", "미국주식 년 차트"),
|
|
246
|
+
# === 환전 (FX) ===
|
|
247
|
+
"ust31300": ("/api/us/exchange", "환전 예상 금액 조회"),
|
|
248
|
+
"ust31301": ("/api/us/exchange", "환율 조회"),
|
|
249
|
+
"ust31302": ("/api/us/exchange", "환전 신청"),
|
|
215
250
|
}
|
|
216
251
|
|
|
217
252
|
|