reelforge 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -95,6 +95,7 @@ Run `rf <command> --help` for full details on any of these.
95
95
  |---|---|
96
96
  | `templates list [--size 1080x1920] [--type image]` | List HTML frame templates |
97
97
  | `templates preview <keyOrPath> [-o out.png]` | Render a preview from a preset key **or your own local .html file** |
98
+ | `templates show <key> [-o file.html]` | Print or save the source HTML of any preset — copy it as a starting point for a custom template |
98
99
  | `frames render -t <keyOrPath> --title ... --text ...` | Render a single composed frame to PNG. `-t` accepts a preset key **or a local .html path** |
99
100
  | `compositions concat <v1> <v2> -o out.mp4` | FFmpeg concat (+ optional BGM) |
100
101
  | `compositions bgm -i video.mp4 --bgm bgm.mp3 -o out.mp4` | Add background music |
@@ -160,6 +161,8 @@ rf llm chat -p 'one-sentence summary of antifragile'
160
161
  # <meta name="template:width" content="1080">
161
162
  # <meta name="template:height" content="1920">
162
163
  # or pass --size 1080x1920 on the CLI.
164
+ rf templates show 1080x1920/image_default.html -o my-brand.html # copy a preset
165
+ # ...edit my-brand.html to suit your style...
163
166
  rf templates preview ./my-brand.html --title "Hello" -o preview.png
164
167
  rf frames render -t ./my-brand.html --values '{"author":"Alice"}' -o frame.png
165
168
  rf pipelines standard -t "宠物" --frame-template ./my-brand.html -o final.mp4
@@ -167,6 +170,14 @@ rf pipelines standard -t "宠物" --frame-template ./my-brand.html -o final.mp4
167
170
 
168
171
  ### Custom HTML templates
169
172
 
173
+ Easiest way to start: grab a preset as a reference.
174
+
175
+ ```bash
176
+ rf templates list # see all keys
177
+ rf templates show 1080x1920/static_default.html # print to stdout
178
+ rf templates show 1080x1920/image_default.html -o my-brand.html # save and edit
179
+ ```
180
+
170
181
  `{{title}}`, `{{text}}`, `{{image}}`, `{{index}}` are reserved built-ins; everything else uses the `{{name:type=default}}` DSL (`type` ∈ `text|number|color|bool`). Pass extras through `--values '{"author":"Alice"}'` (or `template_params` on the pipeline API).
171
182
 
172
183
  Limits and safety:
@@ -1,3 +1,7 @@
1
+ /**
2
+ * reelforge templates <list|preview|show>
3
+ */
4
+ import fs from "node:fs/promises";
1
5
  import { get, post } from "../client.js";
2
6
  import { downloadTo } from "../utils/download.js";
3
7
  import { print, success, table } from "../utils/output.js";
@@ -58,4 +62,32 @@ export function registerTemplates(program) {
58
62
  }
59
63
  print(r);
60
64
  });
65
+ tpl
66
+ .command("show <key>")
67
+ .description("Print or save the source HTML of a preset template — use as a starting point for your own")
68
+ .helpOption("-h, --help", "show help")
69
+ .option("-o, --output <file>", "save HTML to this path (otherwise print to stdout)")
70
+ .addHelpText("after", [
71
+ "",
72
+ "Examples:",
73
+ " # see what the default static template looks like",
74
+ " rf templates show 1080x1920/static_default.html",
75
+ "",
76
+ " # copy a preset and tweak it as your own brand template",
77
+ " rf templates show 1080x1920/image_default.html -o my-brand.html",
78
+ " # ...edit my-brand.html...",
79
+ " rf frames render -t ./my-brand.html --title 'X' -o frame.png",
80
+ "",
81
+ " Get the list of keys via `rf templates list`.",
82
+ ].join("\n"))
83
+ .action(async (key, opts) => {
84
+ const r = await get(`/api/v1/templates/source?key=${encodeURIComponent(key)}`);
85
+ if (opts.output) {
86
+ await fs.writeFile(opts.output, r.html, "utf-8");
87
+ success(`Saved → ${opts.output} (${r.size}, ${r.type}, ${r.params.length} custom params)`);
88
+ }
89
+ else {
90
+ process.stdout.write(r.html);
91
+ }
92
+ });
61
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reelforge",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "CLI for ReelForge Studio — AI video engine. Installs as both `reelforge` and the short alias `rf`. Every REST API exposed as a command, with --help on every level.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",