@k-msg/cli 0.6.0 → 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 CHANGED
@@ -1,5 +1,13 @@
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
+
3
11
  ## 0.6.0 — 2026-02-18
4
12
 
5
13
  ### Minor 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`
@@ -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-code TPL_001 --channel main
146
- k-msg alimtalk send --provider iwinv --template-code TPL_001 --to 01012345678 --vars '{"name":"Jane"}'
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-code TPL_001 \
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-code TPL_001 \
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-code TPL_001 \
239
+ --template-id TPL_001 \
196
240
  --channel main \
197
241
  --sender-key your_sender_key \
198
242
  --plus-id @my_channel
@@ -226,6 +270,18 @@ k-msg send --input '[{"to":"01011112222","text":"hello 1"},{"to":"01033334444","
226
270
  - `k-msg providers doctor`: provider/account/capability readiness checks
227
271
  - `k-msg send --dry-run`: request payload preview/validation (no provider send)
228
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
+
229
285
  ## Kakao Channel (Aligo capability)
230
286
 
231
287
  ```bash
@@ -246,13 +302,13 @@ Channel scope (Aligo): use `--channel <alias>` or `--sender-key <value>`.
246
302
 
247
303
  ```bash
248
304
  k-msg kakao template list
249
- k-msg kakao template get --template-code TPL_001
305
+ k-msg kakao template get --template-id TPL_001
250
306
  k-msg kakao template create --name "Welcome" --content "Hello #{name}" --channel main
251
- k-msg kakao template update --template-code TPL_001 --name "Updated"
252
- k-msg kakao template delete --template-code TPL_001
307
+ k-msg kakao template update --template-id TPL_001 --name "Updated"
308
+ k-msg kakao template delete --template-id TPL_001
253
309
 
254
310
  # inspection request is provider-dependent (supported by Aligo)
255
- k-msg kakao template request --template-code TPL_001 --channel main
311
+ k-msg kakao template request --template-id TPL_001 --channel main
256
312
  ```
257
313
 
258
314
  ## Output / Exit Codes
@@ -262,6 +318,7 @@ k-msg kakao template request --template-code TPL_001 --channel main
262
318
  when an agent is detected (`CLAUDECODE`, `CURSOR_AGENT`, `CODEX_CI` /
263
319
  `CODEX_SHELL` / `CODEX_THREAD_ID`, `MCP_SERVER_NAME` / `MCP_SESSION_ID` /
264
320
  `MCP_TOOL_NAME`)
321
+ - Force text output in AI environments with `--json false` (or `--no-json`)
265
322
  - exit code:
266
323
  - `0`: success
267
324
  - `2`: input/config error
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-msg/cli",
3
- "version": "0.6.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",