prompsit-cli 26.311.2245 → 26.314.1453

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 (105) hide show
  1. package/LICENSE +191 -21
  2. package/README.md +140 -199
  3. package/assets/skills/README.md +33 -0
  4. package/assets/skills/prompsit-annotate/SKILL.md +55 -0
  5. package/assets/skills/prompsit-evaluate/SKILL.md +60 -0
  6. package/assets/skills/prompsit-score/SKILL.md +62 -0
  7. package/assets/skills/prompsit-setup/SKILL.md +146 -0
  8. package/assets/skills/prompsit-translate/SKILL.md +65 -0
  9. package/dist/api/auth-session.js +2 -2
  10. package/dist/api/auth-session.js.map +1 -1
  11. package/dist/api/errors.d.ts.map +1 -1
  12. package/dist/api/errors.js +13 -10
  13. package/dist/api/errors.js.map +1 -1
  14. package/dist/api/models.d.ts +19 -5
  15. package/dist/api/models.d.ts.map +1 -1
  16. package/dist/api/models.js +13 -5
  17. package/dist/api/models.js.map +1 -1
  18. package/dist/api/sse-models.d.ts +1 -1
  19. package/dist/api/sse-models.d.ts.map +1 -1
  20. package/dist/api/sse-models.js +4 -1
  21. package/dist/api/sse-models.js.map +1 -1
  22. package/dist/cli/prompts.d.ts +15 -0
  23. package/dist/cli/prompts.d.ts.map +1 -1
  24. package/dist/cli/prompts.js +89 -0
  25. package/dist/cli/prompts.js.map +1 -1
  26. package/dist/cli/skill-sync.d.ts +13 -0
  27. package/dist/cli/skill-sync.d.ts.map +1 -0
  28. package/dist/cli/skill-sync.js +234 -0
  29. package/dist/cli/skill-sync.js.map +1 -0
  30. package/dist/commands/config/command.d.ts.map +1 -1
  31. package/dist/commands/config/command.js +2 -1
  32. package/dist/commands/config/command.js.map +1 -1
  33. package/dist/commands/config/language.d.ts.map +1 -1
  34. package/dist/commands/config/language.js +3 -2
  35. package/dist/commands/config/language.js.map +1 -1
  36. package/dist/commands/error-handler.js +2 -2
  37. package/dist/commands/error-handler.js.map +1 -1
  38. package/dist/commands/error-presenter.d.ts.map +1 -1
  39. package/dist/commands/error-presenter.js +9 -1
  40. package/dist/commands/error-presenter.js.map +1 -1
  41. package/dist/commands/job-tracking.js +1 -1
  42. package/dist/commands/job-tracking.js.map +1 -1
  43. package/dist/commands/mappers.d.ts.map +1 -1
  44. package/dist/commands/mappers.js +4 -0
  45. package/dist/commands/mappers.js.map +1 -1
  46. package/dist/config/schemas.d.ts +2 -0
  47. package/dist/config/schemas.d.ts.map +1 -1
  48. package/dist/config/schemas.js +1 -0
  49. package/dist/config/schemas.js.map +1 -1
  50. package/dist/config/settings.js +1 -1
  51. package/dist/config/settings.js.map +1 -1
  52. package/dist/config/toml-io.d.ts.map +1 -1
  53. package/dist/config/toml-io.js +18 -5
  54. package/dist/config/toml-io.js.map +1 -1
  55. package/dist/errors/catalog.js +4 -4
  56. package/dist/errors/catalog.js.map +1 -1
  57. package/dist/errors/contracts.d.ts +2 -0
  58. package/dist/errors/contracts.d.ts.map +1 -1
  59. package/dist/errors/contracts.js +18 -0
  60. package/dist/errors/contracts.js.map +1 -1
  61. package/dist/i18n/catalog.d.ts +4 -6
  62. package/dist/i18n/catalog.d.ts.map +1 -1
  63. package/dist/i18n/catalog.js +4 -6
  64. package/dist/i18n/catalog.js.map +1 -1
  65. package/dist/index.d.ts.map +1 -1
  66. package/dist/index.js +13 -1
  67. package/dist/index.js.map +1 -1
  68. package/dist/logging/external-transport.d.ts.map +1 -1
  69. package/dist/logging/external-transport.js +2 -1
  70. package/dist/logging/external-transport.js.map +1 -1
  71. package/dist/output/terminal.js +1 -1
  72. package/dist/output/terminal.js.map +1 -1
  73. package/dist/output/usage-display.d.ts +6 -5
  74. package/dist/output/usage-display.d.ts.map +1 -1
  75. package/dist/output/usage-display.js +42 -33
  76. package/dist/output/usage-display.js.map +1 -1
  77. package/dist/output/view-models.d.ts +4 -0
  78. package/dist/output/view-models.d.ts.map +1 -1
  79. package/dist/repl/controller.d.ts.map +1 -1
  80. package/dist/repl/controller.js +8 -7
  81. package/dist/repl/controller.js.map +1 -1
  82. package/dist/repl/input/autocomplete-provider.d.ts +4 -0
  83. package/dist/repl/input/autocomplete-provider.d.ts.map +1 -1
  84. package/dist/repl/input/autocomplete-provider.js +7 -3
  85. package/dist/repl/input/autocomplete-provider.js.map +1 -1
  86. package/dist/repl/loop.d.ts.map +1 -1
  87. package/dist/repl/loop.js +6 -3
  88. package/dist/repl/loop.js.map +1 -1
  89. package/dist/repl/service.d.ts.map +1 -1
  90. package/dist/repl/service.js +2 -1
  91. package/dist/repl/service.js.map +1 -1
  92. package/dist/runtime/execution-mode.d.ts +6 -0
  93. package/dist/runtime/execution-mode.d.ts.map +1 -0
  94. package/dist/runtime/execution-mode.js +17 -0
  95. package/dist/runtime/execution-mode.js.map +1 -0
  96. package/dist/runtime/format-extensions.d.ts.map +1 -1
  97. package/dist/runtime/format-extensions.js +2 -1
  98. package/dist/runtime/format-extensions.js.map +1 -1
  99. package/dist/runtime/update-check.d.ts.map +1 -1
  100. package/dist/runtime/update-check.js +2 -1
  101. package/dist/runtime/update-check.js.map +1 -1
  102. package/dist/tui/settings-screen.d.ts.map +1 -1
  103. package/dist/tui/settings-screen.js +38 -8
  104. package/dist/tui/settings-screen.js.map +1 -1
  105. package/package.json +20 -2
