@babelize/cli 1.0.13 → 1.1.3

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.
Files changed (139) hide show
  1. package/LICENSE +200 -4
  2. package/README.md +53 -20
  3. package/dist/client.d.ts +9 -0
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +73 -31
  6. package/dist/client.js.map +1 -1
  7. package/dist/commands/account.js +1 -1
  8. package/dist/commands/account.js.map +1 -1
  9. package/dist/commands/admin.js +5 -5
  10. package/dist/commands/admin.js.map +1 -1
  11. package/dist/commands/analytics.js +1 -1
  12. package/dist/commands/analytics.js.map +1 -1
  13. package/dist/commands/api-keys.d.ts +6 -0
  14. package/dist/commands/api-keys.d.ts.map +1 -1
  15. package/dist/commands/api-keys.js +42 -12
  16. package/dist/commands/api-keys.js.map +1 -1
  17. package/dist/commands/auth.d.ts.map +1 -1
  18. package/dist/commands/auth.js +23 -12
  19. package/dist/commands/auth.js.map +1 -1
  20. package/dist/commands/babels.d.ts.map +1 -1
  21. package/dist/commands/babels.js +16 -20
  22. package/dist/commands/babels.js.map +1 -1
  23. package/dist/commands/billing.js +1 -1
  24. package/dist/commands/billing.js.map +1 -1
  25. package/dist/commands/check.d.ts +22 -0
  26. package/dist/commands/check.d.ts.map +1 -0
  27. package/dist/commands/check.js +134 -0
  28. package/dist/commands/check.js.map +1 -0
  29. package/dist/commands/checkout.js +2 -2
  30. package/dist/commands/checkout.js.map +1 -1
  31. package/dist/commands/comments.js +5 -5
  32. package/dist/commands/comments.js.map +1 -1
  33. package/dist/commands/glossary.d.ts +15 -0
  34. package/dist/commands/glossary.d.ts.map +1 -1
  35. package/dist/commands/glossary.js +106 -25
  36. package/dist/commands/glossary.js.map +1 -1
  37. package/dist/commands/init.d.ts.map +1 -1
  38. package/dist/commands/init.js +82 -69
  39. package/dist/commands/init.js.map +1 -1
  40. package/dist/commands/invitations.d.ts.map +1 -1
  41. package/dist/commands/invitations.js +3 -1
  42. package/dist/commands/invitations.js.map +1 -1
  43. package/dist/commands/languages.d.ts.map +1 -1
  44. package/dist/commands/languages.js +38 -17
  45. package/dist/commands/languages.js.map +1 -1
  46. package/dist/commands/members.js +7 -7
  47. package/dist/commands/members.js.map +1 -1
  48. package/dist/commands/notifications.js +1 -1
  49. package/dist/commands/notifications.js.map +1 -1
  50. package/dist/commands/pr.d.ts.map +1 -1
  51. package/dist/commands/pr.js +6 -4
  52. package/dist/commands/pr.js.map +1 -1
  53. package/dist/commands/privacy.d.ts.map +1 -1
  54. package/dist/commands/privacy.js +7 -5
  55. package/dist/commands/privacy.js.map +1 -1
  56. package/dist/commands/projects.d.ts.map +1 -1
  57. package/dist/commands/projects.js +60 -35
  58. package/dist/commands/projects.js.map +1 -1
  59. package/dist/commands/roles.js +1 -1
  60. package/dist/commands/roles.js.map +1 -1
  61. package/dist/commands/run.d.ts +48 -0
  62. package/dist/commands/run.d.ts.map +1 -1
  63. package/dist/commands/run.js +264 -132
  64. package/dist/commands/run.js.map +1 -1
  65. package/dist/commands/scan.js +1 -1
  66. package/dist/commands/scan.js.map +1 -1
  67. package/dist/commands/status.js +1 -1
  68. package/dist/commands/status.js.map +1 -1
  69. package/dist/commands/subscriptions.js +1 -1
  70. package/dist/commands/subscriptions.js.map +1 -1
  71. package/dist/commands/tm.d.ts.map +1 -1
  72. package/dist/commands/tm.js +31 -13
  73. package/dist/commands/tm.js.map +1 -1
  74. package/dist/commands/translate.d.ts +24 -0
  75. package/dist/commands/translate.d.ts.map +1 -0
  76. package/dist/commands/translate.js +422 -0
  77. package/dist/commands/translate.js.map +1 -0
  78. package/dist/commands/users.js +1 -1
  79. package/dist/commands/users.js.map +1 -1
  80. package/dist/config.d.ts +1 -0
  81. package/dist/config.d.ts.map +1 -1
  82. package/dist/config.js +12 -4
  83. package/dist/config.js.map +1 -1
  84. package/dist/global-options.d.ts +6 -2
  85. package/dist/global-options.d.ts.map +1 -1
  86. package/dist/global-options.js +9 -3
  87. package/dist/global-options.js.map +1 -1
  88. package/dist/local/formatter.d.ts +27 -0
  89. package/dist/local/formatter.d.ts.map +1 -0
  90. package/dist/local/formatter.js +69 -0
  91. package/dist/local/formatter.js.map +1 -0
  92. package/dist/local/git.d.ts +16 -0
  93. package/dist/local/git.d.ts.map +1 -0
  94. package/dist/local/git.js +52 -0
  95. package/dist/local/git.js.map +1 -0
  96. package/dist/local/provider.d.ts +41 -0
  97. package/dist/local/provider.d.ts.map +1 -0
  98. package/dist/local/provider.js +87 -0
  99. package/dist/local/provider.js.map +1 -0
  100. package/dist/local/translate-core.d.ts +188 -0
  101. package/dist/local/translate-core.d.ts.map +1 -0
  102. package/dist/local/translate-core.js +401 -0
  103. package/dist/local/translate-core.js.map +1 -0
  104. package/dist/local/workspace-copy.d.ts +75 -0
  105. package/dist/local/workspace-copy.d.ts.map +1 -0
  106. package/dist/local/workspace-copy.js +263 -0
  107. package/dist/local/workspace-copy.js.map +1 -0
  108. package/dist/oauth.d.ts.map +1 -1
  109. package/dist/oauth.js +11 -3
  110. package/dist/oauth.js.map +1 -1
  111. package/dist/program.d.ts +22 -0
  112. package/dist/program.d.ts.map +1 -1
  113. package/dist/program.js +32 -10
  114. package/dist/program.js.map +1 -1
  115. package/dist/tui/clack.d.ts +60 -0
  116. package/dist/tui/clack.d.ts.map +1 -0
  117. package/dist/tui/clack.js +138 -0
  118. package/dist/tui/clack.js.map +1 -0
  119. package/dist/tui/help.d.ts.map +1 -1
  120. package/dist/tui/help.js +14 -5
  121. package/dist/tui/help.js.map +1 -1
  122. package/dist/tui/prompt.d.ts.map +1 -1
  123. package/dist/tui/prompt.js +4 -2
  124. package/dist/tui/prompt.js.map +1 -1
  125. package/dist/tui/repl.d.ts.map +1 -1
  126. package/dist/tui/repl.js +2 -0
  127. package/dist/tui/repl.js.map +1 -1
  128. package/dist/tui/table.d.ts.map +1 -1
  129. package/dist/tui/table.js +6 -2
  130. package/dist/tui/table.js.map +1 -1
  131. package/dist/utils/validate.d.ts +7 -0
  132. package/dist/utils/validate.d.ts.map +1 -0
  133. package/dist/utils/validate.js +16 -0
  134. package/dist/utils/validate.js.map +1 -0
  135. package/dist/utils/zip-upload.d.ts +83 -0
  136. package/dist/utils/zip-upload.d.ts.map +1 -0
  137. package/dist/utils/zip-upload.js +285 -0
  138. package/dist/utils/zip-upload.js.map +1 -0
  139. package/package.json +6 -2
