@k-msg/cli 0.5.8 → 0.6.1
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 +19 -0
- package/README.md +87 -10
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @k-msg/cli
|
|
2
2
|
|
|
3
|
+
## 0.6.1 — 2026-02-18
|
|
4
|
+
|
|
5
|
+
### Patch changes
|
|
6
|
+
|
|
7
|
+
- [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!
|
|
8
|
+
- [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!
|
|
9
|
+
- Updated dependencies: core@0.18.2, messaging@0.18.2, provider@0.18.2, k-msg@0.18.2
|
|
10
|
+
|
|
11
|
+
## 0.6.0 — 2026-02-18
|
|
12
|
+
|
|
13
|
+
### Minor changes
|
|
14
|
+
|
|
15
|
+
- [a63307e](https://github.com/k-otp/k-msg/commit/a63307eb4a925343b74297b8437f72caba587dff) Improve CLI send usability by clarifying raw-JSON advanced usage, adding `k-msg send --dry-run` preview mode (without provider send), and enhancing batch/error output guidance. — Thanks @imjlk!
|
|
16
|
+
- [48f2797](https://github.com/k-otp/k-msg/commit/48f27975b5734c760f5ec99701623865f28d8c8c) Feat: support batch sending via `k-msg send --input '[...]'` and persistence configuration (`strategy`, `repo`) in `k-msg.config.json`. — Thanks @imjlk!
|
|
17
|
+
|
|
18
|
+
### Patch changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies: core@0.18.1, provider@0.18.1, k-msg@0.18.1
|
|
21
|
+
|
|
3
22
|
## 0.5.8 — 2026-02-17
|
|
4
23
|
|
|
5
24
|
### Patch changes
|
package/README.md
CHANGED
|
@@ -123,6 +123,50 @@ k-msg config provider add iwinv
|
|
|
123
123
|
Any string value like `"env:NAME"` is replaced with the `NAME` environment variable at runtime.
|
|
124
124
|
If the env var is missing/empty, commands that need runtime providers will fail with exit code `2`.
|
|
125
125
|
|
|
126
|
+
### Provider send value guide
|
|
127
|
+
|
|
128
|
+
When you are unsure which values must be prepared before send, use this checklist:
|
|
129
|
+
|
|
130
|
+
1. Configure provider credentials with `env:` references.
|
|
131
|
+
2. Run `k-msg providers doctor` to verify account/config readiness.
|
|
132
|
+
3. For AlimTalk, run `k-msg alimtalk preflight` with the provider/template/channel you will use.
|
|
133
|
+
4. Send only after preflight passes.
|
|
134
|
+
|
|
135
|
+
Credential examples:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Aligo
|
|
139
|
+
export ALIGO_API_KEY="..."
|
|
140
|
+
export ALIGO_USER_ID="..."
|
|
141
|
+
export ALIGO_SENDER_KEY="..." # Kakao senderKey
|
|
142
|
+
export ALIGO_SENDER="029302266" # SMS/LMS sender
|
|
143
|
+
|
|
144
|
+
# IWINV
|
|
145
|
+
export IWINV_API_KEY="..." # AlimTalk key
|
|
146
|
+
export IWINV_SMS_API_KEY="..." # SMS/LMS/MMS key
|
|
147
|
+
export IWINV_SMS_AUTH_KEY="..." # SMS/LMS/MMS secret
|
|
148
|
+
export IWINV_SMS_COMPANY_ID="..." # status/balance context
|
|
149
|
+
export IWINV_SENDER_NUMBER="029302266"
|
|
150
|
+
|
|
151
|
+
# SOLAPI
|
|
152
|
+
export SOLAPI_API_KEY="..."
|
|
153
|
+
export SOLAPI_API_SECRET="..."
|
|
154
|
+
export SOLAPI_DEFAULT_FROM="029302266"
|
|
155
|
+
export SOLAPI_KAKAO_PF_ID="..." # Kakao profileId(pfId)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Required values by provider/channel:
|
|
159
|
+
|
|
160
|
+
| Provider | Channel | Required config keys | Required send-time values | Notes |
|
|
161
|
+
| --- | --- | --- | --- | --- |
|
|
162
|
+
| `aligo` | `SMS/LMS/MMS` | `apiKey`, `userId` | `to`, `text`, sender (`--from` or `aligo.config.sender`) | MMS also needs image input |
|
|
163
|
+
| `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 |
|
|
164
|
+
| `iwinv` | `SMS/LMS/MMS` | `apiKey`, `smsApiKey`, `smsAuthKey` | `to`, `text`, sender (`--from` or `iwinv.config.smsSenderNumber`/`senderNumber`) | MMS requires image binary input |
|
|
165
|
+
| `iwinv` | `ALIMTALK` | `apiKey` | `to`, `template-id`, `vars` | If failover/reSend is enabled, sender callback is required (`--from` or sender number in config) |
|
|
166
|
+
| `solapi` | `SMS/LMS/MMS` | `apiKey`, `apiSecret` | `to`, `text`, sender (`--from` or `solapi.config.defaultFrom`) | MMS also needs image input |
|
|
167
|
+
| `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 |
|
|
168
|
+
| `mock` | all | none | minimal message fields (`to`, `text` or `template-id`/`vars`) | Local test provider |
|
|
169
|
+
|
|
126
170
|
## Commands
|
|
127
171
|
|
|
128
172
|
- `k-msg config init|show|validate`
|
|
@@ -130,7 +174,7 @@ If the env var is missing/empty, commands that need runtime providers will fail
|
|
|
130
174
|
- `k-msg providers list|health|doctor`
|
|
131
175
|
- `k-msg sms send`
|
|
132
176
|
- `k-msg alimtalk preflight|send`
|
|
133
|
-
- `k-msg send --input <json> | --file <path> | --stdin`
|
|
177
|
+
- `k-msg send --input <json> | --file <path> | --stdin` (advanced/raw JSON only)
|
|
134
178
|
- `k-msg kakao channel categories|list|auth|add`
|
|
135
179
|
- `k-msg kakao template list|get|create|update|delete|request`
|
|
136
180
|
|
|
@@ -142,8 +186,8 @@ If the env var is missing/empty, commands that need runtime providers will fail
|
|
|
142
186
|
|
|
143
187
|
```bash
|
|
144
188
|
k-msg providers doctor
|
|
145
|
-
k-msg alimtalk preflight --provider iwinv --template-
|
|
146
|
-
k-msg alimtalk send --provider iwinv --template-
|
|
189
|
+
k-msg alimtalk preflight --provider iwinv --template-id TPL_001 --channel main
|
|
190
|
+
k-msg alimtalk send --provider iwinv --template-id TPL_001 --to 01012345678 --vars '{"name":"Jane"}'
|
|
147
191
|
```
|
|
148
192
|
|
|
149
193
|
Notes:
|
|
@@ -166,7 +210,7 @@ Terminology: the CLI uses **Kakao Channel** and **senderKey** (never “profile
|
|
|
166
210
|
```bash
|
|
167
211
|
k-msg alimtalk send \
|
|
168
212
|
--to 01012345678 \
|
|
169
|
-
--template-
|
|
213
|
+
--template-id TPL_001 \
|
|
170
214
|
--vars '{"name":"Jane"}' \
|
|
171
215
|
--channel main \
|
|
172
216
|
--plus-id @my_channel
|
|
@@ -177,7 +221,7 @@ Failover options:
|
|
|
177
221
|
```bash
|
|
178
222
|
k-msg alimtalk send \
|
|
179
223
|
--to 01012345678 \
|
|
180
|
-
--template-
|
|
224
|
+
--template-id TPL_001 \
|
|
181
225
|
--vars '{"name":"Jane"}' \
|
|
182
226
|
--failover true \
|
|
183
227
|
--fallback-channel sms \
|
|
@@ -192,7 +236,7 @@ When providers return send warnings (for example failover partial/unsupported),
|
|
|
192
236
|
```bash
|
|
193
237
|
k-msg alimtalk preflight \
|
|
194
238
|
--provider iwinv \
|
|
195
|
-
--template-
|
|
239
|
+
--template-id TPL_001 \
|
|
196
240
|
--channel main \
|
|
197
241
|
--sender-key your_sender_key \
|
|
198
242
|
--plus-id @my_channel
|
|
@@ -202,10 +246,42 @@ k-msg alimtalk preflight \
|
|
|
202
246
|
|
|
203
247
|
### Advanced JSON send
|
|
204
248
|
|
|
249
|
+
`k-msg send` is an advanced command for raw `SendInput` JSON (object or array).
|
|
250
|
+
For common workflows, prefer `k-msg sms send` and `k-msg alimtalk send`.
|
|
251
|
+
|
|
205
252
|
```bash
|
|
206
253
|
k-msg send --input '{"to":"01012345678","text":"hello"}'
|
|
207
254
|
```
|
|
208
255
|
|
|
256
|
+
Single preview without sending:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
k-msg send --input '{"to":"01012345678","text":"hello"}' --dry-run
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Batch preview without sending:
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
k-msg send --input '[{"to":"01011112222","text":"hello 1"},{"to":"01033334444","text":"hello 2"}]' --dry-run
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
`providers doctor` and `send --dry-run` have different roles:
|
|
269
|
+
|
|
270
|
+
- `k-msg providers doctor`: provider/account/capability readiness checks
|
|
271
|
+
- `k-msg send --dry-run`: request payload preview/validation (no provider send)
|
|
272
|
+
|
|
273
|
+
Boolean flag semantics (applies to `--json`, `--verbose`, `--dry-run`, `--stdin`, `--failover`, `--force`):
|
|
274
|
+
|
|
275
|
+
- `--flag` -> `true`
|
|
276
|
+
- `--flag true` -> `true`
|
|
277
|
+
- `--flag false` -> `false`
|
|
278
|
+
- `--no-flag` -> `false`
|
|
279
|
+
- Invalid boolean values (for example `--dry-run maybe`) fail with exit code `2`
|
|
280
|
+
|
|
281
|
+
Resolution precedence for overlapping values is:
|
|
282
|
+
|
|
283
|
+
- `CLI flag > environment variable > config file > built-in default`
|
|
284
|
+
|
|
209
285
|
## Kakao Channel (Aligo capability)
|
|
210
286
|
|
|
211
287
|
```bash
|
|
@@ -226,13 +302,13 @@ Channel scope (Aligo): use `--channel <alias>` or `--sender-key <value>`.
|
|
|
226
302
|
|
|
227
303
|
```bash
|
|
228
304
|
k-msg kakao template list
|
|
229
|
-
k-msg kakao template get --template-
|
|
305
|
+
k-msg kakao template get --template-id TPL_001
|
|
230
306
|
k-msg kakao template create --name "Welcome" --content "Hello #{name}" --channel main
|
|
231
|
-
k-msg kakao template update --template-
|
|
232
|
-
k-msg kakao template delete --template-
|
|
307
|
+
k-msg kakao template update --template-id TPL_001 --name "Updated"
|
|
308
|
+
k-msg kakao template delete --template-id TPL_001
|
|
233
309
|
|
|
234
310
|
# inspection request is provider-dependent (supported by Aligo)
|
|
235
|
-
k-msg kakao template request --template-
|
|
311
|
+
k-msg kakao template request --template-id TPL_001 --channel main
|
|
236
312
|
```
|
|
237
313
|
|
|
238
314
|
## Output / Exit Codes
|
|
@@ -242,6 +318,7 @@ k-msg kakao template request --template-code TPL_001 --channel main
|
|
|
242
318
|
when an agent is detected (`CLAUDECODE`, `CURSOR_AGENT`, `CODEX_CI` /
|
|
243
319
|
`CODEX_SHELL` / `CODEX_THREAD_ID`, `MCP_SERVER_NAME` / `MCP_SESSION_ID` /
|
|
244
320
|
`MCP_TOOL_NAME`)
|
|
321
|
+
- Force text output in AI environments with `--json false` (or `--no-json`)
|
|
245
322
|
- exit code:
|
|
246
323
|
- `0`: success
|
|
247
324
|
- `2`: input/config error
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k-msg/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "k-msg CLI (prebuilt binaries via GitHub Releases)",
|
|
6
6
|
"type": "module",
|
|
@@ -26,6 +26,7 @@
|
|
|
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",
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
36
|
"@k-msg/core": "0.17.0",
|
|
37
|
+
"@k-msg/messaging": "0.17.0",
|
|
36
38
|
"@k-msg/provider": "0.17.0",
|
|
37
39
|
"@bunli/core": "^0.5.4",
|
|
38
40
|
"@bunli/plugin-ai-detect": "^0.5.2",
|