@heyamiko/amiko-cli 0.14.2 → 0.15.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.
- package/dist/index.js +27 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28694,7 +28694,7 @@ import { randomUUID } from "node:crypto";
|
|
|
28694
28694
|
var ETA = {
|
|
28695
28695
|
IMAGE: "~15–60s",
|
|
28696
28696
|
VIDEO: "~2–9 min",
|
|
28697
|
-
MUSIC: "~
|
|
28697
|
+
MUSIC: "~1–5 min",
|
|
28698
28698
|
TTS: "~5–20s",
|
|
28699
28699
|
SFX: "~5–20s"
|
|
28700
28700
|
};
|
|
@@ -28994,24 +28994,44 @@ function registerCreateCommand(create2) {
|
|
|
28994
28994
|
}
|
|
28995
28995
|
});
|
|
28996
28996
|
});
|
|
28997
|
-
create2.command("music [prompt]").description("Generate music (Create Studio)").option("--model <model>", "
|
|
28998
|
-
|
|
28999
|
-
|
|
28997
|
+
create2.command("music [prompt]").description("Generate music (Create Studio)").option("--model <model>", "music-3.0 (default), music-cover, music_v1. The retired MiniMax ids (music-2.0/2.5/2.6, -free) still resolve to music-3.0", "music-3.0").option("--lyrics <lyrics>", "Lyrics (optional; a prompt is still required for the style). Needs section tags on their own lines, e.g. [verse] / [chorus] — plain lyrics are rejected").option("--duration <ms>", "Length in ms — music-3.0 bills per second, so this sets the price").option("--audio-url <url>", "Public audio URL to cover (required by --model music-cover)").option("--instrumental", "Instrumental (no vocals)").option("--lyrics-optimizer", "Auto-write lyrics from the prompt. Only affects music_v1 — the fal models always write their own when no --lyrics is given").option("--token <symbol>", "Preferred charge token: AMIKO, USDC, USDT, SOL").option("--pay <method>", "Payment method: credits (Amiko account credits, default) or wallet (twin wallet)", "credits").option("--raw", "Output raw JSON").option("--yes", "Skip the pre-spend confirmation (required in non-interactive shells)").action(async (prompt, opts) => {
|
|
28998
|
+
const isCover = String(opts.model ?? "").startsWith("music-cover");
|
|
28999
|
+
if (isCover) {
|
|
29000
|
+
if (!opts.audioUrl) {
|
|
29001
|
+
console.error(error("--model music-cover requires --audio-url."));
|
|
29002
|
+
process.exit(1);
|
|
29003
|
+
}
|
|
29004
|
+
if (!prompt && !opts.lyrics) {
|
|
29005
|
+
console.error(error("--model music-cover requires a prompt or --lyrics describing the cover."));
|
|
29006
|
+
process.exit(1);
|
|
29007
|
+
}
|
|
29008
|
+
} else if (!prompt) {
|
|
29009
|
+
console.error(error("Provide a prompt. --lyrics alone is not enough — the prompt carries the style."));
|
|
29010
|
+
process.exit(1);
|
|
29011
|
+
}
|
|
29012
|
+
const durationMs = opts.duration ? Number(opts.duration) : undefined;
|
|
29013
|
+
if (durationMs !== undefined && (!Number.isFinite(durationMs) || durationMs <= 0)) {
|
|
29014
|
+
console.error(error("--duration must be a positive number of milliseconds."));
|
|
29000
29015
|
process.exit(1);
|
|
29001
29016
|
}
|
|
29002
29017
|
await submitCreateJob({
|
|
29003
29018
|
mode: "MUSIC",
|
|
29004
|
-
summary: `Create music: ${(prompt ?? opts.lyrics ?? "").slice(0, 80)}`,
|
|
29019
|
+
summary: `Create music: ${(prompt ?? opts.audioUrl ?? opts.lyrics ?? "").slice(0, 80)}`,
|
|
29005
29020
|
raw: opts.raw,
|
|
29006
29021
|
pay: opts.pay,
|
|
29007
29022
|
yes: opts.yes,
|
|
29008
|
-
quoteBody: {
|
|
29023
|
+
quoteBody: {
|
|
29024
|
+
mode: "MUSIC",
|
|
29025
|
+
model: opts.model,
|
|
29026
|
+
...durationMs ? { durationMs } : {}
|
|
29027
|
+
},
|
|
29009
29028
|
jobBody: {
|
|
29010
29029
|
mode: "MUSIC",
|
|
29011
29030
|
model: opts.model,
|
|
29012
29031
|
...prompt ? { prompt } : {},
|
|
29013
29032
|
...opts.lyrics ? { lyrics: opts.lyrics } : {},
|
|
29014
|
-
...
|
|
29033
|
+
...durationMs ? { durationMs } : {},
|
|
29034
|
+
...opts.audioUrl ? { audioUrl: opts.audioUrl } : {},
|
|
29015
29035
|
...opts.instrumental ? { isInstrumental: true } : {},
|
|
29016
29036
|
...opts.lyricsOptimizer ? { lyricsOptimizer: true } : {},
|
|
29017
29037
|
...opts.token ? { preferredToken: opts.token } : {}
|