package/LICENSE CHANGED
@@ -1,6 +1,202 @@
1
- Copyright (c) 2026 Babelize
2
1
 
3
- All Rights Reserved.
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
4
5
 
5
- This software and its source code are proprietary and confidential.
6
- Unauthorized copying, modification, distribution, or use is prohibited.
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -8,7 +8,31 @@
8
8
  npm install -g @babelize/cli
9
9
  ```
10
10
 
11
- ## Quick Start
11
+ ## Quick start
12
+
13
+ Translate the repo you're in with your own LLM key (no account needed) or a Babelize API key. Locale files and i18n code are written into your working tree for review with `git diff`:
14
+
15
+ ```bash
16
+ export ANTHROPIC_API_KEY=sk-ant-... # or OPENAI_API_KEY, GEMINI_API_KEY, GROQ_API_KEY, OPENROUTER_API_KEY
17
+ npx @babelize/cli translate --to fr,de,ja
18
+ git diff
19
+ ```
20
+
21
+ Or use Babelize-hosted translation: create an API key at https://app.babelize.co/api-keys (free tier included), then
22
+
23
+ ```bash
24
+ export BABELIZE_API_KEY=bblz_sk_...
25
+ npx @babelize/cli translate --to fr,de,ja
26
+ ```
27
+
28
+ - **Frameworks:** React, Next.js (App Router) and Django are supported. Vue and static HTML are in beta.
29
+ - **Key:** the first LLM key found in the order above is used; with none, `BABELIZE_API_KEY` selects Babelize-hosted translation (strings only, never code; billed in AI credits). Pick another with `--provider` (`babelize` for hosted), or a different model with `--model`.
30
+ - **Safety:** it needs a git repo with a clean working tree (`--force` overrides). It works on a temporary copy and touches nothing if the run fails. `--dry-run` prints the diff without writing.
31
+ - **Re-runs:** commit `.babelize/local/babelize-lock.json` and later runs only translate new or changed strings.
32
+
33
+ Full guide: https://docs.babelize.co/cli/translate
34
+
35
+ ## Quick Start (platform)
12
36
 
13
37
  ```bash
