@meltemi/diagrams-cli 0.0.0-stage → 1.9.0

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 (163) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -2
  3. package/dist/assets-command.d.ts +16 -0
  4. package/dist/assets-command.d.ts.map +1 -0
  5. package/dist/assets-command.js +145 -0
  6. package/dist/assets-command.js.map +1 -0
  7. package/dist/assist-command.d.ts +19 -0
  8. package/dist/assist-command.d.ts.map +1 -0
  9. package/dist/assist-command.js +268 -0
  10. package/dist/assist-command.js.map +1 -0
  11. package/dist/auth-command.d.ts +14 -0
  12. package/dist/auth-command.d.ts.map +1 -0
  13. package/dist/auth-command.js +233 -0
  14. package/dist/auth-command.js.map +1 -0
  15. package/dist/bin.d.ts +3 -0
  16. package/dist/bin.d.ts.map +1 -0
  17. package/dist/bin.js +60 -0
  18. package/dist/bin.js.map +1 -0
  19. package/dist/build-command.d.ts +23 -0
  20. package/dist/build-command.d.ts.map +1 -0
  21. package/dist/build-command.js +123 -0
  22. package/dist/build-command.js.map +1 -0
  23. package/dist/cli.d.ts +46 -0
  24. package/dist/cli.d.ts.map +1 -0
  25. package/dist/cli.js +823 -0
  26. package/dist/cli.js.map +1 -0
  27. package/dist/cloud-client.d.ts +246 -0
  28. package/dist/cloud-client.d.ts.map +1 -0
  29. package/dist/cloud-client.js +591 -0
  30. package/dist/cloud-client.js.map +1 -0
  31. package/dist/cloud-command.d.ts +56 -0
  32. package/dist/cloud-command.d.ts.map +1 -0
  33. package/dist/cloud-command.js +81 -0
  34. package/dist/cloud-command.js.map +1 -0
  35. package/dist/cloud-context.d.ts +106 -0
  36. package/dist/cloud-context.d.ts.map +1 -0
  37. package/dist/cloud-context.js +185 -0
  38. package/dist/cloud-context.js.map +1 -0
  39. package/dist/cloud-errors.d.ts +37 -0
  40. package/dist/cloud-errors.d.ts.map +1 -0
  41. package/dist/cloud-errors.js +46 -0
  42. package/dist/cloud-errors.js.map +1 -0
  43. package/dist/cloud-host.d.ts +72 -0
  44. package/dist/cloud-host.d.ts.map +1 -0
  45. package/dist/cloud-host.js +129 -0
  46. package/dist/cloud-host.js.map +1 -0
  47. package/dist/cloud-manifest.d.ts +12 -0
  48. package/dist/cloud-manifest.d.ts.map +1 -0
  49. package/dist/cloud-manifest.js +21 -0
  50. package/dist/cloud-manifest.js.map +1 -0
  51. package/dist/cloud-paths.d.ts +48 -0
  52. package/dist/cloud-paths.d.ts.map +1 -0
  53. package/dist/cloud-paths.js +104 -0
  54. package/dist/cloud-paths.js.map +1 -0
  55. package/dist/credentials.d.ts +107 -0
  56. package/dist/credentials.d.ts.map +1 -0
  57. package/dist/credentials.js +243 -0
  58. package/dist/credentials.js.map +1 -0
  59. package/dist/export-command.d.ts +35 -0
  60. package/dist/export-command.d.ts.map +1 -0
  61. package/dist/export-command.js +524 -0
  62. package/dist/export-command.js.map +1 -0
  63. package/dist/import-command.d.ts +20 -0
  64. package/dist/import-command.d.ts.map +1 -0
  65. package/dist/import-command.js +254 -0
  66. package/dist/import-command.js.map +1 -0
  67. package/dist/index.d.ts +4 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +4 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/init-command.d.ts +28 -0
  72. package/dist/init-command.d.ts.map +1 -0
  73. package/dist/init-command.js +199 -0
  74. package/dist/init-command.js.map +1 -0
  75. package/dist/login-listener.d.ts +58 -0
  76. package/dist/login-listener.d.ts.map +1 -0
  77. package/dist/login-listener.js +173 -0
  78. package/dist/login-listener.js.map +1 -0
  79. package/dist/messages/en.d.ts +533 -0
  80. package/dist/messages/en.d.ts.map +1 -0
  81. package/dist/messages/en.js +803 -0
  82. package/dist/messages/en.js.map +1 -0
  83. package/dist/messages/es.d.ts +3 -0
  84. package/dist/messages/es.d.ts.map +1 -0
  85. package/dist/messages/es.js +764 -0
  86. package/dist/messages/es.js.map +1 -0
  87. package/dist/messages/index.d.ts +442 -0
  88. package/dist/messages/index.d.ts.map +1 -0
  89. package/dist/messages/index.js +42 -0
  90. package/dist/messages/index.js.map +1 -0
  91. package/dist/messages/push-pull-en.d.ts +84 -0
  92. package/dist/messages/push-pull-en.d.ts.map +1 -0
  93. package/dist/messages/push-pull-en.js +146 -0
  94. package/dist/messages/push-pull-en.js.map +1 -0
  95. package/dist/messages/push-pull-es.d.ts +7 -0
  96. package/dist/messages/push-pull-es.d.ts.map +1 -0
  97. package/dist/messages/push-pull-es.js +144 -0
  98. package/dist/messages/push-pull-es.js.map +1 -0
  99. package/dist/open-url.d.ts +11 -0
  100. package/dist/open-url.d.ts.map +1 -0
  101. package/dist/open-url.js +36 -0
  102. package/dist/open-url.js.map +1 -0
  103. package/dist/plugins-command.d.ts +15 -0
  104. package/dist/plugins-command.d.ts.map +1 -0
  105. package/dist/plugins-command.js +106 -0
  106. package/dist/plugins-command.js.map +1 -0
  107. package/dist/preview.d.ts +54 -0
  108. package/dist/preview.d.ts.map +1 -0
  109. package/dist/preview.js +249 -0
  110. package/dist/preview.js.map +1 -0
  111. package/dist/project-errors.d.ts +17 -0
  112. package/dist/project-errors.d.ts.map +1 -0
  113. package/dist/project-errors.js +85 -0
  114. package/dist/project-errors.js.map +1 -0
  115. package/dist/projects-command.d.ts +13 -0
  116. package/dist/projects-command.d.ts.map +1 -0
  117. package/dist/projects-command.js +85 -0
  118. package/dist/projects-command.js.map +1 -0
  119. package/dist/publish-command.d.ts +41 -0
  120. package/dist/publish-command.d.ts.map +1 -0
  121. package/dist/publish-command.js +311 -0
  122. package/dist/publish-command.js.map +1 -0
  123. package/dist/pull-command.d.ts +21 -0
  124. package/dist/pull-command.d.ts.map +1 -0
  125. package/dist/pull-command.js +300 -0
  126. package/dist/pull-command.js.map +1 -0
  127. package/dist/push-command.d.ts +31 -0
  128. package/dist/push-command.d.ts.map +1 -0
  129. package/dist/push-command.js +391 -0
  130. package/dist/push-command.js.map +1 -0
  131. package/dist/push-review.d.ts +16 -0
  132. package/dist/push-review.d.ts.map +1 -0
  133. package/dist/push-review.js +72 -0
  134. package/dist/push-review.js.map +1 -0
  135. package/dist/push-set.d.ts +126 -0
  136. package/dist/push-set.d.ts.map +1 -0
  137. package/dist/push-set.js +289 -0
  138. package/dist/push-set.js.map +1 -0
  139. package/dist/push-validation.d.ts +20 -0
  140. package/dist/push-validation.d.ts.map +1 -0
  141. package/dist/push-validation.js +70 -0
  142. package/dist/push-validation.js.map +1 -0
  143. package/dist/redact.d.ts +9 -0
  144. package/dist/redact.d.ts.map +1 -0
  145. package/dist/redact.js +22 -0
  146. package/dist/redact.js.map +1 -0
  147. package/dist/review-command.d.ts +44 -0
  148. package/dist/review-command.d.ts.map +1 -0
  149. package/dist/review-command.js +348 -0
  150. package/dist/review-command.js.map +1 -0
  151. package/package.json +56 -3
  152. package/templates/c4/diagrams/views.meltemi +16 -0
  153. package/templates/c4/models/system.meltemi +23 -0
  154. package/templates/ci/github.yml +96 -0
  155. package/templates/ci/gitlab.yml +53 -0
  156. package/templates/flow/diagrams/overview.meltemi +15 -0
  157. package/templates/free/diagrams/slide.meltemi +39 -0
  158. package/templates/purchase/diagrams/architecture.meltemi +36 -0
  159. package/templates/purchase/diagrams/executive.meltemi +52 -0
  160. package/templates/purchase/diagrams/payment.meltemi +42 -0
  161. package/templates/purchase/models/commerce.meltemi +30 -0
  162. package/templates/purchase/stories/purchase.meltemi +38 -0
  163. package/templates/sequence/diagrams/sign-in.meltemi +36 -0
