transloadit 4.7.3 → 4.7.6

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 (152) hide show
  1. package/README.md +897 -5
  2. package/dist/Transloadit.d.ts +13 -3
  3. package/dist/Transloadit.d.ts.map +1 -1
  4. package/dist/Transloadit.js +22 -2
  5. package/dist/Transloadit.js.map +1 -1
  6. package/dist/alphalib/types/assembliesGet.d.ts +5 -0
  7. package/dist/alphalib/types/assembliesGet.d.ts.map +1 -1
  8. package/dist/alphalib/types/assemblyReplay.d.ts +5 -0
  9. package/dist/alphalib/types/assemblyReplay.d.ts.map +1 -1
  10. package/dist/alphalib/types/assemblyReplayNotification.d.ts +5 -0
  11. package/dist/alphalib/types/assemblyReplayNotification.d.ts.map +1 -1
  12. package/dist/alphalib/types/assemblyStatus.d.ts +25 -25
  13. package/dist/alphalib/types/assemblyStatus.d.ts.map +1 -1
  14. package/dist/alphalib/types/assemblyStatus.js +4 -1
  15. package/dist/alphalib/types/assemblyStatus.js.map +1 -1
  16. package/dist/alphalib/types/bill.d.ts +5 -0
  17. package/dist/alphalib/types/bill.d.ts.map +1 -1
  18. package/dist/alphalib/types/builtinTemplates.d.ts +83 -0
  19. package/dist/alphalib/types/builtinTemplates.d.ts.map +1 -0
  20. package/dist/alphalib/types/builtinTemplates.js +19 -0
  21. package/dist/alphalib/types/builtinTemplates.js.map +1 -0
  22. package/dist/alphalib/types/robots/ai-chat.d.ts.map +1 -1
  23. package/dist/alphalib/types/robots/ai-chat.js +1 -0
  24. package/dist/alphalib/types/robots/ai-chat.js.map +1 -1
  25. package/dist/alphalib/types/skillFrontmatter.d.ts +29 -0
  26. package/dist/alphalib/types/skillFrontmatter.d.ts.map +1 -0
  27. package/dist/alphalib/types/skillFrontmatter.js +19 -0
  28. package/dist/alphalib/types/skillFrontmatter.js.map +1 -0
  29. package/dist/alphalib/types/template.d.ts +36 -0
  30. package/dist/alphalib/types/template.d.ts.map +1 -1
  31. package/dist/alphalib/types/template.js +10 -0
  32. package/dist/alphalib/types/template.js.map +1 -1
  33. package/dist/alphalib/types/templateCredential.d.ts +10 -0
  34. package/dist/alphalib/types/templateCredential.d.ts.map +1 -1
  35. package/dist/bearerToken.d.ts +31 -0
  36. package/dist/bearerToken.d.ts.map +1 -0
  37. package/dist/bearerToken.js +158 -0
  38. package/dist/bearerToken.js.map +1 -0
  39. package/dist/cli/commands/assemblies.d.ts +8 -2
  40. package/dist/cli/commands/assemblies.d.ts.map +1 -1
  41. package/dist/cli/commands/assemblies.js +566 -411
  42. package/dist/cli/commands/assemblies.js.map +1 -1
  43. package/dist/cli/commands/auth.d.ts +1 -4
  44. package/dist/cli/commands/auth.d.ts.map +1 -1
  45. package/dist/cli/commands/auth.js +7 -123
  46. package/dist/cli/commands/auth.js.map +1 -1
  47. package/dist/cli/commands/index.d.ts.map +1 -1
  48. package/dist/cli/commands/index.js +5 -0
  49. package/dist/cli/commands/index.js.map +1 -1
  50. package/dist/cli/commands/templates.d.ts.map +1 -1
  51. package/dist/cli/commands/templates.js +4 -14
  52. package/dist/cli/commands/templates.js.map +1 -1
  53. package/dist/cli/fileProcessingOptions.d.ts +35 -0
  54. package/dist/cli/fileProcessingOptions.d.ts.map +1 -0
  55. package/dist/cli/fileProcessingOptions.js +182 -0
  56. package/dist/cli/fileProcessingOptions.js.map +1 -0
  57. package/dist/cli/generateIntentDocs.d.ts +2 -0
  58. package/dist/cli/generateIntentDocs.d.ts.map +1 -0
  59. package/dist/cli/generateIntentDocs.js +321 -0
  60. package/dist/cli/generateIntentDocs.js.map +1 -0
  61. package/dist/cli/intentCommandSpecs.d.ts +36 -0
  62. package/dist/cli/intentCommandSpecs.d.ts.map +1 -0
  63. package/dist/cli/intentCommandSpecs.js +181 -0
  64. package/dist/cli/intentCommandSpecs.js.map +1 -0
  65. package/dist/cli/intentCommands.d.ts +13 -0
  66. package/dist/cli/intentCommands.d.ts.map +1 -0
  67. package/dist/cli/intentCommands.js +368 -0
  68. package/dist/cli/intentCommands.js.map +1 -0
  69. package/dist/cli/intentFields.d.ts +25 -0
  70. package/dist/cli/intentFields.d.ts.map +1 -0
  71. package/dist/cli/intentFields.js +298 -0
  72. package/dist/cli/intentFields.js.map +1 -0
  73. package/dist/cli/intentInputPolicy.d.ts +10 -0
  74. package/dist/cli/intentInputPolicy.d.ts.map +1 -0
  75. package/dist/cli/intentInputPolicy.js +2 -0
  76. package/dist/cli/intentInputPolicy.js.map +1 -0
  77. package/dist/cli/intentRuntime.d.ts +114 -0
  78. package/dist/cli/intentRuntime.d.ts.map +1 -0
  79. package/dist/cli/intentRuntime.js +464 -0
  80. package/dist/cli/intentRuntime.js.map +1 -0
  81. package/dist/cli/resultFiles.d.ts +19 -0
  82. package/dist/cli/resultFiles.d.ts.map +1 -0
  83. package/dist/cli/resultFiles.js +66 -0
  84. package/dist/cli/resultFiles.js.map +1 -0
  85. package/dist/cli/resultUrls.d.ts +19 -0
  86. package/dist/cli/resultUrls.d.ts.map +1 -0
  87. package/dist/cli/resultUrls.js +36 -0
  88. package/dist/cli/resultUrls.js.map +1 -0
  89. package/dist/cli/semanticIntents/imageDescribe.d.ts +43 -0
  90. package/dist/cli/semanticIntents/imageDescribe.d.ts.map +1 -0
  91. package/dist/cli/semanticIntents/imageDescribe.js +188 -0
  92. package/dist/cli/semanticIntents/imageDescribe.js.map +1 -0
  93. package/dist/cli/semanticIntents/index.d.ts +18 -0
  94. package/dist/cli/semanticIntents/index.d.ts.map +1 -0
  95. package/dist/cli/semanticIntents/index.js +18 -0
  96. package/dist/cli/semanticIntents/index.js.map +1 -0
  97. package/dist/cli/semanticIntents/markdownPdf.d.ts +4 -0
  98. package/dist/cli/semanticIntents/markdownPdf.d.ts.map +1 -0
  99. package/dist/cli/semanticIntents/markdownPdf.js +93 -0
  100. package/dist/cli/semanticIntents/markdownPdf.js.map +1 -0
  101. package/dist/cli/semanticIntents/parsing.d.ts +11 -0
  102. package/dist/cli/semanticIntents/parsing.d.ts.map +1 -0
  103. package/dist/cli/semanticIntents/parsing.js +29 -0
  104. package/dist/cli/semanticIntents/parsing.js.map +1 -0
  105. package/dist/cli/stepsInput.d.ts +4 -0
  106. package/dist/cli/stepsInput.d.ts.map +1 -0
  107. package/dist/cli/stepsInput.js +23 -0
  108. package/dist/cli/stepsInput.js.map +1 -0
  109. package/dist/cli.d.ts +1 -1
  110. package/dist/cli.d.ts.map +1 -1
  111. package/dist/cli.js +5 -4
  112. package/dist/cli.js.map +1 -1
  113. package/dist/ensureUniqueCounter.d.ts +8 -0
  114. package/dist/ensureUniqueCounter.d.ts.map +1 -0
  115. package/dist/ensureUniqueCounter.js +48 -0
  116. package/dist/ensureUniqueCounter.js.map +1 -0
  117. package/dist/inputFiles.d.ts +9 -0
  118. package/dist/inputFiles.d.ts.map +1 -1
  119. package/dist/inputFiles.js +177 -26
  120. package/dist/inputFiles.js.map +1 -1
  121. package/dist/robots.js +1 -1
  122. package/dist/robots.js.map +1 -1
  123. package/package.json +9 -7
  124. package/src/Transloadit.ts +35 -3
  125. package/src/alphalib/types/assemblyStatus.ts +4 -1
  126. package/src/alphalib/types/builtinTemplates.ts +24 -0
  127. package/src/alphalib/types/robots/ai-chat.ts +1 -0
  128. package/src/alphalib/types/skillFrontmatter.ts +24 -0
  129. package/src/alphalib/types/template.ts +14 -0
  130. package/src/bearerToken.ts +208 -0
  131. package/src/cli/commands/assemblies.ts +825 -505
  132. package/src/cli/commands/auth.ts +9 -151
  133. package/src/cli/commands/index.ts +6 -3
  134. package/src/cli/commands/templates.ts +6 -17
  135. package/src/cli/fileProcessingOptions.ts +294 -0
  136. package/src/cli/generateIntentDocs.ts +419 -0
  137. package/src/cli/intentCommandSpecs.ts +282 -0
  138. package/src/cli/intentCommands.ts +525 -0
  139. package/src/cli/intentFields.ts +403 -0
  140. package/src/cli/intentInputPolicy.ts +11 -0
  141. package/src/cli/intentRuntime.ts +734 -0
  142. package/src/cli/resultFiles.ts +105 -0
  143. package/src/cli/resultUrls.ts +72 -0
  144. package/src/cli/semanticIntents/imageDescribe.ts +254 -0
  145. package/src/cli/semanticIntents/index.ts +48 -0
  146. package/src/cli/semanticIntents/markdownPdf.ts +120 -0
  147. package/src/cli/semanticIntents/parsing.ts +56 -0
  148. package/src/cli/stepsInput.ts +32 -0
  149. package/src/cli.ts +5 -4
  150. package/src/ensureUniqueCounter.ts +75 -0
  151. package/src/inputFiles.ts +277 -26
  152. package/src/robots.ts +1 -1