14
38
  # Log in to your Babelize account
@@ -25,6 +49,7 @@ babelize run start
25
49
 
26
50
  | Command | Description |
27
51
  |---------|-------------|
52
+ | `translate --to <locales>` | Translate this repo locally with your own LLM key or `BABELIZE_API_KEY` (writes to the working tree) |
28
53
  | `init` | Initialize a new Babelize project |
29
54
  | `auth login` / `signup` / `logout` / `whoami` | Authentication management |
30
55
  | `auth reset-password` | Send a password reset email |
@@ -36,11 +61,11 @@ babelize run start
36
61
  | `babels` | View translation job history |
37
62
  | `pr` | GitHub PR integration |
38
63
  | `billing` | Plans, usage, invoices |
39
- | `subscriptions` | List, cancel, reactivate subscriptions |
64
+ | `subscriptions` | List, inspect, and set the default subscription |
40
65
  | `checkout` | Purchase a plan |
41
66
  | `languages` | System and project-level language management, ISO ↔ FLORES-200 code conversion |
42
67
  | `members` | Team member management |
43
- | `tm` | Translation memory (view, add, update, export as TMX, clear) |
68
+ | `tm` | Translation memory (owner-scoped, shared across your projects: view, add, update, export as TMX, clear) |
44
69
  | `glossary` | Translation glossary (list, add, update, delete, import, export) |
45
70
  | `api-keys byok` | BYOK provider keys (OpenAI, Anthropic, Groq, etc.) |
46
71
  | `api-keys babelize` | Babelize API keys (bblz_sk_ prefix for MCP/external access) |
@@ -70,14 +95,15 @@ The script dynamically reflects all registered commands at generation time.
70
95
  ## Configuration
71
96
 
72
97
  Credentials and preferences are stored at:
73
- - **macOS:** `~/Library/Preferences/babelize-nodejs/config.json`
74
- - **Linux:** `~/.config/babelize-nodejs/config.json`
75
- - **Windows:** `%APPDATA%/babelize-nodejs/config.json`
98
+ - **macOS:** `~/Library/Preferences/@babelize/cli-nodejs/config.json`
99
+ - **Linux:** `~/.config/@babelize/cli-nodejs/config.json`
100
+ - **Windows:** `%APPDATA%\@babelize\cli-nodejs\Config\config.json`
76
101
 
