@k-msg/cli 0.6.0 → 0.6.2
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.
- package/CHANGELOG.md +16 -0
- package/README.md +70 -11
- package/package.json +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @k-msg/cli
|
|
2
2
|
|
|
3
|
+
## 0.6.2 — 2026-02-19
|
|
4
|
+
|
|
5
|
+
### Patch changes
|
|
6
|
+
|
|
7
|
+
- [7797dc8](https://github.com/k-otp/k-msg/commit/7797dc8dacc4024a2b825fe46c6f266e271e822d) - Fix provider balance CLI exit code semantics: return exit code 3 only for provider errors and 4 when capability is unsupported.
|
|
8
|
+
- Update CLI/README docs to use the correct `providers list --config ...` usage and clarify capability-not-supported exit code.
|
|
9
|
+
- Add GitHub repository button to docs home pages (KO/EN). — Thanks @imjlk!
|
|
10
|
+
|
|
11
|
+
## 0.6.1 — 2026-02-18
|
|
12
|
+
|
|
13
|
+
### Patch changes
|
|
14
|
+
|
|
15
|
+
- [19e519f](https://github.com/k-otp/k-msg/commit/19e519f0edcb4f3a00d07f090046f30ac5c5e87b) Harden CLI/core reliability by making option parsing deterministic (`--flag`/`--no-flag` with strict boolean validation), aligning provider error payloads to `details`, and migrating the send contract field to `templateId` (without compatibility aliases) with matching docs/tests and canonical CI parity checks. — Thanks @imjlk!
|
|
16
|
+
- [aafac43](https://github.com/k-otp/k-msg/commit/aafac43c09c7b95a0a50af610662c91cbc4e6c76) Remove duplicated CLI provider config metadata by sourcing labels, routing seed types, and recommended defaults from `@k-msg/provider`. Also update template option wording to `Template ID` and fix root breaking-change notes to `templateCode -> templateId`. — Thanks @imjlk!
|
|
17
|
+
- Updated dependencies: core@0.18.2, messaging@0.18.2, provider@0.18.2, k-msg@0.18.2
|
|
18
|
+
|
|
3
19
|
## 0.6.0 — 2026-02-18
|
|
4
20
|
|
|
5
21
|
### Minor changes
|
package/README.md
CHANGED
|
@@ -94,9 +94,11 @@ Default config path:
|
|
|
94
94
|
Override:
|
|
95
95
|
|
|
96
96
|
```bash
|
|
97
|
-
k-msg --config /path/to/k-msg.config.json
|
|
97
|
+
k-msg providers list --config /path/to/k-msg.config.json
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
+
Note: `--config` is a subcommand option in the current CLI (for example: `providers`, `sms`, `alimtalk`).
|
|
101
|
+
|
|
100
102
|
Example file: `apps/cli/k-msg.config.example.json`
|
|
101
103
|
|
|
102
104
|
Schema URLs:
|
|
@@ -123,6 +125,50 @@ k-msg config provider add iwinv
|
|
|
123
125
|
Any string value like `"env:NAME"` is replaced with the `NAME` environment variable at runtime.
|
|
124
126
|
If the env var is missing/empty, commands that need runtime providers will fail with exit code `2`.
|
|
125
127
|
|
|
128
|
+
### Provider send value guide
|
|
129
|
+
|
|
130
|
+
When you are unsure which values must be prepared before send, use this checklist:
|
|
131
|
+
|
|
132
|
+
1. Configure provider credentials with `env:` references.
|
|
133
|
+
2. Run `k-msg providers doctor` to verify account/config readiness.
|
|
134
|
+
3. For AlimTalk, run `k-msg alimtalk preflight` with the provider/template/channel you will use.
|
|
135
|
+
4. Send only after preflight passes.
|
|
136
|
+
|
|
137
|
+
Credential examples:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Aligo
|
|
141
|
+
export ALIGO_API_KEY="..."
|
|
142
|
+
export ALIGO_USER_ID="..."
|
|
143
|
+
export ALIGO_SENDER_KEY="..." # Kakao senderKey
|
|
144
|
+
export ALIGO_SENDER="029302266" # SMS/LMS sender
|
|
145
|
+
|
|
146
|
+
# IWINV
|
|
147
|
+
export IWINV_API_KEY="..." # AlimTalk key
|
|
148
|
+
export IWINV_SMS_API_KEY="..." # SMS/LMS/MMS key
|
|
149
|
+
export IWINV_SMS_AUTH_KEY="..." # SMS/LMS/MMS secret
|
|
150
|
+
export IWINV_SMS_COMPANY_ID="..." # status/balance context
|
|
151
|
+
export IWINV_SENDER_NUMBER="029302266"
|
|
152
|
+
|
|
153
|
+
# SOLAPI
|
|
154
|
+
export SOLAPI_API_KEY="..."
|
|
155
|
+
export SOLAPI_API_SECRET="..."
|
|
156
|
+
export SOLAPI_DEFAULT_FROM="029302266"
|
|
157
|
+
export SOLAPI_KAKAO_PF_ID="..." # Kakao profileId(pfId)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Required values by provider/channel:
|
|
161
|
+
|
|
162
|
+
| Provider | Channel | Required config keys | Required send-time values | Notes |
|
|
163
|
+
| --- | --- | --- | --- | --- |
|
|
164
|
+
| `aligo` | `SMS/LMS/MMS` | `apiKey`, `userId` | `to`, `text`, sender (`--from` or `aligo.config.sender`) | MMS also needs image input |
|
|
165
|
+
| `aligo` | `ALIMTALK` | `apiKey`, `userId` | `to`, `template-id`, `vars`, senderKey (`--sender-key`/`--channel` alias/`aligo.config.senderKey`), sender (`--from` or `aligo.config.sender`) | `preflight` validates channel/template access |
|
|
166
|
+
| `iwinv` | `SMS/LMS/MMS` | `apiKey`, `smsApiKey`, `smsAuthKey` | `to`, `text`, sender (`--from` or `iwinv.config.smsSenderNumber`/`senderNumber`) | MMS requires image binary input |
|
|
167
|
+
| `iwinv` | `ALIMTALK` | `apiKey` | `to`, `template-id`, `vars` | If failover/reSend is enabled, sender callback is required (`--from` or sender number in config) |
|
|
168
|
+
| `solapi` | `SMS/LMS/MMS` | `apiKey`, `apiSecret` | `to`, `text`, sender (`--from` or `solapi.config.defaultFrom`) | MMS also needs image input |
|
|
169
|
+
| `solapi` | `ALIMTALK` | `apiKey`, `apiSecret` | `to`, `template-id`, `vars`, profileId/pfId (`--sender-key`/channel alias or `solapi.config.kakaoPfId`) | For preflight policy checks, set `plusId` via `--plus-id` or channel/default alias |
|
|
170
|
+
| `mock` | all | none | minimal message fields (`to`, `text` or `template-id`/`vars`) | Local test provider |
|
|
171
|
+
|
|
126
172
|
## Commands
|
|
127
173
|
|
|
128
174
|
- `k-msg config init|show|validate`
|
|
@@ -142,8 +188,8 @@ If the env var is missing/empty, commands that need runtime providers will fail
|
|
|
142
188
|
|
|
143
189
|
```bash
|
|
144
190
|
k-msg providers doctor
|
|
145
|
-
k-msg alimtalk preflight --provider iwinv --template-
|
|
146
|
-
k-msg alimtalk send --provider iwinv --template-
|
|
191
|
+
k-msg alimtalk preflight --provider iwinv --template-id TPL_001 --channel main
|
|
192
|
+
k-msg alimtalk send --provider iwinv --template-id TPL_001 --to 01012345678 --vars '{"name":"Jane"}'
|
|
147
193
|
```
|
|
148
194
|
|
|
149
195
|
Notes:
|
|
@@ -166,7 +212,7 @@ Terminology: the CLI uses **Kakao Channel** and **senderKey** (never “profile
|
|
|
166
212
|
```bash
|
|
167
213
|
k-msg alimtalk send \
|
|
168
214
|
--to 01012345678 \
|
|
169
|
-
--template-
|
|
215
|
+
--template-id TPL_001 \
|
|
170
216
|
--vars '{"name":"Jane"}' \
|
|
171
217
|
--channel main \
|
|
172
218
|
--plus-id @my_channel
|
|
@@ -177,7 +223,7 @@ Failover options:
|
|
|
177
223
|
```bash
|
|
178
224
|
k-msg alimtalk send \
|
|
179
225
|
--to 01012345678 \
|
|
180
|
-
--template-
|
|
226
|
+
--template-id TPL_001 \
|
|
181
227
|
--vars '{"name":"Jane"}' \
|
|
182
228
|
--failover true \
|
|
183
229
|
--fallback-channel sms \
|
|
@@ -192,7 +238,7 @@ When providers return send warnings (for example failover partial/unsupported),
|
|
|
192
238
|
```bash
|
|
193
239
|
k-msg alimtalk preflight \
|
|
194
240
|
--provider iwinv \
|
|
195
|
-
--template-
|
|
241
|
+
--template-id TPL_001 \
|
|
196
242
|
--channel main \
|
|
197
243
|
--sender-key your_sender_key \
|
|
198
244
|
--plus-id @my_channel
|
|
@@ -226,6 +272,18 @@ k-msg send --input '[{"to":"01011112222","text":"hello 1"},{"to":"01033334444","
|
|
|
226
272
|
- `k-msg providers doctor`: provider/account/capability readiness checks
|
|
227
273
|
- `k-msg send --dry-run`: request payload preview/validation (no provider send)
|
|
228
274
|
|
|
275
|
+
Boolean flag semantics (applies to `--json`, `--verbose`, `--dry-run`, `--stdin`, `--failover`, `--force`):
|
|
276
|
+
|
|
277
|
+
- `--flag` -> `true`
|
|
278
|
+
- `--flag true` -> `true`
|
|
279
|
+
- `--flag false` -> `false`
|
|
280
|
+
- `--no-flag` -> `false`
|
|
281
|
+
- Invalid boolean values (for example `--dry-run maybe`) fail with exit code `2`
|
|
282
|
+
|
|
283
|
+
Resolution precedence for overlapping values is:
|
|
284
|
+
|
|
285
|
+
- `CLI flag > environment variable > config file > built-in default`
|
|
286
|
+
|
|
229
287
|
## Kakao Channel (Aligo capability)
|
|
230
288
|
|
|
231
289
|
```bash
|
|
@@ -246,13 +304,13 @@ Channel scope (Aligo): use `--channel <alias>` or `--sender-key <value>`.
|
|
|
246
304
|
|
|
247
305
|
```bash
|
|
248
306
|
k-msg kakao template list
|
|
249
|
-
k-msg kakao template get --template-
|
|
307
|
+
k-msg kakao template get --template-id TPL_001
|
|
250
308
|
k-msg kakao template create --name "Welcome" --content "Hello #{name}" --channel main
|
|
251
|
-
k-msg kakao template update --template-
|
|
252
|
-
k-msg kakao template delete --template-
|
|
309
|
+
k-msg kakao template update --template-id TPL_001 --name "Updated"
|
|
310
|
+
k-msg kakao template delete --template-id TPL_001
|
|
253
311
|
|
|
254
312
|
# inspection request is provider-dependent (supported by Aligo)
|
|
255
|
-
k-msg kakao template request --template-
|
|
313
|
+
k-msg kakao template request --template-id TPL_001 --channel main
|
|
256
314
|
```
|
|
257
315
|
|
|
258
316
|
## Output / Exit Codes
|
|
@@ -262,11 +320,12 @@ k-msg kakao template request --template-code TPL_001 --channel main
|
|
|
262
320
|
when an agent is detected (`CLAUDECODE`, `CURSOR_AGENT`, `CODEX_CI` /
|
|
263
321
|
`CODEX_SHELL` / `CODEX_THREAD_ID`, `MCP_SERVER_NAME` / `MCP_SESSION_ID` /
|
|
264
322
|
`MCP_TOOL_NAME`)
|
|
323
|
+
- Force text output in AI environments with `--json false` (or `--no-json`)
|
|
265
324
|
- exit code:
|
|
266
325
|
- `0`: success
|
|
267
326
|
- `2`: input/config error
|
|
268
327
|
- `3`: provider/network error
|
|
269
|
-
- `4`: capability not
|
|
328
|
+
- `4`: unsupported capability (for example, provider does not support `balance`)
|
|
270
329
|
|
|
271
330
|
## Manual Check Config Example
|
|
272
331
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k-msg/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "k-msg CLI (prebuilt binaries via GitHub Releases)",
|
|
6
6
|
"type": "module",
|
|
@@ -26,21 +26,23 @@
|
|
|
26
26
|
"build:native": "bunli build --targets native",
|
|
27
27
|
"build:js": "bun run generate && bun build src/k-msg.ts --outdir=dist --format=esm --target=bun",
|
|
28
28
|
"dev": "bun run generate && bun --watch src/k-msg.ts",
|
|
29
|
+
"typecheck": "bun run generate && tsc --noEmit -p tsconfig.json",
|
|
29
30
|
"test": "bun run generate && bun test",
|
|
30
31
|
"schema:generate": "bun run scripts/generate-config-schema.ts",
|
|
31
32
|
"schema:check": "bun run scripts/generate-config-schema.ts --check",
|
|
32
33
|
"clean": "rm -rf dist"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
|
-
"@k-msg/core": "0.
|
|
36
|
-
"@k-msg/
|
|
36
|
+
"@k-msg/core": "0.18.2",
|
|
37
|
+
"@k-msg/messaging": "0.18.2",
|
|
38
|
+
"@k-msg/provider": "0.18.2",
|
|
37
39
|
"@bunli/core": "^0.5.4",
|
|
38
40
|
"@bunli/plugin-ai-detect": "^0.5.2",
|
|
39
41
|
"@bunli/test": "^0.3.2",
|
|
40
42
|
"@types/bun": "^1.3.9",
|
|
41
43
|
"@types/node": "^22.0.0",
|
|
42
44
|
"bunli": "^0.5.3",
|
|
43
|
-
"k-msg": "0.
|
|
45
|
+
"k-msg": "0.18.2",
|
|
44
46
|
"solapi": "^5.5.4",
|
|
45
47
|
"typescript": "^5.7.2",
|
|
46
48
|
"zod": "^4.0.14"
|