package/README.md CHANGED
@@ -33,15 +33,18 @@ This is a **Node.js** SDK to make it easy to talk to the
33
33
  Inside your project, type:
34
34
 
35
35
  ```bash
36
- yarn add transloadit
36
+ yarn add @transloadit/node
37
37
  ```
38
38
 
39
39
  or
40
40
 
41
41
  ```bash
42
- npm install --save transloadit
42
+ npm install --save @transloadit/node
43
43
  ```
44
44
 
45
+ The legacy npm package name `transloadit` is kept as an alias for backward compatibility, but
46
+ `@transloadit/node` is the canonical package name.
47
+
45
48
  ## Command Line Interface (CLI)
46
49
 
47
50
  This package includes a full-featured CLI for interacting with Transloadit from your terminal.
@@ -54,9 +57,12 @@ export TRANSLOADIT_KEY="YOUR_TRANSLOADIT_KEY"
54
57
  export TRANSLOADIT_SECRET="YOUR_TRANSLOADIT_SECRET"
55
58
 
56
59
  # See all available commands
57
- npx transloadit --help
60
+ npx -y @transloadit/node --help
58
61
  ```
59
62
 
63
+ The CLI binary is still called `transloadit`, so command examples below may use
64
+ `npx transloadit ...`.
65
+
60
66
  ### Minting Bearer Tokens (Hosted MCP)
61
67
 
62
68
  If you want to connect an agent to the Transloadit-hosted MCP endpoint, mint a short-lived bearer
@@ -67,9 +73,891 @@ token via `POST /token`:
67
73
  npx -y transloadit auth token --aud mcp
68
74
  ```
69
75
 
76
+ To reduce blast radius, you can request a narrower set of scopes. The server will only grant scopes
77
+ that your Auth Key already has (it applies an intersection), and will error if you request scopes
78
+ you are not allowed to use.
79
+
80
+ ```bash
81
+ # Request a narrower token (comma-separated scopes)
82
+ npx -y transloadit auth token --aud mcp --scope assemblies:write,templates:read
83
+ ```
84
+
70
85
  ### Processing Media
71
86
 