package/LICENSE CHANGED
@@ -1,21 +1,191 @@
1
- MIT License
2
-
3
- Copyright (c) 2025-2026 Prompsit Language Engineering, S.L.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
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 the 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 the 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 any 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
+ Copyright 2025-2026 Prompsit Language Engineering, S.L.
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
package/README.md CHANGED
@@ -4,277 +4,218 @@
4
4
  [![license](https://img.shields.io/npm/l/prompsit-cli)](https://www.npmjs.com/package/prompsit-cli)
5
5
  [![node](https://img.shields.io/node/v/prompsit-cli)](https://nodejs.org/)
6
6
 
7
- CLI for the Prompsit Translation API. Translate text and documents, evaluate quality, score parallel corpora, and annotate monolingual data.
7
+ One CLI for the entire Prompsit Translation API. Translate text and documents, evaluate translation quality, score parallel corpora with Bicleaner-AI, and annotate monolingual data with Monotextor — from your terminal or an interactive REPL.
8
8
 
9
- ## Requirements
10
-
11
- [Node.js](https://nodejs.org/) 22+
12
-
13
- ```bash
14
- node -v # Should print v22.x or higher
15
- ```
16
-
17
- ## Install
9
+ ## Quick Start
18
10
 
19
11
  ```bash
20
12
  npm install -g prompsit-cli
21
- ```
22
-
23
- **Update:** `npm install -g prompsit-cli@latest --prefer-online`
24
- **Uninstall:** `npm uninstall -g prompsit-cli`
25
-
26
- <details>
27
- <summary>Command not found after install?</summary>
28
13
 
29
- ```bash
30
- # Check global npm bin is on PATH
31
- echo "$PATH" | tr ':' '\n' | grep '.npm-global/bin'
32
- command -v prompsit
14
+ prompsit login -a "EMAIL" -s "SECRET"
15
+ prompsit translate "Hello world" -s "en" -t "es"
16
+ prompsit translate @"report.docx" -s "en" -t "es"
17
+ prompsit # Interactive REPL
33
18
  ```
34
19
 
35
- </details>
20
+ > [!TIP]
21
+ > Run `prompsit` with no arguments to enter the **interactive REPL** with tab completion, command history, and bundled example files in `~/.prompsit/examples/`.
36
22
 
37
- ## Usage
23
+ **Update:** `npm install -g prompsit-cli@latest`
24
+ **Uninstall:** `npm uninstall -g prompsit-cli`
38
25
 
39
- Run `prompsit` to enter interactive REPL with tab completion.
26
+ ---
40
27
 
41
- ```bash
42
- prompsit # Enter interactive REPL
43
- prompsit translate "Hello" -s "en" -t "es" # Run single command
44
- ```
28
+ ## Features
45
29
 
46
- > **Quoting rule:** All values must be quoted. Commands, subcommands, and flags stay unquoted.
30
+ | Feature | Description | Example |
31
+ |---------|-------------|---------|
32
+ | **Translate text** | Translate one or more segments with optional quality estimation | `translate "Hello" -s "en" -t "es" --qe` |
33
+ | **Translate files** | Translate documents with SSE progress tracking | `translate @"report.pdf" -s "en" -t "es"` |
34
+ | **Evaluate** | Measure translation quality (BLEU, chrF, MetricX, COMET) | `eval -s "Hello" -h "Hola" -r "Hola"` |
35
+ | **Score** | Score parallel corpora with Bicleaner-AI | `score @"corpus.tmx"` |
36
+ | **Annotate** | Add metadata to monolingual data (LID, PII, dedup, etc.) | `annotate @"data.jsonl" -l "en"` |
37
+ | **Engines** | List available translation engines by language pair | `engines -s "en" -t "es"` |
47
38
 
48
- ## Commands
39
+ Supports XLIFF, CSV, PDF, DOCX, TMX, TSV, TXT, JSONL, and more. Run `prompsit translate --formats` for the full list.
49
40
 
50
- ### Authentication
41
+ ---
51
42
 
52
- #### `login` --account "EMAIL" --secret "SECRET"
43
+ ## Commands
53
44
 
54
- Authenticate with the Prompsit API.
45
+ > [!IMPORTANT]
46
+ > **Quoting rule:** all values must be quoted. Commands, subcommands, and flags stay unquoted.
47
+ > Run `prompsit <command> --help` for the full flag reference.
55
48
 
56
- - `-a, --account "EMAIL"` Account email
57
- - `-s, --secret "SECRET"` API secret
49
+ ### Authentication
58
50
 
51
+ ```bash
52
+ prompsit login -a "EMAIL" -s "SECRET" # Authenticate
53
+ prompsit login # Open contact page (no credentials)
54
+ prompsit logout # Clear stored credentials
55
+ prompsit status # Show auth state and token expiry
59
56
  ```
60
- $ prompsit login # Open contact page
61
- $ prompsit login -a "EMAIL" -s "SECRET" # Login with credentials
62
- ```
63
-
64
- #### `logout`
65
57
 
66
- Clear stored credentials (`~/.prompsit/credentials.json`).
67
-
68
- #### `status`
69
-
70
- Show auth state, plan type, and token expiry.
71
-
72
- ---
73
-
74
- ### Configuration
75
-
76
- #### `config` [subcommand|key] [value]
77
-
78
- Interactive TUI settings screen, or manage config via subcommands.
58
+ ### Translation
79
59
 
80
- **Subcommands:**
60
+ ```bash
61
+ # Text mode
62
+ prompsit translate "Hello world" -s "en" -t "es"
63
+ prompsit translate "Hello" "Good morning" -s "en" -t "es" --qe
81
64
 
82
- - `config show` Show current configuration
83
- - `config "key"` Get a config value
84
- - `config "key" "value"` Set a config value
85
- - `config api-url ["preset_or_url"]` Switch API endpoint
86
- - `config reset [--force]` Reset to defaults
87
- - `config path` Show config file path
65
+ # File mode (@ prefix)
66
+ prompsit translate @"report.pdf" -s "en" -t "es" --output-format "docx"
67
+ prompsit translate @"file1.csv" @"file2.csv" -s "en" -t "es" --out "./translated/"
88
68
 
69
+ # Discovery
70
+ prompsit translate --languages -s "en"
71
+ prompsit translate --formats
89
72
  ```
90
- > config show
91
- > config "api-base-url"
92
- > config "api-base-url" "https://my-server.com"
93
- > config api-url "test"
94
- ```
95
-
96
- #### `language` [code]
97
73
 
98
- Set interface language.
74
+ ### Evaluation
99
75
 
76
+ ```bash
77
+ prompsit eval -s "Hello" -h "Hola" -r "Hola" # Inline
78
+ prompsit eval -s "Hello" -h "Hola" -r "Hola" -m "bleu,metricx" # Custom metrics
79
+ prompsit eval "segments.tsv" -m "bleu,chrf" # Batch from TSV
80
+ prompsit eval @"report.txt" -s "en" -t "es" # File scoring
100
81
  ```
101
- > language "es"
102
- $ prompsit language "en"
103
- $ prompsit config language
104
- ```
105
-
106
- ---
107
82
 
108
- ### Translation
109
-
110
- #### `translate` "text" --source "lang" --target "lang" [--qe]
111
-
112
- Translate text. Aliases: `t`
83
+ ### Data Processing
113
84
 
114
- - `-s, --source "lang"` Source language code
115
- - `-t, --target "lang"` Target language code
116
- - `--qe` Enable quality estimation score
85
+ ```bash
86
+ prompsit score @"corpus.tmx" # Bicleaner-AI scoring
87
+ prompsit score "corpus.tsv" --output-format "tsv" --out "results/"
117
88
 
118
- ```
119
- > "Hello world" -s "en" -t "es"
120
- > "Hello" "Good morning" "Thank you" -s "en" -t "es"
121
- > t "Hello" -s "en" -t "es" --qe
122
- $ prompsit translate "Hello world" -s "en" -t "es"
123
- $ prompsit translate "Hello" "Good morning" "Thank you" -s "en" -t "es"
89
+ prompsit annotate @"data.jsonl" -l "en" --metadata "lid,docscorer" # Monotextor annotation
90
+ prompsit annotate @"data.jsonl" -l "en" --out "results/"
91
+ prompsit annotate --metadata # List available metadata
124
92
  ```
125
93
 
126
- #### `translate` @"file..." --source "lang" --target "lang" [--out "dir"] [--output-format "fmt"]
94
+ ### Configuration
127
95
 
128
- Translate files (XLIFF, CSV, PDF, DOCX, etc.). Use `@` prefix for file mode. Alias: `t`
96
+ ```bash
97
+ prompsit config # Open interactive TUI settings screen
98
+ prompsit config show # Show current configuration
99
+ prompsit config "api-base-url" # Get a value
100
+ prompsit config "api-base-url" "URL" # Set a value
101
+ prompsit config api-url "test" # Switch API endpoint preset
102
+ prompsit language "es" # Set interface language
103
+ ```
129
104
 
130
- - `-s, --source "lang"` Source language code
131
- - `-t, --target "lang"` Target language code
132
- - `--out "dir"` Output directory (default: beside input file)
133
- - `--output-format "fmt"` Output format (e.g. docx)
105
+ ### System
134
106
 
135
- ```
136
- > t @"~/.prompsit/examples/translate/sample.xliff" -s "en" -t "es"
137
- > t @"~/.prompsit/examples/translate/sample.txt" @"~/.prompsit/examples/translate/sample.csv" -s "en" -t "es"
138
- > t @"~/.prompsit/examples/translate/sample.csv" -s "en" -t "es" --out "./translated/"
139
- > t @"report.pdf" -s "en" -t "es" --output-format "docx"
140
- $ prompsit translate @"~/.prompsit/examples/translate/sample.xliff" -s "en" -t "es"
141
- $ prompsit translate @"~/.prompsit/examples/translate/sample.csv" -s "en" -t "es" --out "./translated/"
142
- $ prompsit translate @"report.pdf" -s "en" -t "es" --output-format "docx"
143
- $ prompsit translate @"manual.md" @"notes.md" -s "en" -t "es" --output-format "docx"
144
- ```
107
+ | Command | Description |
108
+ |---------|-------------|
109
+ | `health` | API health check |
110
+ | `usage` | Show plan usage and quotas |
111
+ | `help` | Show all commands (also: `?`) |
112
+ | `clear` | Clear screen |
113
+ | `exit` | Quit REPL (also: `quit`, `q`) |
145
114
 
146
115
  ---
147
116
 
148
- ### Engines
117
+ ## FAQ
149
118
 
150
- #### `engines` [--source "lang"] [--target "lang"]
119
+ <details>
120
+ <summary><b>How do I get API credentials?</b></summary>
151
121
 
152
- List available translation engines.
122
+ Run `prompsit login` without arguments to open the contact page. You'll receive an account email and API secret from Prompsit.
153
123
 
154
- - `-s, --source "lang"` Filter by source language
155
- - `-t, --target "lang"` Filter by target language
124
+ </details>
156
125
 
157
- ```
158
- > engines
159
- > engines -s "en" -t "es"
160
- $ prompsit engines
161
- $ prompsit engines -s "en" -t "es"
162
- ```
126
+ <details>
127
+ <summary><b>REPL or CLI — which should I use?</b></summary>
163
128
 
164
- ---
129
+ **REPL** (`prompsit` with no args) — for interactive exploration. Tab completion, persistent command history, bundled examples in `~/.prompsit/examples/`, and a settings TUI (`config`).
165
130
 
166
- ### Quality Evaluation
131
+ **CLI** (`prompsit <command>`) — for scripts, pipelines, and one-off commands. Same commands, same flags.
167
132
 
168
- #### `eval` --source "src" --hypothesis "hyp" --reference "ref" [--metrics "metrics"]
133
+ </details>
169
134
 
170
- Evaluate translation quality with automatic metrics (inline mode). Alias: `e`
135
+ <details>
136
+ <summary><b>What file formats are supported?</b></summary>
171
137
 
172
- - `-s, --source "src"` Source text
173
- - `-h, --hypothesis "hyp"` Machine translation (hypothesis)
174
- - `-r, --reference "ref"` Reference translation
175
- - `-m, --metrics "metrics"` Comma-separated: bleu,chrf,metricx (default: bleu,chrf)
138
+ XLIFF, CSV, PDF, DOCX, TMX, TSV, TXT, JSONL, and others. Run `prompsit translate --formats` for the complete list. Use `--output-format` to convert between formats (e.g., PDF to DOCX).
176
139
 
177
- #### `eval` "file" [--metrics "metrics"]
140
+ </details>
178
141
 
179
- Batch evaluation from TSV file.
142
+ <details>
143
+ <summary><b>How does configuration work?</b></summary>
180
144
 
181
- #### `eval` @"file" [options]
145
+ Three-level precedence: **environment variables** (`PROMPSIT_API__BASE_URL`) > **config file** (`~/.prompsit/config.toml`) > **defaults**. Use `config show` to see active values. See [runbook](docs/project/runbook.md) for details.
182
146
 
183
- File scoring mode. Use `@` prefix.
147
+ </details>
184
148
 
185
- ```
186
- > eval -s "Hello" -h "Hola" -r "Hola"
187
- > eval -s "Hello" -h "Hola" -r "Hola" -m "bleu,chrf,metricx"
188
- > eval "segments.tsv" -m "bleu,chrf"
189
- > eval @"report.txt" -s "en" -t "es"
190
- $ prompsit eval -s "Hello" -h "Hola" -r "Hola"
191
- $ prompsit eval -s "Hello" -h "Hola" -r "Hola" -m "bleu,chrf,metricx"
192
- ```
149
+ <details>
150
+ <summary><b>How do I change the interface language?</b></summary>
193
151
 
194
- ---
152
+ ```bash
153
+ prompsit language "es" # CLI
154
+ > language "es" # REPL
155
+ ```
195
156
 
196
- ### Data Processing
157
+ Translations are fetched from the API on first use and cached in `~/.prompsit/translations/`.
197
158
 
198
- #### `score` "file" [options]
159
+ </details>
199
160
 
200
- Compute translation likelihood scores with Bicleaner-AI.
161
+ <details>
162
+ <summary><b>Command not found after install?</b></summary>
201
163
 
202
- ```
203
- > score "~/.prompsit/examples/score/sample.tmx"
204
- > score "corpus.tsv" --output-format "tsv" --out "results/"
205
- $ prompsit score "corpus.tmx" --out "results/"
164
+ ```bash
165
+ # Check global npm bin is on PATH
166
+ echo "$PATH" | tr ':' '\n' | grep '.npm-global/bin'
167
+ command -v prompsit
206
168
  ```
207
169
 
208
- #### `annotate` "file" --lang "code" [--metadata "options"] [--out "dir"]
170
+ </details>
209
171
 
210
- Annotate monolingual documents with metadata using Monotextor.
172
+ <details>
173
+ <summary><b>Something is broken — where do I start?</b></summary>
211
174
 
212
- - `-l, --lang "code"` Language code (e.g. en, es, zh-Hans)
213
- - `--metadata "options"` Metadata to add (comma-separated: lid, dedup, pii, adult_filter, monofixer, docscorer)
214
- - `--out "dir"` Output directory (default: beside input file)
175
+ 1. `prompsit health` verify API connectivity
176
+ 2. `prompsit status` check authentication state
177
+ 3. `prompsit config show` review active configuration
178
+ 4. See the [runbook](docs/project/runbook.md) for common errors and fixes
215
179
 
216
- ```
217
- > annotate @"data.jsonl" -l "en" --metadata "lid,docscorer"
218
- > annotate @"data.jsonl" -l "en" --out "results/"
219
- > annotate --metadata
220
- $ prompsit annotate @"data.jsonl" -l "en" --metadata "lid,docscorer" --out "results/"
221
- $ prompsit annotate --metadata
222
- ```
180
+ </details>
223
181
 
224
182
  ---
225
183
 
226
- ### Reference
227
-
228
- #### `formats`
229
-
230
- List supported file formats. Alias: `f`
184
+ ## Project Structure
231
185
 
232
186
  ```
233
- > formats
234
- $ prompsit formats
187
+ src/
188
+ ├── index.ts # Entry point
189
+ ├── program.ts # Commander.js program definition
190
+ ├── commands/ # CLI command handlers
191
+ ├── api/ # HTTP client (got) + Zod models + SSE
192
+ ├── config/ # Settings (Zod + smol-toml + env vars)
193
+ ├── repl/ # Interactive REPL (pi-tui)
194
+ ├── tui/ # TUI settings screen
195
+ ├── output/ # Terminal formatting (chalk + cli-table3)
196
+ ├── i18n/ # Internationalization
197
+ ├── errors/ # Error contracts
198
+ ├── cli/ # Global options, exit codes
199
+ ├── runtime/ # Platform abstractions
200
+ └── logging/ # Telemetry transport
235
201
  ```
236
202
 
237
- ---
238
-
239
- ### System
240
-
241
- | Command | Description |
242
- |---------|-------------|
243
- | `health` | API health check |
244
- | `help` | Show all commands (also: `?`) |
245
- | `clear` | Clear screen |
246
- | `exit` | Quit CLI (also: `quit`, `q`) |
203
+ > [!TIP]
204
+ > **For AI agents:** entry point is `src/index.ts` -> `src/program.ts`. Commands in `src/commands/`, REPL in `src/repl/`, config in `src/config/`. TypeScript strict, ESM-only, layered architecture (Presentation -> Application -> Domain -> Infrastructure). Full docs: [architecture.md](docs/project/architecture.md), [CLAUDE.md](CLAUDE.md).
247
205
 
248
206
  ---
249
207
 
250
- ## Configuration Reference
251
-
252
- Config file: `~/.prompsit/config.toml` | Env override: `PROMPSIT_<SECTION>__<KEY>`
253
-
254
- | Key | CLI Command | Default | Description |
255
- |-----|-------------|---------|-------------|
256
- | `api.base_url` | `config api-url` | `https://edge.prompsit.com` | API endpoint |
257
- | `api.timeout` | - | `30` | HTTP read timeout (sec) |
258
- | `cli.language` | `language "code"` | `en` | Interface language |
259
- | `cli.log_level` | `config set log-level "val"` | `INFO` | Log level |
260
-
261
- ## Data Directory: `~/.prompsit/`
262
-
263
- | Path | Purpose |
264
- |------|---------|
265
- | `config.toml` | User configuration (TOML) |
266
- | `credentials.json` | OAuth2 tokens |
267
- | `history` | REPL command history |
268
- | `translations/{lang}.json` | Interface translation cache |
269
- | `examples/translate/` | Translation examples (txt, csv, xliff) |
270
- | `examples/evaluate/` | Evaluation examples (tmx) |
271
- | `examples/score/` | Scoring examples (tmx) |
272
- | `examples/annotate/` | Annotation examples (jsonl) |
273
-
274
- ## Troubleshooting
208
+ ## Links
275
209
 
276
- See [docs/project/runbook.md](docs/project/runbook.md) for setup issues, common errors, and fixes.
210
+ | | |
211
+ |---|---|
212
+ | **Documentation** | [docs/README.md](docs/README.md) |
213
+ | **Architecture** | [docs/project/architecture.md](docs/project/architecture.md) |
214
+ | **Runbook** | [docs/project/runbook.md](docs/project/runbook.md) |
215
+ | **Contributing** | [CONTRIBUTING.md](CONTRIBUTING.md) |
216
+ | **Issues** | [GitHub Issues](https://github.com/Prompsit/prompsit-cli/issues) |
217
+ | **npm** | [prompsit-cli](https://www.npmjs.com/package/prompsit-cli) |
277
218
 
278
219
  ## License
279
220
 
280
- MIT
221
+ Apache-2.0 — [Prompsit Language Engineering, S.L.](https://www.prompsit.com/)