@@ -0,0 +1,803 @@
1
+ /**
2
+ * The command line's words in English: help, usage errors, messages, summaries, progress and
3
+ * prompts, in the interface language; and the words of the review report, in the language of the
4
+ * files a command writes. Commands, options, values, file names and codes are not words and stay as
5
+ * written. Sentences with values are functions, so each language builds its own grammar.
6
+ */
7
+ import { pushPullEn } from "./push-pull-en.js";
8
+ /** A list of ids or names, or "none" when it is empty. */
9
+ const listOrNone = (items) => items.join(", ") || "none";
10
+ const quoted = (ids) => ids.map((id) => `"${id}"`).join(", ");
11
+ const count = (n, one, many = `${one}s`) => `${n} ${n === 1 ? one : many}`;
12
+ export const en = {
13
+ /** The help of the command line and of each command. */
14
+ help: {
15
+ /** `meltemi-diagrams --help`: the command's name and its short alias. */
16
+ main: (name, alias) => `Usage: ${name} <command> [options]
17
+ Alias: ${alias}
18
+
19
+ Commands:
20
+ init [folder] Create a project from a template (--list shows them)
21
+ validate <path>... Check .meltemi files and projects
22
+ preview [path] Serve the project's catalog and rebuild it as files change
23
+ format <path>... Rewrite .meltemi files and projects in the canonical layout
24
+ import <path> Import Mermaid, PlantUML or Markdown files into .meltemi sheets
25
+ export <path> Render the diagrams, stories or profiles of a file or a folder
26
+ layout <file.meltemi> Arrange a file's diagrams with ELK and write the positions
27
+ convert <file.meltemi> Copy a flow diagram, as drawn, into a new free diagram, or write its
28
+ model JSON
29
+ build catalog [path] Write the offline HTML catalog of a project's diagrams and stories
30
+ review [path] List what changed since a Git revision or another version, by id
31
+ assist <operation> Optional AI help: generate, modify, relations, explain, apply
32
+ assets <subcommand> List icon packs and fonts, search icons, write assets.lock.json
33
+ plugins [path] List the plugins a project installs, what they add, and their problems
34
+ push [folder] Make the cloud project match the folder (--create, --force, --check)
35
+ pull [id] [folder] Write a cloud project's files into a folder (--version, --force)
36
+ login Sign in to the cloud service in your browser (--no-browser, --token)
37
+ logout Revoke the stored cloud token and forget it
38
+ whoami Print the name and handle you are signed in as
39
+ publish [folder] Publish the catalog as a web page of the cloud service (--unpublish)
40
+ projects List your cloud projects: id, name, role, last change (--json)
41
+
42
+ Every command takes --lang en|es: the language of its messages and of the words it adds to the
43
+ files it writes (the project's "locale" otherwise; messages follow MELTEMI_LANG or LANG).
44
+
45
+ Options for init:
46
+ --template <name> flow (default), c4, sequence, free or purchase
47
+ --name <name> The project's name; the folder's name by default
48
+ --list List the templates
49
+ --ci <service> Also write a CI workflow: github or gitlab
50
+ --cloud With --ci: the workflow also pushes to the cloud on the default branch
51
+
52
+ Options for validate:
53
+ --json Print one JSON object with all diagnostics
54
+ --strict Treat warnings as errors for the exit code
55
+
56
+ Options for export:
57
+ --diagram <id> Export only this diagram
58
+ --scenario <id> Export one scenario of the sequence diagrams that declare it
59
+ --story <id> A story instead: its end, the frame at --at, or its player
60
+ --format <name> svg (default), png, pdf, html (the player), mp4, webm or gif; PNG,
61
+ PDF and video use the installed Edge or Chrome, video also FFmpeg
62
+ --profile <id> Run one export profile of the file; --profiles runs them all
63
+ --out <path> Output file (one output) or a directory; a folder's outputs
64
+ keep their folders under it
65
+ --stdout Print the SVG or HTML of one output instead of writing a file
66
+ --theme <name> Render with this theme instead of the diagram's own
67
+ --fonts <policy> SVG and HTML text: embedded fonts (default), outlined or system
68
+ --motion <mode> SVG effects: static (default, none drawn) or animated (CSS)
69
+ --at <time> Write the frame at this time, such as 600ms or 1.5s
70
+ --scale <n> PNG pixels per unit, 1 to 8 (default 2)
71
+ --size <w>x<h> PNG, PDF and video size; the picture is fitted and centred
72
+ (videos: 1920x1080, GIF 960x540 by default)
73
+ --fps <n> Video frames per second, 1 to 60 (30, GIF 15 by default)
74
+ --duration <time> Video length; the story's, or the effects' end by default
75
+ --background <colour> transparent, a colour token or a CSS colour (not for HTML)
76
+ --link <url> The whole picture links to this URL (SVG and PDF)
77
+ --embed With --format html, a fragment to paste into a page
78
+
79
+ Options for layout:
80
+ --diagram <id> Arrange only this diagram
81
+ --all Arrange every element anew; without it only unplaced elements move
82
+ --check Write nothing; list diagrams that would change (exit 1 if any)
83
+ --stdout Print the arranged text instead of writing the file
84
+
85
+ Options for convert:
86
+ --to free|json free: copy a flow diagram into a free one; json: write the model JSON
87
+ (<stem>.model.json beside the file, the interchange format)
88
+ --out <file> With --to json, write the JSON here
89
+ --diagram <id> The flow diagram to copy; needed when the file has several
90
+ --id <id> Id of the copy; <diagram>_free by default
91
+ --check Write nothing; say what would be added (exit 1)
92
+ --stdout Print the converted text instead of writing the file
93
+
94
+ Options for format:
95
+ --check Write nothing; list files that would change (exit 1 if any)
96
+ --stdout Print the formatted text of one file instead of writing it
97
+
98
+ Options for import:
99
+ --from <format> mermaid, plantuml or markdown, when the extension does not say
100
+ --out <file> Write the sheet here instead of <stem>.meltemi beside the source
101
+ --force Replace an existing sheet
102
+ --merge Re-import into an existing sheet, keeping its placement and styles
103
+ --check Write nothing; report what the import would do
104
+ --json Print one JSON object with the result
105
+
106
+ Options for build catalog:
107
+ --out <path> A folder (for index.html) or a .html file; catalog/ by default
108
+ --title <text> The catalog's title instead of the project's
109
+ --source Include the text of each catalogued file (comments included)
110
+
111
+ Options for preview:
112
+ --port <n> The port, 4317 by default; 0 picks a free one
113
+ --open Open the preview in the default browser
114
+
115
+ Options for review:
116
+ --base <revision> The version before, from Git (HEAD by default); cloud, or cloud:<n>
117
+ for the cloud project's files now, or its version n
118
+ --before <path> The version before, from another folder or file
119
+ --project <id> With --base cloud: the cloud project, instead of the manifest's
120
+ --host <url> With --base cloud: the service, as for login
121
+ --out <folder> Write index.html with before and after pictures of changed diagrams
122
+ --json Print one JSON object
123
+ --exit-code Exit 1 when something changed
124
+
125
+ Options for push:
126
+ --create Make a new cloud project from the folder and record it in project.json
127
+ --name <name> With --create, the project's name; project.json's name by default
128
+ --project <id> The cloud project, instead of project.json's "cloud" setting
129
+ --force Overwrite what differs in the cloud without asking
130
+ --check Write nothing; list what differs (exit 1 if anything does)
131
+ --strict Do not push when validation finds errors
132
+ --host <url> The service, as for login
133
+
134
+ Options for pull:
135
+ --version <n> Pull this version of the project instead of its latest files
136
+ --force Overwrite files that differ in the folder
137
+ --host <url> The service, as for login
138
+
139
+ Options for login:
140
+ --host <url> The service: MELTEMI_HOST, else https://diagrams.meltemi.dev
141
+ --no-browser Print the approval address instead of opening it
142
+ --token Read an API token from standard input instead of using the browser
143
+
144
+ Options for logout and whoami:
145
+ --host <url> The service, as for login
146
+
147
+ Options for publish:
148
+ --slug <name> The page's name in its address; the project's name by default
149
+ --handle <name> The handle the address starts with; needed for the first publication
150
+ --unpublish Remove the page --slug names instead of publishing it
151
+ --project <id> The cloud project, instead of the manifest's cloud.project
152
+ --host <url> The service, as for login
153
+ --force Push the folder without asking when it differs from the cloud project
154
+ --strict Publish nothing while the project has errors
155
+
156
+ Options for projects:
157
+ --json Print one JSON object
158
+ --host <url> The service, as for login
159
+
160
+ Operations of assist (see assist --help):
161
+ generate <file> A new sheet from --prompt
162
+ modify <file> Changes as --prompt asks, as a proposal to accept in part
163
+ relations <file> Probably missing relations, marked as assumptions
164
+ explain [path] What changed since a Git revision, explained
165
+ apply <proposal> Apply items of a saved proposal
166
+
167
+ Subcommands of assets:
168
+ list [path] Icon packs, aliases and fonts with versions, sources and licences
169
+ icons <words> Icon references matching every word (--project <path>, --limit <n>)
170
+ lock [path] Write assets.lock.json at the project root
171
+
172
+ Options:
173
+ -h, --help Show this help
174
+ -v, --version Show the version
175
+
176
+ Exit codes: 0 no errors, 1 errors found, 2 usage error or unreadable path. For import: 0
177
+ complete, 1 partial, 2 usage error, unsupported input or an existing sheet. For the cloud
178
+ commands: 3 not signed in, or the service refused the token (run login).
179
+ `,
180
+ /** `init --help`: the template names, joined. */
181
+ init: (templates) => `Usage: init [folder] [options]
182
+
183
+ Creates a project in the folder (the working folder by default): project.json and the sheets of
184
+ a template. Nothing that exists is replaced.
185
+
186
+ Options:
187
+ --template <name> ${templates} (flow by default)
188
+ --name <name> The project's name; the folder's name by default
189
+ --list List the templates
190
+ --ci <service> Also write a CI workflow that validates, reviews pull requests and builds
191
+ the catalog: github or gitlab. In an existing project, only the workflow.
192
+ --cloud With --ci: the workflow also has a job that pushes the project to the cloud
193
+ service on the default branch, with --force --strict (CI cannot answer a
194
+ question). The token is the CI secret MELTEMI_TOKEN; it is never written
195
+ in the file.
196
+ `,
197
+ import: `Usage: import <file or folder> [options]
198
+
199
+ Imports a Mermaid (.mmd, .mermaid), PlantUML (.puml, .plantuml, .pu, .iuml, .wsd) or Markdown
200
+ (.md) file into a .meltemi sheet beside it. A folder imports every such file below it (PlantUML
201
+ .iuml includes are read through the files that include them; Markdown files without diagrams are
202
+ passed over). The sources are never changed.
203
+
204
+ Options:
205
+ --from <format> mermaid, plantuml or markdown, when the extension does not say (one file)
206
+ --out <path> One file: write the sheet here. A folder: write the sheets under this
207
+ folder, keeping the sources' folders
208
+ --force Replace existing sheets
209
+ --merge Re-import into existing sheets, keeping their placement and styles
210
+ --check Write nothing; report what the import would do
211
+ --json Print one JSON object with the result
212
+
213
+ Exit codes: 0 complete, 1 partial (something essential was not imported), 2 usage error,
214
+ unreadable or unsupported input, or an existing sheet without --force or --merge.
215
+ `,
216
+ review: `Usage: review [path] [options]
217
+
218
+ Compares two versions of a project, a folder or a file (the working folder by default) and lists
219
+ what changed by id: diagrams, elements, relations, entities, stories, scenes, themes and export
220
+ profiles. A changed id whose element kept its kind, label, place or relations is a rename, not a
221
+ removal and an addition.
222
+
223
+ Options:
224
+ --base <revision> The version before: a Git commit, branch or tag (HEAD by default); or the
225
+ cloud project: cloud for its files now, cloud:<n> for its version n
226
+ --before <path> The version before: another folder or file, instead of Git
227
+ --project <id> With --base cloud: the cloud project, instead of the manifest's cloud.project
228
+ --host <url> With --base cloud: the service (MELTEMI_HOST, else https://diagrams.meltemi.dev)
229
+ --out <folder> Write index.html and before and after pictures of every changed diagram
230
+ --json Print one JSON object
231
+ --exit-code Exit 1 when something changed
232
+
233
+ Exit codes: 0 compared, 1 changes with --exit-code, or the cloud project cannot be read, 2 usage
234
+ error or unreadable versions, 3 not signed in (--base cloud).
235
+ `,
236
+ assets: `Usage: assets <subcommand>
237
+
238
+ Subcommands:
239
+ list [path] Icon packs, aliases and fonts of the project, with their licences
240
+ icons <query> [--project <p>] Icon references whose name or tags contain every word
241
+ (--limit <n>, default 50)
242
+ lock [path] Write assets.lock.json with versions, licences and hashes
243
+ `,
244
+ plugins: `Usage: plugins [path] [--json]
245
+
246
+ Lists the plugins the project that contains path installs (the working folder by default): their
247
+ versions, the permissions granted, the diagram types and icon packs they contribute, their licence
248
+ and origin, and their problems. Plugins are data; their code is never run.
249
+ `,
250
+ build: `Usage: build catalog [path] [options]
251
+
252
+ Writes the offline HTML catalog of the project that contains path (the working folder by
253
+ default): its diagrams and stories by folder, with the player, search and links, in one file.
254
+
255
+ Options:
256
+ --out <path> A folder (which receives index.html) or a .html file; the project's
257
+ catalog.out, or catalog/ under the project root, by default
258
+ --title <text> The catalog's title instead of catalog.title or the project's name
259
+ --source Include the text of each catalogued file (comments included)
260
+ `,
261
+ preview: `Usage: preview [path] [options]
262
+
263
+ Serves the catalog of the project that contains path (the working folder by default) at
264
+ http://127.0.0.1:4317/ and builds it again whenever a source, project.json or an asset changes;
265
+ open pages reload where they were. A file opens on its first diagram. Ctrl+C stops it.
266
+
267
+ Options:
268
+ --port <n> The port, 4317 by default; 0 picks a free one
269
+ --open Open the preview in the default browser
270
+ `,
271
+ assist: `Usage: assist <operation> [path] [options]
272
+
273
+ Optional AI assistance (decision 0029). Every answer becomes a proposal of whole blocks, checked
274
+ against the project, that you accept in part or in full; nothing is written without --apply.
275
+ What a request sends is listed first and needs your yes, or --yes.
276
+
277
+ Operations:
278
+ generate <file> Write a new sheet from --prompt
279
+ modify <file> Change a sheet as --prompt asks
280
+ relations <file> Suggest relations that are probably missing, marked as assumptions
281
+ explain [path] Explain what changed since a Git revision or another version
282
+ apply <proposal> Apply items of a saved proposal (--items 1,3; all by default)
283
+
284
+ Options:
285
+ --prompt <text> What to do (generate, modify; an optional focus for relations)
286
+ --profile <name> generate: flow, c4, sequence or free
287
+ --block <block> relations: one block, such as "diagram checkout"
288
+ --save <file> Save the proposal as JSON, to apply later
289
+ --apply <items> Apply the proposal at once: all, or a list such as 1,3
290
+ --items <items> apply: the items to apply (all by default)
291
+ --base <revision> explain: the version before, from Git (HEAD by default)
292
+ --before <path> explain: the version before, from another folder or file
293
+ --provider <name> anthropic or openai-compatible (or MELTEMI_AI_PROVIDER)
294
+ --model <name> The model (or MELTEMI_AI_MODEL; claude-opus-5-5 for Anthropic)
295
+ --base-url <url> The endpoint (or MELTEMI_AI_BASE_URL), such as http://127.0.0.1:11434/v1
296
+ --yes Send without asking; what is sent is still listed
297
+ --json Print the proposal as JSON
298
+
299
+ Keys come from the environment only: ANTHROPIC_API_KEY, or MELTEMI_AI_API_KEY. Validation,
300
+ layout and export never use assistance.
301
+
302
+ Exit codes: 0 done, 1 a proposal that cannot be applied or a provider error, 2 usage error or
303
+ nothing sent.
304
+ `,
305
+ push: pushPullEn.help.push,
306
+ pull: pushPullEn.help.pull,
307
+ login: `Usage: login [options]
308
+
309
+ Signs in to the cloud service. The browser opens at the service's approval page; the one-time code
310
+ it hands back reaches this computer only (127.0.0.1, a random port) and is exchanged for an API
311
+ token, which is kept in the configuration folder, one per service, readable by you alone where the
312
+ system has such permissions. The six characters printed first are the ones the approval page
313
+ shows: approve the request only when they match. MELTEMI_TOKEN in the environment takes
314
+ precedence over the stored token and over this command.
315
+
316
+ Options:
317
+ --host <url> The service: MELTEMI_HOST, else https://diagrams.meltemi.dev
318
+ --no-browser Print the approval address instead of opening it
319
+ --token Read an API token from standard input (never from an argument) instead of using
320
+ the browser: for machines without one
321
+
322
+ Exit codes: 0 signed in, 1 it failed or nothing was stored, 2 usage error, 3 the service refused
323
+ the token.
324
+ `,
325
+ logout: `Usage: logout [--host <url>]
326
+
327
+ Revokes the stored token at the service and forgets it. A token the service no longer knows is
328
+ forgotten as well. When the service cannot be reached nothing is forgotten, so that the token can
329
+ be revoked later (or on the account page). MELTEMI_TOKEN is never revoked or changed.
330
+
331
+ Exit codes: 0 signed out (or never signed in), 1 the token could not be revoked, 2 usage error.
332
+ `,
333
+ whoami: `Usage: whoami [--host <url>]
334
+
335
+ Prints the name and handle the token belongs to, and the service it was checked with. The token
336
+ itself is never printed.
337
+
338
+ Exit codes: 0 signed in, 1 the service could not be reached, 2 usage error, 3 not signed in or the
339
+ token was refused.
340
+ `,
341
+ publish: `Usage: publish [folder] [options]
342
+
343
+ Publishes the catalog of the project in the folder (the working folder by default) as a web page of
344
+ the cloud service: the catalog "build catalog" writes, sent for the cloud project the manifest's
345
+ "cloud" names (or --project). The folder is pushed first when it differs from the cloud project,
346
+ with the same question as push. The first publication needs a handle, the first part of every
347
+ address you publish under; it is public. Give --handle, or answer the question in a terminal.
348
+ Published pages are public.
349
+
350
+ Options:
351
+ --slug <name> The page's name in its address: 1 to 60 lowercase letters, digits and hyphens
352
+ (the project's name, simplified, by default)
353
+ --handle <name> Your handle: 3 to 30 lowercase letters, digits and hyphens; needed once
354
+ --unpublish Remove the page --slug names instead of publishing it (nothing is built)
355
+ --project <id> The cloud project, instead of the manifest's cloud.project
356
+ --host <url> The service: MELTEMI_HOST, else https://diagrams.meltemi.dev
357
+ --force When the folder differs from the cloud project, push without asking
358
+ --strict Push and publish nothing while the project has errors
359
+
360
+ Exit codes: 0 published (or removed), 1 refused or failed, 2 usage error, 3 not signed in or the
361
+ token was refused.
362
+ `,
363
+ projects: `Usage: projects [options]
364
+
365
+ Lists the cloud projects you can open: id, name, your role (owner, editor or viewer) and the time
366
+ of the last change, the most recent first.
367
+
368
+ Options:
369
+ --json Print one JSON object: host and projects, each with id, name, description, role
370
+ and updated_at
371
+ --host <url> The service: MELTEMI_HOST, else https://diagrams.meltemi.dev
372
+
373
+ Exit codes: 0 listed, 1 the service could not be reached, 2 usage error, 3 not signed in or the
374
+ token was refused.
375
+ `,
376
+ },
377
+ /** Usage errors and messages that several commands share. */
378
+ common: {
379
+ /** `--lang` with another value. */
380
+ lang: "--lang must be en or es.",
381
+ /** The command `meltemi-diagrams frobnicate`: the program's name and the command. */
382
+ unknownCommand: (name, command) => `${name}: unknown command "${command}". Run "${name} --help".`,
383
+ /** An error the program did not expect, with its message. */
384
+ internalError: (name, message) => `${name}: internal error: ${message}`,
385
+ /** The word before each hint of a diagnostic: ` hint: Declare it first…`. */
386
+ hint: "hint",
387
+ /** A file or folder that cannot be read, with the system's reason when there is one. */
388
+ cannotRead: (path, reason) => `cannot read ${path}${reason === undefined ? "" : `: ${reason}`}`,
389
+ cannotWrite: (path, reason) => `cannot write ${path}: ${reason}`,
390
+ pathNotFound: (path) => `path not found: ${path}`,
391
+ wrote: (path) => `Wrote ${path}`,
392
+ atLeastOnePath: "give at least one file or directory.",
393
+ oneMeltemiFile: "give exactly one .meltemi file.",
394
+ oneProject: "give one project folder or file.",
395
+ oneProjectFolderOrFile: "give one project folder, folder or file.",
396
+ cannotCombine: (first, second) => `${first} cannot be combined with ${second}.`,
397
+ /** A diagram id that a file does not have, and the ids it has. */
398
+ noDiagram: (id, path, available) => `no diagram named "${id}" in ${path}; available: ${listOrNone(available)}.`,
399
+ /**
400
+ * Errors in the arguments, by Node's error code: `message` is Node's own text, which English
401
+ * keeps, and `name` the option or argument it names (`--diagram <value>`, `--check`).
402
+ */
403
+ arguments: {
404
+ unknownOption: (message, _name) => message,
405
+ missingValue: (message, _name) => message,
406
+ noValue: (message, _name) => message,
407
+ ambiguous: (message, _name) => message,
408
+ unexpected: (message, _name) => message,
409
+ },
410
+ },
411
+ validate: {
412
+ /** The last line: files, errors and warnings. */
413
+ summary: (files, errors, warnings) => `Checked ${count(files, "file")}: ${count(errors, "error")}, ${count(warnings, "warning")}.`,
414
+ },
415
+ layout: {
416
+ sequence: (id) => `"${id}" is a sequence diagram, which has no positions to write.`,
417
+ cannotWrite: (id, reason) => `cannot write the positions of "${id}": ${reason}`,
418
+ unchanged: (path) => `${path}: every position is already written.`,
419
+ wouldArrange: (ids, path) => `Would arrange ${quoted(ids)} in ${path}`,
420
+ arranged: (ids, path) => `Arranged ${quoted(ids)} in ${path}`,
421
+ },
422
+ convert: {
423
+ giveTo: "give --to free (a flow diagram copied into a free one) or --to json.",
424
+ outWithJson: "--out goes with --to json; free copies are written in place.",
425
+ noFlowDiagram: (id, path, available) => `no flow diagram named "${id}" in ${path}; flow diagrams: ${listOrNone(available)}.`,
426
+ noFlow: (path) => `${path} has no flow diagram.`,
427
+ severalFlows: (path, ids) => `${path} has ${ids.length} flow diagrams (${ids.join(", ")}); choose one with --diagram.`,
428
+ cannotDraw: (id) => `"${id}" cannot be drawn, so it cannot be copied.`,
429
+ wouldConvert: (id, copy, path) => `Would convert "${id}" to "${copy}" in ${path}`,
430
+ converted: (id, copy, path) => `Converted "${id}" to "${copy}" in ${path}`,
431
+ /** An option that `--to json` does not take, such as `--diagram`. */
432
+ notForJson: (option) => `${option} does not apply to --to json.`,
433
+ wroteJson: (source, target, ok) => `Wrote the model JSON of ${source} to ${target}${ok ? "" : " (with errors; see diagnostics)"}`,
434
+ },
435
+ format: {
436
+ stdoutOne: "--stdout formats exactly one file and cannot be combined with --check.",
437
+ stdoutOneFile: "--stdout formats exactly one file.",
438
+ /** The message of `format.syntax-errors`. */
439
+ syntaxErrors: "The file has syntax errors and was not formatted.",
440
+ wouldFormat: (path) => `Would format ${path}`,
441
+ formatted: (path) => `Formatted ${path}`,
442
+ checkedAll: (files) => `Checked ${count(files, "file")}: all formatted.`,
443
+ checked: (files, changed, refused) => `Checked ${count(files, "file")}: ${changed} would be formatted, ${refused} refused.`,
444
+ summary: (changed, files) => `Formatted ${changed} of ${count(files, "file")}.`,
445
+ },
446
+ export: {
447
+ /** A picture written with a browser, named with its version. */
448
+ wroteViews: (path, views) => `Wrote ${path} (${views} views)`,
449
+ wrotePicture: (path, browser) => `Wrote ${path} (${browser})`,
450
+ wroteVideo: (path, browser, ffmpeg, frames) => `Wrote ${path} (${browser}, FFmpeg ${ffmpeg}, ${frames} frames)`,
451
+ /** `export.no-diagram`, with the types of the blocks that are not diagram types. */
452
+ noDiagram: (types) => types.length > 0
453
+ ? `No diagram to export; \`${types.join("`, `")}\` is not a diagram type of the language.`
454
+ : "No diagram to export.",
455
+ noDiagramStoriesHint: "Export a story with `--story <id>`, or the file's profiles with `--profiles`.",
456
+ noDiagramTypesHint: "`diagram <id>: flow { ... }`, `free`, `sequence` and `c4` diagrams render.",
457
+ onePath: "give exactly one .meltemi file or project folder.",
458
+ profileOrProfiles: "--profile runs one profile and --profiles all of them; choose one.",
459
+ profileOption: (option) => `profiles set their own options; ${option} does not go with --profile or --profiles.`,
460
+ profilesOut: "with profiles, --out is an existing directory for their files.",
461
+ format: (format, formats) => `format "${format}" is not supported; use ${formats.join(", ")}.`,
462
+ fonts: (fonts, policies) => `--fonts must be one of ${policies.join(", ")}, not "${fonts}".`,
463
+ motion: (motion, modes) => `--motion must be one of ${modes.join(", ")}, not "${motion}".`,
464
+ at: (at) => `--at takes a time such as 600ms or 1.5s, not "${at}".`,
465
+ atAnimated: "--at writes one frame; it cannot be combined with --motion animated.",
466
+ story: (option) => `--story writes one frame of a story; it cannot be combined with ${option}.`,
467
+ html: (option) => `--format html writes a player; it cannot be combined with ${option}.`,
468
+ embed: "--embed writes a player fragment; it needs --format html.",
469
+ picture: (format) => `--format ${format} writes one picture; it cannot be combined with --motion animated.`,
470
+ video: (format, option) => `--format ${format} writes a video; it cannot be combined with ${option}.`,
471
+ stdoutFile: (format) => `--format ${format} writes a file; --stdout prints text formats only.`,
472
+ fpsVideo: "--fps sets the frames per second of MP4, WebM and GIF exports.",
473
+ fps: (fps) => `--fps takes a whole number from 1 to 60, not "${fps}".`,
474
+ durationVideo: "--duration sets the length of MP4, WebM and GIF exports.",
475
+ duration: (duration) => `--duration takes a time up to 600s, such as 5s, not "${duration}".`,
476
+ scalePng: "--scale sets the pixels of PNG exports.",
477
+ scale: (scale) => `--scale takes 1 to 8, not "${scale}".`,
478
+ sizeOutput: "--size sets the output of PNG, PDF and video exports.",
479
+ size: (max, size) => `--size takes WIDTHxHEIGHT from 16 to ${max}, such as 1920x1080, not "${size}".`,
480
+ backgroundHtml: "--background does not apply to HTML players.",
481
+ background: (background) => `--background takes transparent, a colour token or a CSS colour, not "${background}".`,
482
+ mp4Transparent: "MP4 has no transparency; choose a colour, or --format webm.",
483
+ linkFormats: "--link applies to SVG and PDF exports.",
484
+ link: (link) => `--link takes an https:, http: or mailto: URL, or a relative one, not "${link}".`,
485
+ oneFile: (option) => `${option} works on one file; give a .meltemi file, not a folder.`,
486
+ noProfiles: (path) => `${path} has no export profiles.`,
487
+ noProfile: (id, path, available) => `no profile named "${id}" in ${path}; available: ${listOrNone(available)}.`,
488
+ noStory: (id, path, available) => `no story named "${id}" in ${path}; available: ${listOrNone(available)}.`,
489
+ noScenario: (id, path, available) => `no scenario named "${id}" in ${path}; available: ${listOrNone(available)}.`,
490
+ stdoutOne: "--stdout prints one diagram; choose it with --diagram.",
491
+ severalDiagrams: (path, diagrams) => `${path} has ${diagrams} diagrams; --out must be an existing directory or --diagram must choose one.`,
492
+ noFiles: (folder) => `${folder} has no .meltemi files.`,
493
+ noFileWithProfile: (folder, id) => `no file in ${folder} has a profile named "${id}".`,
494
+ },
495
+ import: {
496
+ oneSource: "give exactly one file or folder to import.",
497
+ from: (from, formats) => `--from must be ${formats.join(", ")}, not "${from}".`,
498
+ forceAndMerge: "--force and --merge cannot be combined.",
499
+ fromInFolder: "--from applies to one file; in a folder each file's extension says its format.",
500
+ noSources: (folder) => `${folder} has no Mermaid, PlantUML or Markdown files.`,
501
+ replacesSource: "the output would replace the source.",
502
+ exists: (path) => `${path} exists; pass --merge to re-import keeping its adjustments, or --force to replace it.`,
503
+ nothing: (source) => `nothing was imported from ${source}.`,
504
+ /** The status of an import, as the report names it. */
505
+ status: { complete: "complete", partial: "partial", failed: "failed" },
506
+ /** What happened to the constructs of one imported diagram. */
507
+ coverage: (diagram, mapped, approximated, dropped) => `${diagram}: ${mapped} mapped, ${approximated} approximated, ${dropped} dropped`,
508
+ wouldImport: (source, out, status) => `Would import ${source} → ${out} (${status})`,
509
+ imported: (source, out, status, merged) => `Imported ${source} → ${out} (${status}${merged ? ", merged" : ""})`,
510
+ /** The parts of a folder's summary, by status. */
511
+ folder: {
512
+ complete: (n) => `${n} complete`,
513
+ partial: (n) => `${n} partial`,
514
+ failed: (n) => `${n} failed`,
515
+ notReplaced: (n) => `${n} not replaced`,
516
+ withoutDiagrams: (n) => `${n} without diagrams`,
517
+ },
518
+ /** The summary of a folder: the files, the folder and the parts above. */
519
+ folderSummary: (check, files, folder, parts) => `${check ? "Would import" : "Imported"} ${count(files, "file")} from ${folder}: ${parts.join(", ")}`,
520
+ },
521
+ init: {
522
+ /** What each template holds, as `init --list` prints it. */
523
+ templates: {
524
+ flow: "A flow diagram to start from",
525
+ c4: "An architecture model with a context view and a container view",
526
+ sequence: "A sequence diagram with a scenario for each outcome",
527
+ free: "A slide composed freely: text, boxes, an icon and a group",
528
+ purchase: "The reference example: a model, its C4 views, a payment sequence, an executive slide, an animated story and export profiles",
529
+ },
530
+ exists: (path) => `${path} exists; it is not replaced.`,
531
+ gitlab: `.gitlab-ci.yml exists; add the job with:\n include:\n - local: .gitlab/meltemi-diagrams.yml\n`,
532
+ oneFolder: "give one folder.",
533
+ noTemplate: (template, templates) => `no template named "${template}"; use ${templates.join(", ")}.`,
534
+ ci: (ci, services) => `--ci takes ${services.join(" or ")}, not "${ci}".`,
535
+ /** `--cloud` without `--ci`: it only changes the workflow. */
536
+ cloudNeedsCi: (services) => `--cloud adds a job to the CI workflow; give --ci ${services.join(" or ")} with it.`,
537
+ /** After a workflow with the push job: where its token comes from, and why `--force`. */
538
+ cloudNote: (secret) => `The workflow pushes to the cloud on the default branch with --force --strict, because CI cannot answer a question. Add ${secret} to the CI's secrets: create the token in the page, under API tokens in the account menu.`,
539
+ name: "--name needs some text.",
540
+ notAFolder: (path) => `${path} is a file, not a folder.`,
541
+ alreadyAProject: (path) => `${path} is already a project; --ci adds a workflow to it.`,
542
+ clash: (path) => `${path} exists; nothing was written.`,
543
+ created: (path) => `Created ${path}`,
544
+ next: "Next:",
545
+ },
546
+ assets: {
547
+ unknownSubcommand: (subcommand) => `unknown subcommand "${subcommand}"; use list, icons or lock.`,
548
+ noLicence: "no licence",
549
+ /** The number of icons of a pack. */
550
+ icons: (n) => `${n} icons`,
551
+ noRedistribution: "redistribute: no",
552
+ noEmbedding: "embedding: no",
553
+ packs: "Icon packs:",
554
+ aliases: "Aliases:",
555
+ fonts: "Fonts:",
556
+ noWords: "give words to search for.",
557
+ limit: "--limit must be a positive whole number.",
558
+ noMatch: (query) => `No icon matches "${query}".`,
559
+ },
560
+ plugins: {
561
+ none: "The project installs no plugins.",
562
+ notLoaded: (name, version) => `${name} ${version} — not loaded (see the problems below)`,
563
+ from: (homepage) => ` from ${homepage}`,
564
+ folder: (path, granted) => ` folder ${path}; granted: ${granted.join(", ") || "nothing"}`,
565
+ type: (type, title, kinds) => ` diagram type ${type} (${title}): ${kinds.join(", ")}`,
566
+ icons: (name) => ` icon pack ${name}`,
567
+ },
568
+ build: {
569
+ unknownTarget: (target) => `unknown target "${target}"; the only one is catalog.`,
570
+ title: "--title needs some text.",
571
+ skipped: (entry, reason) => `skipped ${entry}: ${reason}.`,
572
+ warning: (warning) => `warning: ${warning}`,
573
+ empty: (root) => `${root} has no diagram or story to catalog.`,
574
+ /** What a catalog holds, as the line that names the file lists it. */
575
+ diagrams: (n) => count(n, "diagram"),
576
+ stories: (n) => count(n, "story", "stories"),
577
+ entities: (n) => count(n, "entity", "entities"),
578
+ wrote: (path, parts, size) => `Wrote ${path} (${parts.join(", ")}; ${size})`,
579
+ },
580
+ preview: {
581
+ /** Answers of the preview server to a browser. */
582
+ onlyHere: "The preview answers only on this machine.",
583
+ notFound: "Not found.",
584
+ skipped: (entry, reason) => `Skipped ${entry}: ${reason}.`,
585
+ /** A build of the catalog: its diagrams and stories, and the time. */
586
+ built: (diagrams, stories, time) => `Built ${count(diagrams, "diagram")} and ${count(stories, "story", "stories")} at ${time}`,
587
+ port: (port) => `--port takes a whole number from 0 to 65535, not "${port}".`,
588
+ serving: (url) => `Previewing at ${url} (Ctrl+C to stop)`,
589
+ portInUse: (port) => `port ${port} is in use; choose another with --port.`,
590
+ },
591
+ review: {
592
+ baseOrBefore: "--base takes the version before from Git and --before from a path; choose one.",
593
+ sameKinds: "--before and the path must both be folders or both files.",
594
+ /** What was compared: two folders or files by name, or a revision with the working tree. */
595
+ comparedPaths: (before, after) => `Compared ${before} with ${after}`,
596
+ comparedRevision: (revision) => `Compared ${revision} with the working tree`,
597
+ /** The cloud project's current files, or one of its versions, with the working tree. */
598
+ comparedCloud: (project, version) => version === undefined
599
+ ? `Compared the cloud project ${project} with the working tree`
600
+ : `Compared version ${version} of the cloud project ${project} with the working tree`,
601
+ /** `--base cloud:<n>` with something that is not a whole number. */
602
+ cloudVersion: "--base takes cloud, or cloud: and a version number such as cloud:3.",
603
+ /** `--project` or `--host` without `--base cloud`. */
604
+ cloudOptions: "--project and --host go with --base cloud.",
605
+ /** No connection to the service was given to the command (never from the command line). */
606
+ cloudUnavailable: "the cloud is not available here.",
607
+ none: "No changes.",
608
+ summary: (files, added, removed, renamed, changed) => `${files} file${files === 1 ? "" : "s"} changed: ${added} added, ${removed} removed, ${renamed} renamed, ${changed} changed.`,
609
+ /** The kinds of the blocks that hold changes, and a block whose kind is not known. */
610
+ scopes: { diagram: "diagram", model: "model", story: "story" },
611
+ block: "block",
612
+ /** The words of the review page, in the language of the files the command writes. */
613
+ page: {
614
+ title: "Review",
615
+ /** The heading of a changed diagram's pictures. */
616
+ diagram: (id) => `diagram ${id}`,
617
+ before: "Before",
618
+ after: "After",
619
+ new: "New",
620
+ removed: "Removed",
621
+ /** The scope a change is in. */
622
+ in: (scope) => `in ${scope}`,
623
+ /** The alternative text of a picture: the diagram and `before` or `after`. */
624
+ picture: (id, which) => `${id} ${which}`,
625
+ /** The status of a file and the legend of the marks. */
626
+ status: { added: "added", removed: "removed", renamed: "renamed", changed: "changed" },
627
+ },
628
+ },
629
+ assist: {
630
+ items: (ids, text) => `items are ${listOrNone(ids.map(String))}, not "${text}".`,
631
+ proposal: (path, revision, provider, model, summary) => `Proposal for ${path} (revision ${revision}, ${provider} ${model}): ${summary || "no summary"}`,
632
+ nothingToChange: " Nothing to change.",
633
+ /** The action of a proposal item, as the list of items names it. */
634
+ actions: {
635
+ create: "create",
636
+ add: "add",
637
+ replace: "replace",
638
+ remove: "remove",
639
+ relation: "relation",
640
+ },
641
+ imports: (imports) => ` Imports added with any item: ${imports.join("; ")}`,
642
+ together: (problem) => ` Every item together: ${problem}`,
643
+ unknownOperation: (operation, operations) => `unknown operation "${operation}"; use ${operations.join(", ")}.`,
644
+ proposalFile: "give the proposal file.",
645
+ notAProposal: (path) => `${path} is not a proposal.`,
646
+ oneFile: (operation) => `${operation} needs one .meltemi file.`,
647
+ notMeltemi: (path) => `${path} is not a .meltemi file.`,
648
+ exists: (path) => `${path} exists; use assist modify to change it.`,
649
+ profile: (profile, profiles) => `--profile takes ${profiles.join(", ")}, not "${profile}".`,
650
+ needsPrompt: (operation) => `${operation} needs --prompt.`,
651
+ notSent: "nothing was sent; answer yes, or pass --yes.",
652
+ saved: (path, name) => `Saved ${path}; apply with ${name} assist apply ${path} --items <list>`,
653
+ /** The question before a request is sent; the answers it accepts are below. */
654
+ send: "Send it? [y/N] ",
655
+ conflicts: (ids) => `item${ids.length === 1 ? "" : "s"} ${ids.join(", ")} changed since the proposal and ${ids.length === 1 ? "was" : "were"} left out.`,
656
+ nothingWritten: "nothing was written.",
657
+ applied: (ids, path) => `Applied item${ids.length === 1 ? "" : "s"} ${ids.join(", ")} to ${path}`,
658
+ noChanges: "No changes to explain.",
659
+ },
660
+ /** The cloud commands: login, logout, whoami, and the failures every cloud command shares. */
661
+ cloud: {
662
+ /** A command that takes no arguments, given some. */
663
+ noArguments: (command) => `${command} takes no arguments.`,
664
+ /**
665
+ * Why a cloud command failed, by the stable code of the failure (`cloud-errors.ts`); the code is
666
+ * printed before the sentence, and a code that is not here prints the service's own message.
667
+ */
668
+ errors: {
669
+ /** `cloud.host-mismatch`: the manifest's host, the one the command resolved. */
670
+ hostMismatch: (manifestHost, host) => `project.json names ${manifestHost}, but this command talks to ${host}; pass --host ${manifestHost} to use it.`,
671
+ /** `cloud.insecure-host`. */
672
+ insecureHost: (host) => `${host} is an http: address; a token only travels over https:, or over http: to 127.0.0.1, localhost or [::1].`,
673
+ /** `cloud.host-invalid`. */
674
+ hostInvalid: (host) => `${host} is not the address of a service; use an origin such as https://diagrams.meltemi.dev.`,
675
+ /** `cloud.unreachable`, with the system's reason. */
676
+ unreachable: (host, reason) => `cannot reach ${host}: ${reason}.`,
677
+ /** `cloud.timeout`. */
678
+ timeout: (host) => `${host} did not answer in time.`,
679
+ /** `cloud.response-too-large`. */
680
+ tooLarge: (host) => `${host} sent more than the command line accepts.`,
681
+ /** `cloud.redirect`. */
682
+ redirect: (host, status) => `${host} answered with a redirect (${status}); a token is never sent where it leads.`,
683
+ /** `cloud.bad-response`: an answer that is not the service's. */
684
+ badResponse: (host, status) => `${host} answered something that is not the service's answer (${status}).`,
685
+ /** `cloud.not-signed-in`: the command's name. */
686
+ notSignedIn: (name, host) => `not signed in to ${host}; run "${name} login".`,
687
+ /** `token.invalid`. */
688
+ tokenRefused: (name, host) => `${host} refused the token (it is unknown or was revoked); run "${name} login".`,
689
+ /** `credentials.corrupt`: nothing is ever written over such a file. */
690
+ credentialsCorrupt: (path, reason) => `the credentials file ${path} cannot be used: ${reason}. Fix it or delete it; nothing was written over it.`,
691
+ /** `credentials.unreadable`. */
692
+ credentialsUnreadable: (path, reason) => `the credentials file ${path} cannot be read: ${reason}.`,
693
+ /** `credentials.unwritable`. */
694
+ credentialsUnwritable: (path, reason) => `the credentials file ${path} cannot be written: ${reason}.`,
695
+ /** `cli.invalid`: the exchange of the one-time code was refused. */
696
+ cliInvalid: "the service refused the one-time code (it is unknown, used or expired); nothing was stored. Run login again.",
697
+ /** `cli.rate`. */
698
+ cliRate: (seconds) => `too many failed attempts; wait ${seconds} seconds and run login again.`,
699
+ /** `quota.tokens`. */
700
+ quotaTokens: "this account already holds 20 API tokens; revoke one on the account page and run login again.",
701
+ /** `login.timeout`. */
702
+ loginTimeout: "no approval arrived within 5 minutes; nothing was stored.",
703
+ /** `login.state-mismatch`. */
704
+ stateMismatch: "the approval did not carry this request's state, so it was not accepted; nothing was exchanged or stored.",
705
+ /** `login.environment-token`. */
706
+ environmentToken: "MELTEMI_TOKEN is set; it takes precedence over any stored token, so nothing was stored. Unset it to sign in with login.",
707
+ /** `login.token-input`. */
708
+ tokenInput: "--token reads the token from standard input; pipe it in.",
709
+ /** `login.no-token`. */
710
+ noToken: "no token was given on standard input.",
711
+ /** `login.not-a-token`. */
712
+ notAToken: "that is not an API token (they start with mdg_).",
713
+ /** `login.not-stored`: the token was revoked again, with the reason it could not be kept. */
714
+ notStored: (reason) => `the token could not be kept (${reason}), so it was revoked.`,
715
+ /** `login.not-revoked`: it could not be kept and could not be revoked either. */
716
+ notStoredNotRevoked: (reason) => `the token could not be kept (${reason}) and could not be revoked either; revoke it on the account page.`,
717
+ /** `login.listener`: no port to listen on. */
718
+ listener: (reason) => `cannot listen on this computer for the approval: ${reason}.`,
719
+ /** `logout.not-revoked`: the token was kept. */
720
+ notRevoked: (host, reason, path) => `the token for ${host} could not be revoked (${reason}), so it was not forgotten and can be revoked later: run logout again, or revoke it on the account page. It is kept in ${path}.`,
721
+ /** `cloud.no-project`: the folder's manifest names no cloud project; the command's name. */
722
+ noProject: (name) => `this folder names no cloud project; give --project <id>, or make one with "${name} push --create".`,
723
+ /** `pull.unsafe-path`: a path of the cloud project that does not stay inside the folder. */
724
+ unsafePath: (path) => `the cloud project holds the path ${path}, which is not a safe path inside the folder; nothing was compared or written.`,
725
+ /** `version.not-found`: the version asked for. */
726
+ versionNotFound: (version) => `the cloud project has no version ${version}.`,
727
+ /** `project.not-found`: a project that does not exist or that the person may not open. */
728
+ projectNotFound: (project) => `the cloud project ${project} does not exist, or you may not open it.`,
729
+ /** `access.denied`: the person sees the project but may not do this. */
730
+ accessDenied: "your role on this project does not allow that: publishing, sharing, renaming and deleting are the owner's, and changing files needs the editor role.",
731
+ /** `handle.taken`. */
732
+ handleTaken: (handle) => `the handle ${handle} is taken by another account; choose another with --handle.`,
733
+ /** `handle.locked`. */
734
+ handleLocked: (handle) => `your handle is ${handle} and it cannot change while pages are published under it; unpublish them first (publish --unpublish --slug <name>).`,
735
+ /** `handle.invalid`. */
736
+ handleInvalid: (handle) => `${handle} is not a handle: use 3 to 30 lowercase letters, digits and hyphens.`,
737
+ /** `handle.required`: the command's name. */
738
+ handleRequired: (name) => `you have no handle yet: give --handle <name> (it is public and starts every address you publish), or run "${name} publish" in a terminal to be asked.`,
739
+ /** `publish.handle-in-page`: the service refuses an API token the choice of a handle. */
740
+ handleInPage: (handle) => `the service does not let an API token choose the handle ${handle}: choose it in the page, in the project's publish dialog, then run publish again.`,
741
+ /** `publish.too-large`: the catalog's size when known. */
742
+ publishTooLarge: (size) => `the catalog${size === undefined ? "" : ` (${size})`} is larger than the 16 MiB a page may be; nothing was sent. Leave out what the page does not need with catalog.exclude in project.json.`,
743
+ /** `publish.rate`: seconds until the earliest request stops counting. */
744
+ publishRate: (seconds) => `a project may be published ten times an hour; try again in ${seconds} seconds.`,
745
+ /** `publish.taken`. */
746
+ publishTaken: (slug) => `another project of yours already publishes ${slug}; choose another name with --slug.`,
747
+ /** `publish.not-published`: `--unpublish` of a name the project does not publish. */
748
+ notPublished: (slug) => `the project publishes nothing under ${slug}.`,
749
+ /** `publish.empty`. */
750
+ publishEmpty: "there is nothing to publish: the project has no diagram or story that can be drawn.",
751
+ /** `publish.errors`: `--strict` with errors in the project. */
752
+ publishErrors: "the project has errors, so nothing was pushed or published (--strict).",
753
+ },
754
+ push: pushPullEn.push,
755
+ pull: pushPullEn.pull,
756
+ projectErrors: pushPullEn.errors,
757
+ login: {
758
+ /** The six characters the approval page shows, printed before the browser opens. */
759
+ check: (check) => `check: ${check}`,
760
+ checkNote: "Approve the request in the browser only if the page shows the same six characters.",
761
+ opening: (url) => `Opening ${url}`,
762
+ openFailed: "The browser could not be opened; open the address above yourself.",
763
+ /** `--no-browser`. */
764
+ visit: (url) => `Open this address in your browser:\n ${url}`,
765
+ waiting: "Waiting for the approval (up to 5 minutes)...",
766
+ /** The question of `--token` when standard input is a terminal. */
767
+ tokenPrompt: "Paste the token: ",
768
+ signedIn: (name, host) => `Signed in as ${name} (${host})`,
769
+ /** The page the browser lands on, in the language of its Accept-Language. */
770
+ page: {
771
+ done: "Done. You can close this window and go back to the terminal.",
772
+ failed: "Signing in did not finish. Go back to the terminal to see why.",
773
+ },
774
+ },
775
+ logout: {
776
+ done: (host) => `Signed out of ${host}: the token was revoked and forgotten.`,
777
+ alreadyRevoked: (host) => `The token for ${host} was already revoked; it was forgotten.`,
778
+ none: (host) => `Not signed in to ${host}; nothing to do.`,
779
+ environment: "MELTEMI_TOKEN is set in the environment and stays in use; it was not revoked.",
780
+ },
781
+ whoami: {
782
+ who: (name, handle) => handle === null ? `${name} (no handle yet)` : `${name} (@${handle})`,
783
+ host: (host) => `host: ${host}`,
784
+ environment: "token: from MELTEMI_TOKEN",
785
+ },
786
+ publish: {
787
+ /** The question for the handle on a terminal. */
788
+ askHandle: "Choose your handle: it is public and starts every address you publish (3 to 30 lowercase letters, digits and hyphens): ",
789
+ handleSet: (handle) => `Handle set: ${handle}`,
790
+ /** What was published, then its size; the address follows on its own line. */
791
+ published: (parts, size) => `Published ${parts.join(", ")} (${size}).`,
792
+ unpublished: (slug) => `Unpublished ${slug}.`,
793
+ slugInvalid: (slug) => `--slug takes 1 to 60 lowercase letters, digits and hyphens, not "${slug}".`,
794
+ handleOption: (handle) => `--handle takes 3 to 30 lowercase letters, digits and hyphens, not "${handle}".`,
795
+ },
796
+ projects: {
797
+ none: (name) => `You have no cloud projects yet; make one with "${name} push --create".`,
798
+ header: { id: "ID", name: "NAME", role: "ROLE", changed: "LAST CHANGE" },
799
+ roles: { owner: "owner", editor: "editor", viewer: "viewer" },
800
+ },
801
+ },
802
+ };
803
+ //# sourceMappingURL=en.js.map