77
- The CLI auto-detects the API URL:
78
- - **Production:** `https://api.babelize.co/api`
79
- - **Local dev:** `http://localhost:3001/api`
80
- - **Override:** Set `BABELIZE_API_URL` env var or use `--api-url`
102
+ The API URL resolves in this order:
103
+ - **`--api-url` flag** — per-command override
104
+ - **`BABELIZE_API_URL` env var** — e.g. `http://localhost:3001/api` for local dev
105
+ - **Stored config** — the URL saved by `babelize auth login --api-url <url>` or the "Self-hosted" login choice (localhost URLs included). A URL is only stored when you ask for it.
106
+ - **Default:** `https://api.babelize.co/api`
81
107
 
82
108
  ## Environment Variables
83
109
 
@@ -88,10 +114,12 @@ The CLI auto-detects the API URL:
88
114
  | `BABELIZE_NON_INTERACTIVE` | Force non-interactive mode (`1` or `true`) |
89
115
  | `CI` | When set (not `"false"`), the CLI never prompts — missing flags exit with a usage error |
90
116
  | `NO_COLOR` | Disable colored output (any non-empty value) |
117
+ | `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `GROQ_API_KEY`, `OPENROUTER_API_KEY` | Your LLM key for `babelize translate` (first one set wins; `--provider` to choose) |
118
+ | `BABELIZE_API_KEY` | Babelize API key (`bblz_sk_…`) for hosted translation in `babelize translate` when no LLM key is set |
91
119
 
92
120
  ## CI / Non-Interactive Mode
93
121
 
94
- The CLI is CI-safe. Set `CI=true` (most pipelines do automatically) or pass `--yes` / `--non-interactive`, and the CLI will never block on a prompt:
122
+ The CLI is CI-safe. Set `CI=true` (most pipelines do automatically), set `BABELIZE_NON_INTERACTIVE=1`, or pass `--non-interactive` / `--yes`, and the CLI will never block on a prompt. `--yes` also answers "yes" to confirmations such as deletes; without it, a confirmation in non-interactive mode fails with exit code `2`:
95
123
 
96
124
  ```bash
97
125
  CI=true babelize run start -p <project-id> -l es,fr --no-poll --json