72
- Create Assemblies to process files using Assembly Instructions (steps) or Templates:
87
+ For common one-off tasks, prefer the intent-first commands:
88
+
89
+ The full generated intent reference also lives in [`docs/intent-commands.md`](./docs/intent-commands.md).
90
+
91
+ <!-- GENERATED_INTENT_DOCS:START -->
92
+
93
+ #### At a glance
94
+
95
+ Intent commands are the fastest path to common one-off tasks from the CLI.
96
+ Use `--print-urls` when you want temporary result URLs without downloading locally.
97
+ All intent commands also support the global CLI flags `--json`, `--log-level`, `--endpoint`, and `--help`.
98
+
99
+ | Command | What it does | Input | Output |
100
+ | --- | --- | --- | --- |
101
+ | `image generate` | Generate images from text prompts | none | file |
102
+ | `preview generate` | Generate a preview thumbnail | file, dir, URL, base64 | file |
103
+ | `image remove-background` | Remove the background from images | file, dir, URL, base64 | file |
104
+ | `image optimize` | Optimize images without quality loss | file, dir, URL, base64 | file |
105
+ | `image resize` | Convert, resize, or watermark images | file, dir, URL, base64 | file |
106
+ | `document convert` | Convert documents into different formats | file, dir, URL, base64 | file |
107
+ | `document optimize` | Reduce PDF file size | file, dir, URL, base64 | file |
108
+ | `document auto-rotate` | Auto-rotate documents to the correct orientation | file, dir, URL, base64 | file |
109
+ | `document thumbs` | Extract thumbnail images from documents | file, dir, URL, base64 | directory |
110
+ | `audio waveform` | Generate waveform images from audio | file, dir, URL, base64 | file |
111
+ | `text speak` | Speak text | file, dir, URL, base64 | file |
112
+ | `video thumbs` | Extract thumbnails from videos | file, dir, URL, base64 | directory |
113
+ | `video encode-hls` | Run builtin/encode-hls-video@latest | file, dir, URL, base64 | directory |
114
+ | `image describe` | Describe images as labels or publishable text fields | file, dir, URL, base64 | file |
115
+ | `markdown pdf` | Render Markdown files as PDFs | file, dir, URL, base64 | file |
116
+ | `markdown docx` | Render Markdown files as DOCX documents | file, dir, URL, base64 | file |
117
+ | `file compress` | Compress files | file, dir, URL, base64 | file |
118
+ | `file decompress` | Decompress archives | file, dir, URL, base64 | directory |
119
+
120
+ > At least one of `--out` or `--print-urls` is required on every intent command.
121
+
122
+ #### Shared flags
123
+
124
+ These flags are available across many intent commands, so the per-command sections below focus on differences.
125
+
126
+ **Shared file input & output flags**
127
+
128
+ | Flag | Type | Required | Example | Description |
129
+ | --- | --- | --- | --- | --- |
130
+ | `--input, -i` | `path \| dir \| url \| -` | varies | `input.file` | Provide an input path, directory, URL, or - for stdin |
131
+ | `--input-base64` | `base64 \| data URL` | no | `data:text/plain;base64,SGVsbG8=` | Provide base64-encoded input content directly |
132
+ | `--out, -o` | `path` | yes* | `output.file` | Write the result to this path or directory |
133
+ | `--print-urls` | `boolean` | no | `false` | Print temporary result URLs after completion |
134
+
135
+ **Shared no-input output flags**
136
+
137
+ | Flag | Type | Required | Example | Description |
138
+ | --- | --- | --- | --- | --- |
139
+ | `--out, -o` | `path` | yes* | `output.file` | Write the result to this path |
140
+ | `--print-urls` | `boolean` | no | `false` | Print temporary result URLs after completion |
141
+
142
+ **Shared processing flags**
143
+
144
+ | Flag | Type | Required | Example | Description |
145
+ | --- | --- | --- | --- | --- |
146
+ | `--recursive, -r` | `boolean` | no | `false` | Enumerate input directories recursively |
147
+ | `--delete-after-processing, -d` | `boolean` | no | `false` | Delete input files after they are processed |
148
+ | `--reprocess-stale` | `boolean` | no | `false` | Process inputs even if output is newer |
149
+
150
+ **Shared watch flags**
151
+
152
+ | Flag | Type | Required | Example | Description |
153
+ | --- | --- | --- | --- | --- |
154
+ | `--watch, -w` | `boolean` | no | `false` | Watch inputs for changes |
155
+ | `--concurrency, -c` | `number` | no | `5` | Maximum number of concurrent assemblies (default: 5) |
156
+
157
+ **Shared bundling flags**
158
+
159
+ | Flag | Type | Required | Example | Description |
160
+ | --- | --- | --- | --- | --- |
161
+ | `--single-assembly` | `boolean` | no | `false` | Pass all input files to a single assembly instead of one assembly per file |
162
+
163
+ #### `image generate`
164
+
165
+ Generate images from text prompts
166
+
167
+ Runs `/image/generate` and writes the result to `--out`.
168
+
169
+ **Usage**
170
+
171
+ ```bash
172
+ npx transloadit image generate [options]
173
+ ```
174
+
175
+ **Quick facts**
176
+
177
+ - Input: none
178
+ - Output: file
179
+ - Execution: no input
180
+ - Backend: `/image/generate`
181
+
182
+ **Shared flags**
183
+
184
+ - Uses the shared output flags listed above.
185
+
186
+ **Command options**
187
+
188
+ | Flag | Type | Required | Example | Description |
189
+ | --- | --- | --- | --- | --- |
190
+ | `--model` | `string` | no | `value` | The AI model to use for image generation. Defaults to google/nano-banana. |
191
+ | `--prompt` | `string` | yes | `"A red bicycle in a studio"` | The prompt describing the desired image content. |
192
+ | `--format` | `string` | no | `jpg` | Format of the generated image. |
193
+ | `--seed` | `number` | no | `1` | Seed for the random number generator. |
194
+ | `--aspect-ratio` | `string` | no | `value` | Aspect ratio of the generated image. |
195
+ | `--height` | `number` | no | `1` | Height of the generated image. |
196
+ | `--width` | `number` | no | `1` | Width of the generated image. |
197
+ | `--style` | `string` | no | `value` | Style of the generated image. |
198
+ | `--num-outputs` | `number` | no | `1` | Number of image variants to generate. |
199
+
200
+ **Examples**
201
+
202
+ ```bash
203
+ transloadit image generate --prompt "A red bicycle in a studio" --out output.png
204
+ ```
205
+
206
+ #### `preview generate`
207
+
208
+ Generate a preview thumbnail
209
+
210
+ Runs `/file/preview` on each input file and writes the result to `--out`.
211
+
212
+ **Usage**
213
+
214
+ ```bash
215
+ npx transloadit preview generate --input <path|dir|url|-> [options]
216
+ ```
217
+
218
+ **Quick facts**
219
+
220
+ - Input: file, dir, URL, base64
221
+ - Output: file
222
+ - Execution: per-file; supports `--single-assembly` and `--watch`
223
+ - Backend: `/file/preview`
224
+
225
+ **Shared flags**
226
+
227
+ - Uses the shared file input and output flags listed above.
228
+ - Also supports the shared base processing flags, watch flags, bundling flags listed above.
229
+
230
+ **Command options**
231
+
232
+ | Flag | Type | Required | Example | Description |
233
+ | --- | --- | --- | --- | --- |
234
+ | `--format` | `string` | no | `jpg` | The output format for the generated thumbnail image. If a short video clip is generated using the clip strategy, its format is defined by clip_format. |
235
+ | `--width` | `number` | no | `1` | Width of the thumbnail, in pixels. |
236
+ | `--height` | `number` | no | `1` | Height of the thumbnail, in pixels. |
237
+ | `--resize-strategy` | `string` | no | `crop` | To achieve the desired dimensions of the preview thumbnail, the Robot might have to resize the generated image. |
238
+ | `--background` | `string` | no | `value` | The hexadecimal code of the color used to fill the background (only used for the pad resize strategy). |
239
+ | `--strategy` | `json` | no | `value` | Definition of the thumbnail generation process per file category. |
240
+ | `--artwork-outer-color` | `string` | no | `value` | The color used in the outer parts of the artwork's gradient. |
241
+ | `--artwork-center-color` | `string` | no | `value` | The color used in the center of the artwork's gradient. |
242
+ | `--waveform-center-color` | `string` | no | `value` | The color used in the center of the waveform's gradient. The format is #rrggbb[aa] (red, green, blue, alpha). Only used if the waveform strategy for audio files is applied. |
243
+ | `--waveform-outer-color` | `string` | no | `value` | The color used in the outer parts of the waveform's gradient. The format is #rrggbb[aa] (red, green, blue, alpha). Only used if the waveform strategy for audio files is applied. |
244
+ | `--waveform-height` | `number` | no | `1` | Height of the waveform, in pixels. Only used if the waveform strategy for audio files is applied. It can be utilized to ensure that the waveform only takes up a section of the… |
245
+ | `--waveform-width` | `number` | no | `1` | Width of the waveform, in pixels. Only used if the waveform strategy for audio files is applied. It can be utilized to ensure that the waveform only takes up a section of the… |
246
+ | `--icon-style` | `string` | no | `square` | The style of the icon generated if the icon strategy is applied. |
247
+ | `--icon-text-color` | `string` | no | `value` | The color of the text used in the icon. The format is #rrggbb[aa]. Only used if the icon strategy is applied. |
248
+ | `--icon-text-font` | `string` | no | `value` | The font family of the text used in the icon. Only used if the icon strategy is applied. Here is a list of all supported fonts. |
249
+ | `--icon-text-content` | `string` | no | `extension` | The content of the text box in generated icons. Only used if the icon_style parameter is set to with-text. The default value, extension, adds the file extension (e.g. MP4, JPEG)… |
250
+ | `--optimize` | `boolean` | no | `true` | Specifies whether the generated preview image should be optimized to reduce the image's file size while keeping their quaility. |
251
+ | `--optimize-priority` | `string` | no | `compression-ratio` | Specifies whether conversion speed or compression ratio is prioritized when optimizing images. |
252
+ | `--optimize-progressive` | `boolean` | no | `true` | Specifies whether images should be interlaced, which makes the result image load progressively in browsers. |
253
+ | `--clip-format` | `string` | no | `apng` | The animated image format for the generated video clip. Only used if the clip strategy for video files is applied. Please consult the MDN Web Docs for detailed information about… |
254
+ | `--clip-offset` | `number` | no | `1` | The start position in seconds of where the clip is cut. Only used if the clip strategy for video files is applied. Be aware that for larger video only the first few MBs of the… |
255
+ | `--clip-duration` | `number` | no | `1` | The duration in seconds of the generated video clip. Only used if the clip strategy for video files is applied. Be aware that a longer clip duration also results in a larger file… |
256
+ | `--clip-framerate` | `number` | no | `1` | The framerate of the generated video clip. Only used if the clip strategy for video files is applied. Be aware that a higher framerate appears smoother but also results in a… |
257
+ | `--clip-loop` | `boolean` | no | `true` | Specifies whether the generated animated image should loop forever (true) or stop after playing the animation once (false). |
258
+
259
+ **Examples**
260
+
261
+ ```bash
262
+ transloadit preview generate --input input.file --out output.file
263
+ ```
264
+
265
+ #### `image remove-background`
266
+
267
+ Remove the background from images
268
+
269
+ Runs `/image/bgremove` on each input file and writes the result to `--out`.
270
+
271
+ **Usage**
272
+
273
+ ```bash
274
+ npx transloadit image remove-background --input <path|dir|url|-> [options]
275
+ ```
276
+
277
+ **Quick facts**
278
+
279
+ - Input: file, dir, URL, base64
280
+ - Output: file
281
+ - Execution: per-file; supports `--single-assembly` and `--watch`
282
+ - Backend: `/image/bgremove`
283
+
284
+ **Shared flags**
285
+
286
+ - Uses the shared file input and output flags listed above.
287
+ - Also supports the shared base processing flags, watch flags, bundling flags listed above.
288
+
289
+ **Command options**
290
+
291
+ | Flag | Type | Required | Example | Description |
292
+ | --- | --- | --- | --- | --- |
293
+ | `--select` | `string` | no | `foreground` | Region to select and keep in the image. The other region is removed. |
294
+ | `--format` | `string` | no | `png` | Format of the generated image. |
295
+ | `--provider` | `string` | no | `aws` | Provider to use for removing the background. |
296
+ | `--model` | `string` | no | `value` | Provider-specific model to use for removing the background. Mostly intended for testing and evaluation. |
297
+
298
+ **Examples**
299
+
300
+ ```bash
301
+ transloadit image remove-background --input input.png --out output.png
302
+ ```
303
+
304
+ #### `image optimize`
305
+
306
+ Optimize images without quality loss
307
+
308
+ Runs `/image/optimize` on each input file and writes the result to `--out`.
309
+
310
+ **Usage**
311
+
312
+ ```bash
313
+ npx transloadit image optimize --input <path|dir|url|-> [options]
314
+ ```
315
+
316
+ **Quick facts**
317
+
318
+ - Input: file, dir, URL, base64
319
+ - Output: file
320
+ - Execution: per-file; supports `--single-assembly` and `--watch`
321
+ - Backend: `/image/optimize`
322
+
323
+ **Shared flags**
324
+
325
+ - Uses the shared file input and output flags listed above.
326
+ - Also supports the shared base processing flags, watch flags, bundling flags listed above.
327
+
328
+ **Command options**
329
+
330
+ | Flag | Type | Required | Example | Description |
331
+ | --- | --- | --- | --- | --- |
332
+ | `--priority` | `string` | no | `compression-ratio` | Provides different algorithms for better or worse compression for your images, but that run slower or faster. |
333
+ | `--progressive` | `boolean` | no | `true` | Interlaces the image if set to true, which makes the result image load progressively in browsers. |
334
+ | `--preserve-meta-data` | `boolean` | no | `true` | Specifies if the image's metadata should be preserved during the optimization, or not. |
335
+ | `--fix-breaking-images` | `boolean` | no | `true` | If set to true this parameter tries to fix images that would otherwise make the underlying tool error out and thereby break your Assemblies . |
336
+
337
+ **Examples**
338
+
339
+ ```bash
340
+ transloadit image optimize --input input.png --out output.png
341
+ ```
342
+
343
+ #### `image resize`
344
+
345
+ Convert, resize, or watermark images
346
+
347
+ Runs `/image/resize` on each input file and writes the result to `--out`.
348
+
349
+ **Usage**
350
+
351
+ ```bash
352
+ npx transloadit image resize --input <path|dir|url|-> [options]
353
+ ```
354
+
355
+ **Quick facts**
356
+
357
+ - Input: file, dir, URL, base64
358
+ - Output: file
359
+ - Execution: per-file; supports `--single-assembly` and `--watch`
360
+ - Backend: `/image/resize`
361
+
362
+ **Shared flags**
363
+
364
+ - Uses the shared file input and output flags listed above.
365
+ - Also supports the shared base processing flags, watch flags, bundling flags listed above.
366
+
367
+ **Command options**
368
+
369
+ | Flag | Type | Required | Example | Description |
370
+ | --- | --- | --- | --- | --- |
371
+ | `--format` | `string` | no | `value` | The output format for the modified image. Some of the most important available formats are "jpg", "png", "gif", and "tiff". For a complete lists of all formats that we can write… |
372
+ | `--width` | `number` | no | `1` | Width of the result in pixels. If not specified, will default to the width of the original. |
373
+ | `--height` | `number` | no | `1` | Height of the new image, in pixels. If not specified, will default to the height of the input image. |
374
+ | `--resize-strategy` | `string` | no | `crop` | See the list of available resize strategies. |
375
+ | `--zoom` | `boolean` | no | `true` | If this is set to false, smaller images will not be stretched to the desired width and height. |
376
+ | `--crop` | `auto` | no | `value` | Specify an object containing coordinates for the top left and bottom right corners of the rectangle to be cropped from the original image(s). |
377
+ | `--gravity` | `string` | no | `bottom` | The direction from which the image is to be cropped, when "resize_strategy" is set to "crop", but no crop coordinates are defined. |
378
+ | `--strip` | `boolean` | no | `true` | Strips all metadata from the image. This is useful to keep thumbnails as small as possible. |
379
+ | `--alpha` | `string` | no | `Activate` | Gives control of the alpha/matte channel of an image. |
380
+ | `--preclip-alpha` | `string` | no | `Activate` | Gives control of the alpha/matte channel of an image before applying the clipping path via clip: true. |
381
+ | `--flatten` | `boolean` | no | `true` | Flattens all layers onto the specified background to achieve better results from transparent formats to non-transparent formats, as explained in the ImageMagick documentation. |
382
+ | `--correct-gamma` | `boolean` | no | `true` | Prevents gamma errors common in many image scaling algorithms. |
383
+ | `--quality` | `number` | no | `1` | Controls the image compression for JPG and PNG images. Please also take a look at 🤖/image/optimize. |
384
+ | `--adaptive-filtering` | `boolean` | no | `true` | Controls the image compression for PNG images. Setting to true results in smaller file size, while increasing processing time. It is encouraged to keep this option disabled. |
385
+ | `--background` | `string` | no | `transparent` | Either the hexadecimal code or name of the color used to fill the background (used for the pad resize strategy). |
386
+ | `--frame` | `number` | no | `1` | Use this parameter when dealing with animated GIF files to specify which frame of the GIF is used for the operation. |
387
+ | `--colorspace` | `string` | no | `CMY` | Sets the image colorspace. For details about the available values, see the ImageMagick documentation. Please note that if you were using "RGB", we recommend using "sRGB" instead… |
388
+ | `--type` | `string` | no | `Bilevel` | Sets the image color type. For details about the available values, see the ImageMagick documentation. If you're using colorspace, ImageMagick might try to find the most efficient… |
389
+ | `--sepia` | `number` | no | `1` | Applies a sepia tone effect in percent. |
390
+ | `--rotation` | `auto` | no | `auto` | Determines whether the image should be rotated. Use any number to specify the rotation angle in degrees (e.g., 90, 180, 270, 360, or precise values like 2.9). Use the value true… |
391
+ | `--compress` | `string` | no | `BZip` | Specifies pixel compression for when the image is written. Compression is disabled by default. Please also take a look at 🤖/image/optimize. |
392
+ | `--blur` | `string` | no | `value` | Specifies gaussian blur, using a value with the form {radius}x{sigma}. |
393
+ | `--blur-regions` | `json` | no | `value` | Specifies an array of ellipse objects that should be blurred on the image. |
394
+ | `--brightness` | `number` | no | `1` | Increases or decreases the brightness of the image by using a multiplier. For example 1.5 would increase the brightness by 50%, and 0.75 would decrease the brightness by 25%. |
395
+ | `--saturation` | `number` | no | `1` | Increases or decreases the saturation of the image by using a multiplier. For example 1.5 would increase the saturation by 50%, and 0.75 would decrease the saturation by 25%. |
396
+ | `--hue` | `number` | no | `1` | Changes the hue by rotating the color of the image. The value 100 would produce no change whereas 0 and 200 will negate the colors in the image. |
397
+ | `--contrast` | `number` | no | `1` | Adjusts the contrast of the image. A value of 1 produces no change. Values below 1 decrease contrast (with 0 being minimum contrast), and values above 1 increase contrast (with 2… |
398
+ | `--watermark-url` | `string` | no | `value` | A URL indicating a PNG image to be overlaid above this image. |
399
+ | `--watermark-position` | `string[]` | no | `bottom` | The position at which the watermark is placed. The available options are "center", "top", "bottom", "left", and "right". You can also combine options, such as "bottom-right". An… |
400
+ | `--watermark-x-offset` | `number` | no | `1` | The x-offset in number of pixels at which the watermark will be placed in relation to the position it has due to watermark_position. |
401
+ | `--watermark-y-offset` | `number` | no | `1` | The y-offset in number of pixels at which the watermark will be placed in relation to the position it has due to watermark_position. |
402
+ | `--watermark-size` | `string` | no | `value` | The size of the watermark, as a percentage. For example, a value of "50%" means that size of the watermark will be 50% of the size of image on which it is placed. The exact… |
403
+ | `--watermark-resize-strategy` | `string` | no | `area` | Available values are "fit", "min_fit", "stretch" and "area". |
404
+ | `--watermark-opacity` | `number` | no | `1` | The opacity of the watermark, where 0.0 is fully transparent and 1.0 is fully opaque. |
405
+ | `--watermark-repeat-x` | `boolean` | no | `true` | When set to true, the watermark will be repeated horizontally across the entire width of the image. |
406
+ | `--watermark-repeat-y` | `boolean` | no | `true` | When set to true, the watermark will be repeated vertically across the entire height of the image. |
407
+ | `--text` | `json` | no | `value` | Text overlays to be applied to the image. Can be either a single text object or an array of text objects. Each text object contains text rules. The following text parameters are… |
408
+ | `--progressive` | `boolean` | no | `true` | Interlaces the image if set to true, which makes the image load progressively in browsers. |
409
+ | `--transparent` | `string` | no | `transparent` | Make this color transparent within the image. Example: "255,255,255". |
410
+ | `--trim-whitespace` | `boolean` | no | `true` | This determines if additional whitespace around the image should first be trimmed away. |
411
+ | `--clip` | `auto` | no | `value` | Apply the clipping path to other operations in the resize job, if one is present. |
412
+ | `--negate` | `boolean` | no | `true` | Replace each pixel with its complementary color, effectively negating the image. Especially useful when testing clipping. |
413
+ | `--density` | `string` | no | `value` | While in-memory quality and file format depth specifies the color resolution, the density of an image is the spatial (space) resolution of the image. |
414
+ | `--monochrome` | `boolean` | no | `true` | Transform the image to black and white. This is a shortcut for setting the colorspace to Gray and type to Bilevel. |
415
+ | `--shave` | `auto` | no | `value` | Shave pixels from the image edges. The value should be in the format width or widthxheight to specify the number of pixels to remove from each side. |
416
+
417
+ **Examples**
418
+
419
+ ```bash
420
+ transloadit image resize --input input.png --out output.png
421
+ ```
422
+
423
+ #### `document convert`
424
+
425
+ Convert documents into different formats
426
+
427
+ Runs `/document/convert` on each input file and writes the result to `--out`.
428
+
429
+ **Usage**
430
+
431
+ ```bash
432
+ npx transloadit document convert --input <path|dir|url|-> [options]
433
+ ```
434
+
435
+ **Quick facts**
436
+
437
+ - Input: file, dir, URL, base64
438
+ - Output: file
439
+ - Execution: per-file; supports `--single-assembly` and `--watch`
440
+ - Backend: `/document/convert`
441
+
442
+ **Shared flags**
443
+
444
+ - Uses the shared file input and output flags listed above.
445
+ - Also supports the shared base processing flags, watch flags, bundling flags listed above.
446
+
447
+ **Command options**
448
+
449
+ | Flag | Type | Required | Example | Description |
450
+ | --- | --- | --- | --- | --- |
451
+ | `--format` | `string` | yes | `pdf` | The desired format for document conversion. |
452
+ | `--markdown-format` | `string` | no | `commonmark` | Markdown can be represented in several variants, so when using this Robot to transform Markdown into HTML please specify which revision is being used. |
453
+ | `--markdown-theme` | `string` | no | `bare` | This parameter overhauls your Markdown files styling based on several canned presets. |
454
+ | `--pdf-margin` | `string` | no | `value` | PDF Paper margins, separated by , and with units. We support the following unit values: px, in, cm, mm. Currently this parameter is only supported when converting from html. |
455
+ | `--pdf-print-background` | `boolean` | no | `true` | Print PDF background graphics. Currently this parameter is only supported when converting from html. |
456
+ | `--pdf-format` | `string` | no | `A0` | PDF paper format. Currently this parameter is only supported when converting from html. |
457
+ | `--pdf-display-header-footer` | `boolean` | no | `true` | Display PDF header and footer. Currently this parameter is only supported when converting from html. |
458
+ | `--pdf-header-template` | `string` | no | `value` | HTML template for the PDF print header. Should be valid HTML markup with following classes used to inject printing values into them: - date formatted print date - title document… |
459
+ | `--pdf-footer-template` | `string` | no | `value` | HTML template for the PDF print footer. Should use the same format as the pdf_header_template. Currently this parameter is only supported when converting from html, and requires… |
460
+
461
+ **Examples**
462
+
463
+ ```bash
464
+ transloadit document convert --input input.pdf --format pdf --out output.pdf
465
+ ```
466
+
467
+ #### `document optimize`
468
+
469
+ Reduce PDF file size
470
+
471
+ Runs `/document/optimize` on each input file and writes the result to `--out`.
472
+
473
+ **Usage**
474
+
475
+ ```bash
476
+ npx transloadit document optimize --input <path|dir|url|-> [options]
477
+ ```
478
+
479
+ **Quick facts**
480
+
481
+ - Input: file, dir, URL, base64
482
+ - Output: file
483
+ - Execution: per-file; supports `--single-assembly` and `--watch`
484
+ - Backend: `/document/optimize`
485
+
486
+ **Shared flags**
487
+
488
+ - Uses the shared file input and output flags listed above.
489
+ - Also supports the shared base processing flags, watch flags, bundling flags listed above.
490
+
491
+ **Command options**
492
+
493
+ | Flag | Type | Required | Example | Description |
494
+ | --- | --- | --- | --- | --- |
495
+ | `--preset` | `string` | no | `screen` | The quality preset to use for optimization. Each preset provides a different balance between file size and quality: - screen - Lowest quality, smallest file size. Best for screen… |
496
+ | `--image-dpi` | `number` | no | `1` | Target DPI (dots per inch) for embedded images. When specified, this overrides the DPI setting from the preset. Higher DPI values result in better image quality but larger file… |
497
+ | `--compress-fonts` | `boolean` | no | `true` | Whether to compress embedded fonts. When enabled, fonts are compressed to reduce file size. |
498
+ | `--subset-fonts` | `boolean` | no | `true` | Whether to subset embedded fonts, keeping only the glyphs that are actually used in the document. |
499
+ | `--remove-metadata` | `boolean` | no | `true` | Whether to strip document metadata (title, author, keywords, etc.) from the PDF. This can provide a small reduction in file size and may be useful for privacy. |
500
+ | `--linearize` | `boolean` | no | `true` | Whether to linearize (optimize for Fast Web View) the output PDF. |
501
+ | `--compatibility` | `string` | no | `1.4` | The PDF version compatibility level. Lower versions have broader compatibility but fewer features. Higher versions support more advanced features but may not open in older PDF… |
502
+
503
+ **Examples**
504
+
505
+ ```bash
506
+ transloadit document optimize --input input.pdf --out output.pdf
507
+ ```
508
+
509
+ #### `document auto-rotate`
510
+
511
+ Auto-rotate documents to the correct orientation
512
+
513
+ Runs `/document/autorotate` on each input file and writes the result to `--out`.
514
+
515
+ **Usage**
516
+
517
+ ```bash
518
+ npx transloadit document auto-rotate --input <path|dir|url|-> [options]
519
+ ```
520
+
521
+ **Quick facts**
522
+
523
+ - Input: file, dir, URL, base64
524
+ - Output: file
525
+ - Execution: per-file; supports `--single-assembly` and `--watch`
526
+ - Backend: `/document/autorotate`
527
+
528
+ **Shared flags**
529
+
530
+ - Uses the shared file input and output flags listed above.
531
+ - Also supports the shared base processing flags, watch flags, bundling flags listed above.
532
+
533
+ **Examples**
534
+
535
+ ```bash
536
+ transloadit document auto-rotate --input input.pdf --out output.pdf
537
+ ```
538
+
539
+ #### `document thumbs`
540
+
541
+ Extract thumbnail images from documents
542
+
543
+ Runs `/document/thumbs` on each input file and writes the results to `--out`.
544
+
545
+ **Usage**
546
+
547
+ ```bash
548
+ npx transloadit document thumbs --input <path|dir|url|-> [options]
549
+ ```
550
+
551
+ **Quick facts**
552
+
553
+ - Input: file, dir, URL, base64
554
+ - Output: directory
555
+ - Execution: per-file; supports `--single-assembly` and `--watch`
556
+ - Backend: `/document/thumbs`
557
+
558
+ **Shared flags**
559
+
560
+ - Uses the shared file input and output flags listed above.
561
+ - Also supports the shared base processing flags, watch flags, bundling flags listed above.
562
+
563
+ **Command options**
564
+
565
+ | Flag | Type | Required | Example | Description |
566
+ | --- | --- | --- | --- | --- |
567
+ | `--page` | `number` | no | `1` | The PDF page that you want to convert to an image. By default the value is null which means that all pages will be converted into images. |
568
+ | `--format` | `string` | no | `jpg` | The format of the extracted image(s). If you specify the value "gif", then an animated gif cycling through all pages is created. Please check out this demo to learn more about… |
569
+ | `--delay` | `number` | no | `1` | If your output format is "gif" then this parameter sets the number of 100th seconds to pass before the next frame is shown in the animation. |
570
+ | `--width` | `number` | no | `1` | Width of the new image, in pixels. If not specified, will default to the width of the input image |
571
+ | `--height` | `number` | no | `1` | Height of the new image, in pixels. If not specified, will default to the height of the input image |
572
+ | `--resize-strategy` | `string` | no | `crop` | One of the available resize strategies. |
573
+ | `--background` | `string` | no | `value` | Either the hexadecimal code or name of the color used to fill the background (only used for the pad resize strategy). |
574
+ | `--alpha` | `string` | no | `Remove` | Change how the alpha channel of the resulting image should work. |
575
+ | `--density` | `string` | no | `value` | While in-memory quality and file format depth specifies the color resolution, the density of an image is the spatial (space) resolution of the image. |
576
+ | `--antialiasing` | `boolean` | no | `true` | Controls whether or not antialiasing is used to remove jagged edges from text or images in a document. |
577
+ | `--colorspace` | `string` | no | `CMY` | Sets the image colorspace. For details about the available values, see the ImageMagick documentation. Please note that if you were using "RGB", we recommend using "sRGB".… |
578
+ | `--trim-whitespace` | `boolean` | no | `true` | This determines if additional whitespace around the PDF should first be trimmed away before it is converted to an image. |
579
+ | `--pdf-use-cropbox` | `boolean` | no | `true` | Some PDF documents lie about their dimensions. For instance they'll say they are landscape, but when opened in decent Desktop readers, it's really in portrait mode. This can… |
580
+ | `--turbo` | `boolean` | no | `true` | If you set this to false, the robot will not emit files as they become available. |
581
+
582
+ **Examples**
583
+
584
+ ```bash
585
+ transloadit document thumbs --input input.pdf --out output/
586
+ ```
587
+
588
+ #### `audio waveform`
589
+
590
+ Generate waveform images from audio
591
+
592
+ Runs `/audio/waveform` on each input file and writes the result to `--out`.
593
+
594
+ **Usage**
595
+
596
+ ```bash
597
+ npx transloadit audio waveform --input <path|dir|url|-> [options]
598
+ ```
599
+
600
+ **Quick facts**
601
+
602
+ - Input: file, dir, URL, base64
603
+ - Output: file
604
+ - Execution: per-file; supports `--single-assembly` and `--watch`
605
+ - Backend: `/audio/waveform`
606
+
607
+ **Shared flags**
608
+
609
+ - Uses the shared file input and output flags listed above.
610
+ - Also supports the shared base processing flags, watch flags, bundling flags listed above.
611
+
612
+ **Command options**
613
+
614
+ | Flag | Type | Required | Example | Description |
615
+ | --- | --- | --- | --- | --- |
616
+ | `--ffmpeg` | `json` | no | `value` | A parameter object to be passed to FFmpeg. If a preset is used, the options specified are merged on top of the ones from the preset. For available options, see the FFmpeg… |
617
+ | `--format` | `string` | no | `image` | The format of the result file. Can be "image" or "json". If "image" is supplied, a PNG image will be created, otherwise a JSON file. |
618
+ | `--width` | `number` | no | `1` | The width of the resulting image if the format "image" was selected. |
619
+ | `--height` | `number` | no | `1` | The height of the resulting image if the format "image" was selected. |
620
+ | `--antialiasing` | `auto` | no | `0` | Either a value of 0 or 1, or true/false, corresponding to if you want to enable antialiasing to achieve smoother edges in the waveform graph or not. |
621
+ | `--background-color` | `string` | no | `value` | The background color of the resulting image in the "rrggbbaa" format (red, green, blue, alpha), if the format "image" was selected. |
622
+ | `--center-color` | `string` | no | `value` | The color used in the center of the gradient. The format is "rrggbbaa" (red, green, blue, alpha). |
623
+ | `--outer-color` | `string` | no | `value` | The color used in the outer parts of the gradient. The format is "rrggbbaa" (red, green, blue, alpha). |
624
+ | `--style` | `string` | no | `v0` | Waveform style version. - "v0": Legacy waveform generation (default). - "v1": Advanced waveform generation with additional parameters. For backwards compatibility, numeric values… |
625
+ | `--split-channels` | `boolean` | no | `true` | Available when style is "v1". If set to true, outputs multi-channel waveform data or image files, one per channel. |
626
+ | `--zoom` | `number` | no | `1` | Available when style is "v1". Zoom level in samples per pixel. This parameter cannot be used together with pixels_per_second. |
627
+ | `--pixels-per-second` | `number` | no | `1` | Available when style is "v1". Zoom level in pixels per second. This parameter cannot be used together with zoom. |
628
+ | `--bits` | `number` | no | `8` | Available when style is "v1". Bit depth for waveform data. Can be 8 or 16. |
629
+ | `--start` | `number` | no | `1` | Available when style is "v1". Start time in seconds. |
630
+ | `--end` | `number` | no | `1` | Available when style is "v1". End time in seconds (0 means end of audio). |
631
+ | `--colors` | `string` | no | `audition` | Available when style is "v1". Color scheme to use. Can be "audition" or "audacity". |
632
+ | `--border-color` | `string` | no | `value` | Available when style is "v1". Border color in "rrggbbaa" format. |
633
+ | `--waveform-style` | `string` | no | `normal` | Available when style is "v1". Waveform style. Can be "normal" or "bars". |
634
+ | `--bar-width` | `number` | no | `1` | Available when style is "v1". Width of bars in pixels when waveform_style is "bars". |
635
+ | `--bar-gap` | `number` | no | `1` | Available when style is "v1". Gap between bars in pixels when waveform_style is "bars". |
636
+ | `--bar-style` | `string` | no | `square` | Available when style is "v1". Bar style when waveform_style is "bars". |
637
+ | `--axis-label-color` | `string` | no | `value` | Available when style is "v1". Color for axis labels in "rrggbbaa" format. |
638
+ | `--no-axis-labels` | `boolean` | no | `true` | Available when style is "v1". If set to true, renders waveform image without axis labels. |
639
+ | `--with-axis-labels` | `boolean` | no | `true` | Available when style is "v1". If set to true, renders waveform image with axis labels. |
640
+ | `--amplitude-scale` | `number` | no | `1` | Available when style is "v1". Amplitude scale factor. |
641
+ | `--compression` | `number` | no | `1` | Available when style is "v1". PNG compression level: 0 (none) to 9 (best), or -1 (default). Only applicable when format is "image". |
642
+
643
+ **Examples**
644
+
645
+ ```bash
646
+ transloadit audio waveform --input input.mp3 --out output.png
647
+ ```
648
+
649
+ #### `text speak`
650
+
651
+ Speak text
652
+
653
+ Runs `/text/speak` on each input file and writes the result to `--out`.
654
+
655
+ **Usage**
656
+
657
+ ```bash
658
+ npx transloadit text speak --input <path|dir|url|-> [options]
659
+ ```
660
+
661
+ **Quick facts**
662
+
663
+ - Input: file, dir, URL, base64
664
+ - Output: file
665
+ - Execution: per-file; supports `--single-assembly` and `--watch`
666
+ - Backend: `/text/speak`
667
+
668
+ **Shared flags**
669
+
670
+ - Uses the shared file input and output flags listed above.
671
+ - Also supports the shared base processing flags, watch flags, bundling flags listed above.
672
+
673
+ **Command options**
674
+
675
+ | Flag | Type | Required | Example | Description |
676
+ | --- | --- | --- | --- | --- |
677
+ | `--prompt` | `string` | no | `"A red bicycle in a studio"` | Which text to speak. You can also set this to null and supply an input text file. |
678
+ | `--provider` | `string` | yes | `aws` | Which AI provider to leverage. Transloadit outsources this task and abstracts the interface so you can expect the same data structures, but different latencies and information… |
679
+ | `--target-language` | `string` | no | `en-US` | The written language of the document. This will also be the language of the spoken text. The language should be specified in the BCP-47 format, such as "en-GB", "de-DE" or… |
680
+ | `--voice` | `string` | no | `female-1` | The gender to be used for voice synthesis. Please consult the list of supported languages and voices. |
681
+ | `--ssml` | `boolean` | no | `true` | Supply Speech Synthesis Markup Language instead of raw text, in order to gain more control over how your text is voiced, including rests and pronounciations. |
682
+
683
+ **Examples**
684
+
685
+ ```bash
686
+ transloadit text speak --input input.pdf --provider aws --out output.mp3
687
+ ```
688
+
689
+ #### `video thumbs`
690
+
691
+ Extract thumbnails from videos
692
+
693
+ Runs `/video/thumbs` on each input file and writes the results to `--out`.
694
+
695
+ **Usage**
696
+
697
+ ```bash
698
+ npx transloadit video thumbs --input <path|dir|url|-> [options]
699
+ ```
700
+
701
+ **Quick facts**
702
+
703
+ - Input: file, dir, URL, base64
704
+ - Output: directory
705
+ - Execution: per-file; supports `--single-assembly` and `--watch`
706
+ - Backend: `/video/thumbs`
707
+
708
+ **Shared flags**
709
+
710
+ - Uses the shared file input and output flags listed above.
711
+ - Also supports the shared base processing flags, watch flags, bundling flags listed above.
712
+
713
+ **Command options**
714
+
715
+ | Flag | Type | Required | Example | Description |
716
+ | --- | --- | --- | --- | --- |
717
+ | `--ffmpeg` | `json` | no | `value` | A parameter object to be passed to FFmpeg. If a preset is used, the options specified are merged on top of the ones from the preset. For available options, see the FFmpeg… |
718
+ | `--count` | `number` | no | `1` | The number of thumbnails to be extracted. As some videos have incorrect durations, the actual number of thumbnails generated may be less in rare cases. The maximum number of… |
719
+ | `--offsets` | `auto` | no | `value` | An array of offsets representing seconds of the file duration, such as [ 2, 45, 120 ]. |
720
+ | `--format` | `string` | no | `jpg` | The format of the extracted thumbnail. Supported values are "jpg", "jpeg" and "png". Even if you specify the format to be "jpeg" the resulting thumbnails will have a "jpg" file… |
721
+ | `--width` | `number` | no | `1` | The width of the thumbnail, in pixels. Defaults to the original width of the video. |
722
+ | `--height` | `number` | no | `1` | The height of the thumbnail, in pixels. Defaults to the original height of the video. |
723
+ | `--resize-strategy` | `string` | no | `crop` | One of the available resize strategies. |
724
+ | `--background` | `string` | no | `value` | The background color of the resulting thumbnails in the "rrggbbaa" format (red, green, blue, alpha) when used with the "pad" resize strategy. The default color is black. |
725
+ | `--rotate` | `number` | no | `0` | Forces the video to be rotated by the specified degree integer. |
726
+ | `--input-codec` | `string` | no | `value` | Specifies the input codec to use when decoding the video. This is useful for videos with special codecs that require specific decoders. |
727
+
728
+ **Examples**
729
+
730
+ ```bash
731
+ transloadit video thumbs --input input.mp4 --out output/
732
+ ```
733
+
734
+ #### `video encode-hls`
735
+
736
+ Run builtin/encode-hls-video@latest
737
+
738
+ Runs the `builtin/encode-hls-video@latest` template and writes the outputs to `--out`.
739
+
740
+ **Usage**
741
+
742
+ ```bash
743
+ npx transloadit video encode-hls --input <path|dir|url|-> [options]
744
+ ```
745
+
746
+ **Quick facts**
747
+
748
+ - Input: file, dir, URL, base64
749
+ - Output: directory
750
+ - Execution: per-file; supports `--single-assembly` and `--watch`
751
+ - Backend: `builtin/encode-hls-video@latest`
752
+
753
+ **Shared flags**
754
+
755
+ - Uses the shared file input and output flags listed above.
756
+ - Also supports the shared base processing flags, watch flags, bundling flags listed above.
757
+
758
+ **Examples**
759
+
760
+ ```bash
761
+ transloadit video encode-hls --input input.mp4 --out output/
762
+ ```
763
+
764
+ #### `image describe`
765
+
766
+ Describe images as labels or publishable text fields
767
+
768
+ Generates image labels through `/image/describe`, or structured altText/title/caption/description through `/ai/chat`, then writes the JSON result to `--out`.
769
+
770
+ **Usage**
771
+
772
+ ```bash
773
+ npx transloadit image describe --input <path|dir|url|-> [options]
774
+ ```
775
+
776
+ **Quick facts**
777
+
778
+ - Input: file, dir, URL, base64
779
+ - Output: file
780
+ - Execution: per-file; supports `--watch`
781
+ - Backend: semantic alias `image-describe`
782
+
783
+ **Shared flags**
784
+
785
+ - Uses the shared file input and output flags listed above.
786
+ - Also supports the shared base processing flags, watch flags listed above.
787
+
788
+ **Command options**
789
+
790
+ | Flag | Type | Required | Example | Description |
791
+ | --- | --- | --- | --- | --- |
792
+ | `--fields` | `string[]` | no | — | Describe output fields to generate, for example labels or altText,title,caption,description |
793
+ | `--for` | `string` | no | — | Use a named output profile, currently: wordpress |
794
+ | `--model` | `string` | no | — | Model to use for generated text fields (default: anthropic/claude-4-sonnet-20250514) |
795
+
796
+ **Examples**
797
+
798
+ ```bash
799
+ # Describe an image as labels
800
+ transloadit image describe --input hero.jpg --out labels.json
801
+ # Generate WordPress-ready fields
802
+ transloadit image describe --input hero.jpg --for wordpress --out fields.json
803
+ # Request a custom field set
804
+ transloadit image describe --input hero.jpg --fields altText,title,caption --out fields.json
805
+ ```
806
+
807
+ #### `markdown pdf`
808
+
809
+ Render Markdown files as PDFs
810
+
811
+ Runs `/document/convert` with `format: pdf`, letting the backend render Markdown and preserve features such as internal heading links in the generated PDF.
812
+
813
+ **Usage**
814
+
815
+ ```bash
816
+ npx transloadit markdown pdf --input <path|dir|url|-> [options]
817
+ ```
818
+
819
+ **Quick facts**
820
+
821
+ - Input: file, dir, URL, base64
822
+ - Output: file
823
+ - Execution: per-file; supports `--watch`
824
+ - Backend: semantic alias `markdown-pdf`
825
+
826
+ **Shared flags**
827
+
828
+ - Uses the shared file input and output flags listed above.
829
+ - Also supports the shared base processing flags, watch flags listed above.
830
+
831
+ **Command options**
832
+
833
+ | Flag | Type | Required | Example | Description |
834
+ | --- | --- | --- | --- | --- |
835
+ | `--markdown-format` | `string` | no | — | Markdown variant to parse, either commonmark or gfm |
836
+ | `--markdown-theme` | `string` | no | — | Markdown theme to render, either github or bare |
837
+
838
+ **Examples**
839
+
840
+ ```bash
841
+ # Render a Markdown file as a PDF file
842
+ transloadit markdown pdf --input README.md --out README.pdf
843
+ # Print a temporary result URL without downloading locally
844
+ transloadit markdown pdf --input README.md --print-urls
845
+ ```
846
+
847
+ #### `markdown docx`
848
+
849
+ Render Markdown files as DOCX documents
850
+
851
+ Runs `/document/convert` with `format: docx`, letting the backend render Markdown and convert it into a Word document.
852
+
853
+ **Usage**
854
+
855
+ ```bash
856
+ npx transloadit markdown docx --input <path|dir|url|-> [options]
857
+ ```
858
+
859
+ **Quick facts**
860
+
861
+ - Input: file, dir, URL, base64
862
+ - Output: file
863
+ - Execution: per-file; supports `--watch`
864
+ - Backend: semantic alias `markdown-docx`
865
+
866
+ **Shared flags**
867
+
868
+ - Uses the shared file input and output flags listed above.
869
+ - Also supports the shared base processing flags, watch flags listed above.
870
+
871
+ **Command options**
872
+
873
+ | Flag | Type | Required | Example | Description |
874
+ | --- | --- | --- | --- | --- |
875
+ | `--markdown-format` | `string` | no | — | Markdown variant to parse, either commonmark or gfm |
876
+ | `--markdown-theme` | `string` | no | — | Markdown theme to render, either github or bare |
877
+
878
+ **Examples**
879
+
880
+ ```bash
881
+ # Render a Markdown file as a DOCX file
882
+ transloadit markdown docx --input README.md --out README.docx
883
+ # Print a temporary result URL without downloading locally
884
+ transloadit markdown docx --input README.md --print-urls
885
+ ```
886
+
887
+ #### `file compress`
888
+
889
+ Compress files
890
+
891
+ Runs `/file/compress` for the provided inputs and writes the result to `--out`.
892
+
893
+ **Usage**
894
+
895
+ ```bash
896
+ npx transloadit file compress --input <path|dir|url|-> [options]
897
+ ```
898
+
899
+ **Quick facts**
900
+
901
+ - Input: file, dir, URL, base64
902
+ - Output: file
903
+ - Execution: single assembly
904
+ - Backend: `/file/compress`
905
+
906
+ **Shared flags**
907
+
908
+ - Uses the shared file input and output flags listed above.
909
+ - Also supports the shared base processing flags listed above.
910
+
911
+ **Command options**
912
+
913
+ | Flag | Type | Required | Example | Description |
914
+ | --- | --- | --- | --- | --- |
915
+ | `--format` | `string` | no | `zip` | The format of the archive to be created. Supported values are "tar" and "zip". Note that "tar" without setting gzip to true results in an archive that's not compressed in any way. |
916
+ | `--gzip` | `boolean` | no | `true` | Determines if the result archive should also be gzipped. Gzip compression is only applied if you use the "tar" format. |
917
+ | `--password` | `string` | no | `value` | This allows you to encrypt all archive contents with a password and thereby protect it against unauthorized use. |
918
+ | `--compression-level` | `number` | no | `1` | Determines how fiercely to try to compress the archive. -0 is compressionless, which is suitable for media that is already compressed. -1 is fastest with lowest compression. -9… |
919
+ | `--file-layout` | `string` | no | `advanced` | Determines if the result archive should contain all files in one directory (value for this is "simple") or in subfolders according to the explanation below (value for this is… |
920
+ | `--archive-name` | `string` | no | `value` | The name of the archive file to be created (without the file extension). |
921
+
922
+ **Examples**
923
+
924
+ ```bash
925
+ transloadit file compress --input input.file --out output.file
926
+ ```
927
+
928
+ #### `file decompress`
929
+
930
+ Decompress archives
931
+
932
+ Runs `/file/decompress` on each input file and writes the results to `--out`.
933
+
934
+ **Usage**
935
+
936
+ ```bash
937
+ npx transloadit file decompress --input <path|dir|url|-> [options]
938
+ ```
939
+
940
+ **Quick facts**
941
+
942
+ - Input: file, dir, URL, base64
943
+ - Output: directory
944
+ - Execution: per-file; supports `--single-assembly` and `--watch`
945
+ - Backend: `/file/decompress`
946
+
947
+ **Shared flags**
948
+
949
+ - Uses the shared file input and output flags listed above.
950
+ - Also supports the shared base processing flags, watch flags, bundling flags listed above.
951
+
952
+ **Examples**
953
+
954
+ ```bash
955
+ transloadit file decompress --input input.file --out output/
956
+ ```
957
+
958
+ <!-- GENERATED_INTENT_DOCS:END -->
959
+
960
+ For full control, create Assemblies directly using Assembly Instructions (steps) or Templates:
73
961
 
74
962
  ```bash
75
963
  # Process a file using a steps file
@@ -291,7 +1179,7 @@ npx transloadit assemblies list -l 7
291
1179
  The following code will upload an image and resize it to a thumbnail:
292
1180
 
293
1181
  ```javascript
294
- import { Transloadit } from 'transloadit'
1182
+ import { Transloadit } from '@transloadit/node'
295
1183
 
296
1184
  const transloadit = new Transloadit({
297
1185
  authKey: 'YOUR_TRANSLOADIT_KEY',
@@ -843,3 +1731,7 @@ Thanks to [Ian Hansen](https://github.com/supershabam) for donating the `translo
843
1731
  ## Development
844
1732
 
845
1733
  See [CONTRIBUTING](./CONTRIBUTING.md).
1734
+
1735
+
1736
+
1737
+