@@ -112,13 +140,12 @@ See the [CI/CD docs](https://docs.babelize.co/docs/integrations/ci-cd) for a ful
112
140
  | Code | Meaning | When it happens |
113
141
  |------|---------|-----------------|
114
142
  | `0` | Success | Command completed |
115
- | `1` | Internal error | Unexpected failure (catch-all) |
116
- | `2` | Usage error | Invalid arguments, missing required flags (incl. non-interactive) |
117
- | `3` | Auth error | Not logged in, session expired, login failed |
118
- | `4` | Config error | Missing or invalid configuration file |
119
- | `5` | Network error | Rate limited, DNS failure, timeout |
120
- | `6` | API error | Server returned 4xx/5xx |
121
- | `128` | Cancelled | Interactive prompt cancelled (or auto-cancelled in CI) |
143
+ | `1` | Internal error | Unexpected failure |
144
+ | `2` | Usage error | Unknown command, bad flag, missing or invalid argument (e.g. a malformed ID), or a prompt that cannot be answered in non-interactive mode |
145
+ | `3` | Auth error | Not logged in, session expired, login failed, token rejected |
146
+ | `5` | Network error | API unreachable, rate limited, DNS failure, timeout |
147
+ | `6` | API error | Server returned 4xx/5xx; a run that failed (`run start`, `run status --watch`) |
148
+ | `128` | Cancelled | Interactive prompt cancelled, or a run that was cancelled before it finished |
122
149
 
123
150
  > A cancelled prompt exits `128`, **never** `0` — so a pipeline step can't silently pass when required input is missing.
124
151
 
@@ -132,8 +159,14 @@ fi
132
159
 
133
160
  ## JSON Mode
134
161
 
135
- Append `--json` to any command for machine-readable JSON output. All commands
136
- return JSON when this flag is set.
162
+ Append `--json` to a command for machine-readable JSON output. Coverage is per
163
+ subcommand: where a subcommand doesn't implement it, `--json` is ignored and the
164
+ usual human-readable output is printed (e.g. `babelize projects list --json`
165
+ returns JSON, but some `members` and `notifications` subactions do not).
166
+
167
+ With `--json`, spinners and other progress output never touch stdout (errors and
168
+ notices go to stderr), so `babelize --json auth whoami | jq` works. When stdout is
169
+ not a terminal, spinners are replaced by plain lines on stderr.
137
170
 
138
171
  ## Update Notifications
139
172
 
package/dist/client.d.ts CHANGED
@@ -2,6 +2,15 @@ import { AxiosInstance } from 'axios';
2
2
  export { setGlobalOptions, isJsonMode } from './global-options.js';
3
3
  export declare function resetClient(): void;
4
4
  export declare const CLI_VERSION: string;
5
+ export declare function getBaseUrl(): string;
5
6
  export declare function getClient(): AxiosInstance;
7
+ export interface DescribedError {
8
+ message: string;
9
+ exitCode: number;
10
+ }
11
+ /** What to print for a failed API call, and the exit code. Pure, for tests. */
12
+ export declare function describeApiError(error: unknown): DescribedError;
6
13
  export declare function handleApiError(error: unknown): never;
14
+ /** True when a token comes from --token or BABELIZE_TOKEN (not stored credentials). */
15
+ export declare function hasExplicitToken(): boolean;
7
16
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAkC,MAAM,OAAO,CAAC;AAO7E,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnE,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED,eAAO,MAAM,WAAW,QAAc,CAAC;AA6GvC,wBAAgB,SAAS,IAAI,aAAa,CAMzC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CA6BpD"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAkC,MAAM,OAAO,CAAC;AAO7E,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnE,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED,eAAO,MAAM,WAAW,QAAc,CAAC;AAKvC,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAsGD,wBAAgB,SAAS,IAAI,aAAa,CAMzC;AA0BD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CA6C/D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAIpD;AAED,uFAAuF;AACvF,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C"}
package/dist/client.js CHANGED
@@ -11,8 +11,8 @@ export function resetClient() {
11
11
  export const CLI_VERSION = pkg.version;
12
12
  let cachedInstance = null;
13
13
  let refreshPromise = null;
14
- function getBaseUrl() {
15
- return globalOptions.apiUrl ?? config.getApiUrl();
14
+ export function getBaseUrl() {
15
+ return globalOptions.apiUrl || config.getApiUrl();
16
16
  }
17
17
  function getToken() {
18
18
  if (globalOptions.token)
@@ -109,40 +109,82 @@ export function getClient() {
109
109
  cachedInstance.defaults.baseURL = getBaseUrl();
110
110
  return cachedInstance;
111
111
  }
112
- export function handleApiError(error) {
112
+ /** Turn a backend `details` field (string, list, or field → reason map) into one line. */
113
+ function formatDetails(details) {
114
+ if (details === null || details === undefined || details === '')
115
+ return undefined;
116
+ if (typeof details === 'string')
117
+ return details;
118
+ if (Array.isArray(details)) {
119
+ const parts = details.map((d) => typeof d === 'string' ? d : d?.message ?? JSON.stringify(d));
120
+ return parts.length ? parts.join('; ') : undefined;
121
+ }
122
+ if (typeof details === 'object') {
123
+ const parts = Object.entries(details).map(([key, value]) => `${key}: ${typeof value === 'string' ? value : JSON.stringify(value)}`);
124
+ return parts.length ? parts.join('; ') : undefined;
125
+ }
126
+ return String(details);
127
+ }
128
+ const NETWORK_ERROR_CODES = new Set([
129
+ 'ECONNREFUSED', 'ENOTFOUND', 'EAI_AGAIN', 'ECONNRESET', 'ETIMEDOUT', 'ECONNABORTED',
130
+ 'EHOSTUNREACH', 'ENETUNREACH', 'ERR_NETWORK', 'EPIPE',
131
+ ]);
132
+ /** What to print for a failed API call, and the exit code. Pure, for tests. */
133
+ export function describeApiError(error) {
113
134
  if (axios.isAxiosError(error)) {
114
135
  const status = error.response?.status;
115
136
  const data = error.response?.data;
116
- const message = data?.error ?? data?.message ?? error.message;
117
- if (status === 401) {
118
- console.error(chalk.red('✗ Not authenticated.'), 'Run:', chalk.cyan('babelize login'));
119
- process.exit(ExitCode.AUTH);
120
- }
121
- else if (status === 403) {
122
- console.error(chalk.red('✗ Forbidden:'), message);
123
- }
124
- else if (status === 404) {
125
- console.error(chalk.red('✗ Not found:'), message);
126
- }
127
- else if (status === 429) {
128
- console.error(chalk.red('✗ Rate limited.'), 'Please wait and try again.');
129
- process.exit(ExitCode.NETWORK);
130
- }
131
- else if (status && status >= 500) {
132
- console.error(chalk.red(`✗ Server error (${status}):`), message);
137
+ const serverMessage = (typeof data?.error === 'string' && data.error) ||
138
+ (typeof data?.message === 'string' && data.message) ||
139
+ undefined;
140
+ const details = formatDetails(data?.details);
141
+ const base = serverMessage ?? error.message;
142
+ const message = details && !base.includes(details) ? `${base}: ${details}` : base;
143
+ if (!error.response) {
144
+ const url = error.config?.baseURL ?? getBaseUrl();
145
+ if (error.code === 'ECONNABORTED' || error.code === 'ETIMEDOUT') {
146
+ return { message: `The Babelize API at ${url} did not respond in time.`, exitCode: ExitCode.NETWORK };
147
+ }
148
+ if (!error.code || NETWORK_ERROR_CODES.has(error.code) || error.request) {
149
+ const reason = error.code ? ` (${error.code})` : '';
150
+ return {
151
+ message: `Could not reach the Babelize API at ${url}${reason}. Check your connection, or the URL (--api-url / BABELIZE_API_URL).`,
152
+ exitCode: ExitCode.NETWORK,
153
+ };
154
+ }
133
155
  }
134
- else {
135
- console.error(chalk.red('✗ API error:'), message);
156
+ const url = error.config?.url ?? '';
157
+ if (status === 401) {
158
+ if (url.includes('/auth/login')) {
159
+ return { message: `Login failed: ${serverMessage ?? 'Invalid email or password'}`, exitCode: ExitCode.AUTH };
160
+ }
161
+ if (globalOptions.token || process.env.BABELIZE_TOKEN) {
162
+ const from = globalOptions.token ? '--token' : 'BABELIZE_TOKEN';
163
+ return { message: `Not authenticated: the token from ${from} was rejected.`, exitCode: ExitCode.AUTH };
164
+ }
165
+ return { message: 'Not authenticated. Run: babelize auth login', exitCode: ExitCode.AUTH };
136
166
  }
137
- process.exit(ExitCode.API_ERROR);
138
- }
139
- else if (error instanceof Error) {
140
- console.error(chalk.red('✗ Error:'), error.message);
141
- process.exit(ExitCode.INTERNAL);
142
- }
143
- else {
144
- console.error(chalk.red('✗ Unknown error occurred.'));
145
- process.exit(ExitCode.INTERNAL);
167
+ if (status === 403)
168
+ return { message: `Forbidden: ${message}`, exitCode: ExitCode.API_ERROR };
169
+ if (status === 404)
170
+ return { message: `Not found: ${message}`, exitCode: ExitCode.API_ERROR };
171
+ if (status === 429)
172
+ return { message: 'Rate limited. Please wait and try again.', exitCode: ExitCode.NETWORK };
173
+ if (status && status >= 500)
174
+ return { message: `Server error (${status}): ${message}`, exitCode: ExitCode.API_ERROR };
175
+ return { message: `API error: ${message || `request failed${status ? ` (${status})` : ''}`}`, exitCode: ExitCode.API_ERROR };
146
176
  }
177
+ if (error instanceof Error)
178
+ return { message: `Error: ${error.message}`, exitCode: ExitCode.INTERNAL };
179
+ return { message: 'Unknown error occurred.', exitCode: ExitCode.INTERNAL };
180
+ }
181
+ export function handleApiError(error) {
182
+ const { message, exitCode } = describeApiError(error);
183
+ console.error(chalk.red(`✗ ${message}`));
184
+ process.exit(exitCode);
185
+ }
186
+ /** True when a token comes from --token or BABELIZE_TOKEN (not stored credentials). */
187
+ export function hasExplicitToken() {
188
+ return Boolean(globalOptions.token || process.env.BABELIZE_TOKEN);
147
189
  }
148
190
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnE,MAAM,UAAU,WAAW;IACzB,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CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC/H,CAAC;IACD,IAAI,KAAK,YAAY,KAAK;QAAE,OAAO,EAAE,OAAO,EAAE,UAAU,KAAK,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC;IACvG,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACtD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC;IACzC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,gBAAgB;IAC9B,OAAO,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AACpE,CAAC"}
@@ -1,4 +1,4 @@
1
- import * as clack from '@clack/prompts';
1
+ import * as clack from '../tui/clack.js';
2
2
  import { getClient, handleApiError } from '../client.js';
3
3
  import { isJsonMode, printJson } from '../formatters.js';
4
4
  import { table, keyValue } from '../tui/table.js';
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/commands/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;A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wEAAwE,CAAC,CAAC;QACnF,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEL,OAAO,CAAC,eAAe,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAC/C,SAAS,EACT,+CAA+C,EAC/C;QACE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,+CAA+C,EAAE;QAC7E,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,4BAA4B,EAAE;QAC1D,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,uCAAuC,EAAE;QACnE,EAAE,IAAI,EAAE,4BAA4B,EAAE,IAAI,EAAE,0CAA0C,EAAE;QACxF,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,iEAAiE,EAAE;KAC5F,CACF,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import * as clack from '@clack/prompts';
1
+ import * as clack from '../tui/clack.js';
2
2
  import { getClient, handleApiError } from '../client.js';
3
3
  import { isJsonMode, printJson } from '../formatters.js';
4
4
  import { table, keyValue } from '../tui/table.js';
@@ -134,19 +134,19 @@ export function registerAdminCommands(program) {
134
134
  let { user, subscription, action, reason } = opts;
135
135
  if (!user || !subscription || !action || !reason) {
136
136
  if (!user) {
137
- const result = await clack.text({ message: 'User ID:' });
137
+ const result = await clack.text({ message: 'User ID:', flag: '--user' });
138
138
  if (clack.isCancel(result))
139
139
  process.exit(ExitCode.CANCEL);
140
140
  user = result;
141
141
  }
142
142
  if (!subscription) {
143
- const result = await clack.text({ message: 'Subscription ID:' });
143
+ const result = await clack.text({ message: 'Subscription ID:', flag: '--subscription' });
144
144
  if (clack.isCancel(result))
145
145
  process.exit(ExitCode.CANCEL);
146
146
  subscription = result;
147
147
  }
148
148
  if (!action) {
149
- const result = await clack.select({ message: 'Action:', options: [
149
+ const result = await clack.select({ message: 'Action:', flag: '--action', options: [
150
150
  { value: 'extend', label: 'extend' },
151
151
  { value: 'pause', label: 'pause' },
152
152
  { value: 'cancel', label: 'cancel' },
@@ -157,7 +157,7 @@ export function registerAdminCommands(program) {
157
157
  action = result;
158
158
  }
159
159
  if (!reason) {
160
- const result = await clack.text({ message: 'Reason:' });
160
+ const result = await clack.text({ message: 'Reason:', flag: '--reason' });
161
161
  if (clack.isCancel(result))
162
162
  process.exit(ExitCode.CANCEL);
163
163
  reason = result;