@kinetune/cli 0.6.0 → 0.8.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/README.md +14 -8
- package/dist/kinetune.mjs +78 -29
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,17 +14,22 @@ npx @kinetune/cli --help # or run it without installing
|
|
|
14
14
|
## Sign in
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
kinetune auth login # opens the browser: sign in, pick the
|
|
18
|
-
kinetune auth login --api-key kt_live_KEY # or store
|
|
19
|
-
kinetune auth status
|
|
17
|
+
kinetune auth login # opens the browser: sign in, pick the workspace, approve
|
|
18
|
+
kinetune auth login --api-key kt_live_KEY # or store a workspace API key
|
|
19
|
+
kinetune auth status # the workspace, its plan and credits
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
A
|
|
22
|
+
A new account sets up its workspace in the browser first: an artist's (one artist) or a label's (a roster),
|
|
23
|
+
and a plan. Uploading and making videos need an active plan; without one they answer `plan_required`.
|
|
24
|
+
|
|
25
|
+
A sign-in acts for the workspace you picked (an "organization" in commands and fields). To work in another
|
|
26
|
+
one, sign in again and pick it:
|
|
23
27
|
|
|
24
28
|
```bash
|
|
25
|
-
kinetune organizations list
|
|
26
|
-
kinetune organizations create --name "Night Shift Records"
|
|
27
|
-
kinetune
|
|
29
|
+
kinetune organizations list # yours, with type and role; "current" is the one you act for
|
|
30
|
+
kinetune organizations create --name "Night Shift Records" --type label
|
|
31
|
+
kinetune organizations update --type label # switch this one (an artist workspace holds one artist)
|
|
32
|
+
kinetune auth login --organization ORG_ID # the consent screen preselects it
|
|
28
33
|
```
|
|
29
34
|
|
|
30
35
|
In CI, set `KINETUNE_API_KEY` instead; it wins over the stored sign-in. Credentials live in `~/.config/kinetune/config.json` (mode 600, `KINETUNE_CONFIG_DIR` to move it).
|
|
@@ -34,9 +39,10 @@ In CI, set `KINETUNE_API_KEY` instead; it wins over the stored sign-in. Credenti
|
|
|
34
39
|
```bash
|
|
35
40
|
kinetune artists create --name "Nova Lane"
|
|
36
41
|
kinetune songs create --artist-id ARTIST_ID --title "Midnight Drive" --audio ./midnight-drive.wav --cover-art ./cover.jpg
|
|
42
|
+
# in an artist workspace, --artist-id can be left out: its songs are its artist's
|
|
37
43
|
kinetune songs get SONG_ID # wait for analysis.status "ready"
|
|
38
44
|
kinetune create canvas --song-id SONG_ID # quotes first, shows the credits and asks
|
|
39
|
-
kinetune videos wait VIDEO_ID
|
|
45
|
+
kinetune videos wait VIDEO_ID # its progress, or why it waits (its place in line, or busy machines)
|
|
40
46
|
kinetune videos download VIDEO_ID
|
|
41
47
|
```
|
|
42
48
|
|
package/dist/kinetune.mjs
CHANGED
|
@@ -20248,6 +20248,9 @@ var backgroundMedia = {
|
|
|
20248
20248
|
prompt: external_exports.string().min(10).max(2e3),
|
|
20249
20249
|
// never asks for text or visualizer-like elements
|
|
20250
20250
|
search: external_exports.array(external_exports.string().min(2).max(80)).min(1).max(3).optional(),
|
|
20251
|
+
// A grounded AI background (generated): the stock photo searches for each scene (the first plate, then each
|
|
20252
|
+
// of `scenes`), the most specific first, then a broader one; each plate is made from one real photo.
|
|
20253
|
+
reference_searches: external_exports.array(external_exports.array(external_exports.string().min(2).max(80)).min(1).max(2)).min(1).max(4).optional(),
|
|
20251
20254
|
blur: external_exports.number().min(0).max(24),
|
|
20252
20255
|
dim: external_exports.number().min(0).max(0.8),
|
|
20253
20256
|
// The background shows the artist: the artist photos (ids) the image model kept their identity
|
|
@@ -20379,6 +20382,7 @@ var BACKGROUND_SOURCES2 = {
|
|
|
20379
20382
|
var MAX_BACKGROUND_SCENES = 4;
|
|
20380
20383
|
var SINGLE_SCENE_STYLES = ["behind", "screen"];
|
|
20381
20384
|
var StockIdSchema = external_exports.string().regex(/^\d{1,20}$/, "A stock photo or video id (digits)");
|
|
20385
|
+
var BACKGROUND_REFERENCES = ["none", "stock"];
|
|
20382
20386
|
var BackgroundRequestSchema = external_exports.object({
|
|
20383
20387
|
source: external_exports.enum(BACKGROUND_SOURCE_IDS).optional(),
|
|
20384
20388
|
quality: external_exports.enum(BACKGROUND_TIERS).default("high"),
|
|
@@ -20387,7 +20391,9 @@ var BackgroundRequestSchema = external_exports.object({
|
|
|
20387
20391
|
/** How many scenes an AI image background has (1 by default). */
|
|
20388
20392
|
scenes: external_exports.number().int().min(1).max(MAX_BACKGROUND_SCENES).optional(),
|
|
20389
20393
|
/** The stock photo or video (GET /stock) for the stock-photo and stock-video sources; omitted, the director searches and picks. */
|
|
20390
|
-
stock_id: StockIdSchema.optional()
|
|
20394
|
+
stock_id: StockIdSchema.optional(),
|
|
20395
|
+
/** "stock" grounds an AI image or AI video background in real stock photos (references only); "none" by default. */
|
|
20396
|
+
references: external_exports.enum(BACKGROUND_REFERENCES).optional()
|
|
20391
20397
|
}).strict();
|
|
20392
20398
|
var BACKGROUND_UPLOAD_LIMITS = {
|
|
20393
20399
|
image: { maxBytes: 25 * 1024 * 1024, minShortSide: 720, types: ["image/jpeg", "image/png", "image/webp"] },
|
|
@@ -20441,6 +20447,10 @@ var LyricVideoRequestSchema = external_exports.object({
|
|
|
20441
20447
|
if (value.look.background.stock_id && BACKGROUND_SOURCES2[backgroundSourceFor(value.look.category, value.look.background)].source !== "stock")
|
|
20442
20448
|
ctx.addIssue({ code: "custom", path: ["look", "background", "stock_id"], message: "stock_id goes with the stock-photo and stock-video sources" });
|
|
20443
20449
|
if (upload && value.look.visibility === "public") ctx.addIssue({ code: "custom", path: ["look", "visibility"], message: "A Look with your own background stays private" });
|
|
20450
|
+
if (value.look.background.references === "stock" && BACKGROUND_SOURCES2[backgroundSourceFor(value.look.category, value.look.background)].source !== "generated")
|
|
20451
|
+
ctx.addIssue({ code: "custom", path: ["look", "background", "references"], message: "references goes with the ai-image and ai-video sources" });
|
|
20452
|
+
else if (value.look.background.references === "stock" && value.look.feature_artist !== "always")
|
|
20453
|
+
ctx.addIssue({ code: "custom", path: ["look", "background", "references"], message: 'references "stock" goes with feature_artist "always": the stock photo is the place the artist is shown in' });
|
|
20444
20454
|
if ((value.look.background.scenes ?? 1) > 1 && backgroundSourceFor(value.look.category, value.look.background) !== "ai-image")
|
|
20445
20455
|
ctx.addIssue({ code: "custom", path: ["look", "background", "scenes"], message: "More than one scene is only available with an AI image background" });
|
|
20446
20456
|
if ((value.look.background.scenes ?? 1) > 1 && SINGLE_SCENE_STYLES.includes(value.look.lyric_style ?? ""))
|
|
@@ -20485,6 +20495,13 @@ var CanvasRequestSchema = external_exports.object({
|
|
|
20485
20495
|
});
|
|
20486
20496
|
var VideoRequestSchema = external_exports.discriminatedUnion("type", [LyricVideoRequestSchema, CanvasRequestSchema]);
|
|
20487
20497
|
|
|
20498
|
+
// ../api-spec/src/queue.ts
|
|
20499
|
+
var minutes = (seconds) => Math.max(1, Math.round(seconds / 60));
|
|
20500
|
+
function queueLabel(queue) {
|
|
20501
|
+
if (queue.reason === "plan_limit") return queue.position && queue.position > 1 ? `#${queue.position} in line` : "Next in line";
|
|
20502
|
+
return queue.estimated_wait_seconds != null ? `Machines busy \xB7 about ${minutes(queue.estimated_wait_seconds)} min` : "Machines busy";
|
|
20503
|
+
}
|
|
20504
|
+
|
|
20488
20505
|
// ../api-spec/src/index.ts
|
|
20489
20506
|
var SCOPES = ["videos:read", "videos:write", "music:read", "music:write", "library:read", "library:write", "organizations:read", "organizations:write"];
|
|
20490
20507
|
var SCOPE_DESCRIPTIONS = {
|
|
@@ -20494,8 +20511,8 @@ var SCOPE_DESCRIPTIONS = {
|
|
|
20494
20511
|
"music:write": "Add, rename and archive artists and songs, upload songs and artist photos",
|
|
20495
20512
|
"library:read": "Browse Looks",
|
|
20496
20513
|
"library:write": "Rename, delete and publish your Looks",
|
|
20497
|
-
"organizations:read": "See the
|
|
20498
|
-
"organizations:write": "Create
|
|
20514
|
+
"organizations:read": "See the workspaces you belong to",
|
|
20515
|
+
"organizations:write": "Create workspaces you own, and rename or switch the type of one you own or run"
|
|
20499
20516
|
};
|
|
20500
20517
|
var id = (what) => external_exports.string().min(1).max(120).describe(`The ${what} id`);
|
|
20501
20518
|
var songId = id("song");
|
|
@@ -20509,6 +20526,7 @@ var search = (q) => ({
|
|
|
20509
20526
|
});
|
|
20510
20527
|
var httpsUrl = (what) => external_exports.string().url().max(2e3).describe(`A public https URL of ${what}`);
|
|
20511
20528
|
var LYRICS = "The song\u2019s lyrics as text: plain (Suno-style [Verse]/[Chorus] tags and (x2) marks are fine), or the contents of an SRT, WebVTT or LRC file. Every word is still timed from the audio: your text fixes misheard words and sets where lines break in videos. A part sung again (a chorus) can be written once; lyrics that don\u2019t match what\u2019s sung, or cover only part of it, are refused";
|
|
20529
|
+
var NEEDS_PLAN = "Needs an active plan (402 plan_required without one; get_account: plan.active).";
|
|
20512
20530
|
var COVER_SIZES = "cover_art.url is the cover at up to 1536 px (JPEG; width and height describe it), preview_url a 640 px and thumbnail_url a 160 px WebP. Image links are signed for 7 days and stay the same all day, so they can be cached.";
|
|
20513
20531
|
var { type: _lyricType, quote_id: _lyricQuote, ...lyricShape } = LyricVideoRequestSchema.shape;
|
|
20514
20532
|
var { type: _canvasType, quote_id: _canvasQuote, ...canvasShape } = CanvasRequestSchema.shape;
|
|
@@ -20520,7 +20538,7 @@ var lyricInput = external_exports.object({
|
|
|
20520
20538
|
song_id: songId,
|
|
20521
20539
|
callback_url: CALLBACK,
|
|
20522
20540
|
metadata: METADATA,
|
|
20523
|
-
look: lyricShape.look.describe(`{"mode":"existing","id":"look_\u2026"} to reuse a saved Look (add "lyric_style" to render it in another lyric style, at no extra cost), or {"mode":"new","category":"\u2026","lyric_style":"\u2026","background":{"source":"ai-image","quality":"high"},"visibility":"private","direction":"\u2026"} to have one designed (background.source "upload-photo"/"upload-video" with background.upload_id from upload_background designs it around your own media; such a Look stays private. "stock-photo"/"stock-video" with background.stock_id from search_stock uses that stock photo or clip instead of the director's pick). lyric_style (optional, from get_options) sets how the lyrics are presented and animated: block-stack, punch, player, neon, terminal, cinematic\u2026 Omit it and the director picks one. background.scenes (2\u20134, AI image only) makes that many shots of the same world that cut on the song's sections, each priced like the first. The singer is left out unless asked: feature_artist "always" (default "never") makes them the subject of the background, recognizable from their artist photos (add_artist_photos); it needs an AI image or AI video background, a private Look and display.cover false (the cover would hide them), and that Look then only serves this artist's songs. A saved Look that shows an artist (featured_artist) only serves that artist's songs, also with display.cover false`),
|
|
20541
|
+
look: lyricShape.look.describe(`{"mode":"existing","id":"look_\u2026"} to reuse a saved Look (add "lyric_style" to render it in another lyric style, at no extra cost), or {"mode":"new","category":"\u2026","lyric_style":"\u2026","background":{"source":"ai-image","quality":"high"},"visibility":"private","direction":"\u2026"} to have one designed (background.source "upload-photo"/"upload-video" with background.upload_id from upload_background designs it around your own media; such a Look stays private. "stock-photo"/"stock-video" with background.stock_id from search_stock uses that stock photo or clip instead of the director's pick). lyric_style (optional, from get_options) sets how the lyrics are presented and animated: block-stack, punch, player, neon, terminal, cinematic\u2026 Omit it and the director picks one. background.scenes (2\u20134, AI image only) makes that many shots of the same world that cut on the song's sections, each priced like the first. background.references "stock" (AI image or AI video, default "none") with feature_artist "always" makes the background one real stock photo of a place the director picks, with the artist put into it and restyled a little for the Look; no extra cost. The singer is left out unless asked: feature_artist "always" (default "never") makes them the subject of the background, recognizable from their artist photos (add_artist_photos); it needs an AI image or AI video background, a private Look and display.cover false (the cover would hide them), and that Look then only serves this artist's songs. A saved Look that shows an artist (featured_artist) only serves that artist's songs, also with display.cover false`),
|
|
20524
20542
|
aspect_ratios: lyricShape.aspect_ratios.describe('Formats to render, each its own file: "9:16" (vertical), "16:9" (wide), "1:1" (square)'),
|
|
20525
20543
|
display: lyricShape.display.describe("Which elements show (title, artist, cover, lyrics, badges, headline) and their sizes. cover must be false to show the artist in the background"),
|
|
20526
20544
|
trim: lyricShape.trim.describe("Render only this section of the song (at least 8 seconds)"),
|
|
@@ -20555,6 +20573,11 @@ var VideoOutputSchema = external_exports.looseObject({
|
|
|
20555
20573
|
bitrate_kbps: external_exports.number().int().nullable().optional(),
|
|
20556
20574
|
web_size_bytes: external_exports.number().int().nullable().optional()
|
|
20557
20575
|
});
|
|
20576
|
+
var VideoQueueSchema = external_exports.object({
|
|
20577
|
+
reason: external_exports.enum(["plan_limit", "render_capacity"]).describe("plan_limit: the organization already makes as many videos at once as its plan allows, so this one starts when one of them finishes. render_capacity: every render machine is busy, so parts of this video wait their turn (higher plans get a larger share of the machines)"),
|
|
20578
|
+
position: external_exports.number().int().nullable().describe("plan_limit: its place among the organization's waiting videos (1 starts next); null otherwise"),
|
|
20579
|
+
estimated_wait_seconds: external_exports.number().int().nullable().describe("render_capacity: about how long until all of it is rendering, in seconds; null otherwise")
|
|
20580
|
+
});
|
|
20558
20581
|
var VideoSchema = external_exports.looseObject({
|
|
20559
20582
|
id: external_exports.string(),
|
|
20560
20583
|
type: external_exports.enum(["lyric-video", "canvas"]),
|
|
@@ -20564,6 +20587,7 @@ var VideoSchema = external_exports.looseObject({
|
|
|
20564
20587
|
status: external_exports.enum(["queued", "processing", "completed", "failed", "cancelled"]),
|
|
20565
20588
|
stage: external_exports.string().describe("The step it is at while it is made"),
|
|
20566
20589
|
progress: external_exports.number().describe("0\u2013100"),
|
|
20590
|
+
queue: VideoQueueSchema.nullable().describe("Why the video is waiting, while it waits (its plan's limit, or every render machine busy); null otherwise"),
|
|
20567
20591
|
outputs: external_exports.array(VideoOutputSchema).describe("One file per format, once delivered"),
|
|
20568
20592
|
song: external_exports.object({ id: external_exports.string().nullable(), title: external_exports.string().nullable(), artist_name: external_exports.string().nullable() }),
|
|
20569
20593
|
request: external_exports.record(external_exports.string(), external_exports.unknown()).describe("What the video was made from, with your metadata"),
|
|
@@ -20585,8 +20609,8 @@ var OPERATIONS = [
|
|
|
20585
20609
|
id: "account.get",
|
|
20586
20610
|
group: "account",
|
|
20587
20611
|
title: "Get the account",
|
|
20588
|
-
summary: "Who you are signed in as, the organization and its credit balance",
|
|
20589
|
-
description: "Returns the organization the credentials act for, how they authenticate and their scopes, the credit balance (available, monthly, top-ups) and its plan, if any (where it is billed, when the period ends, and a downgrade or interval switch waiting for the renewal as scheduled_change
|
|
20612
|
+
summary: "Who you are signed in as, the organization (workspace) and its credit balance",
|
|
20613
|
+
description: "Returns the organization the credentials act for (the workspace, as the app calls it; type artist holds one artist, label a roster), how they authenticate and their scopes, the credit balance (available, monthly, top-ups) and its plan, if any: active says whether it lets the workspace create (without an active plan, creating answers 402 plan_required: tell the person to choose a plan in the app), where it is billed, when the period ends, and a downgrade or interval switch waiting for the renewal as scheduled_change. Monthly credits reset every month; top-ups never expire. Check it before creating anything.",
|
|
20590
20614
|
method: "GET",
|
|
20591
20615
|
path: "/api/v1/account",
|
|
20592
20616
|
scopes: ["videos:read", "music:read", "library:read"],
|
|
@@ -20618,7 +20642,7 @@ var OPERATIONS = [
|
|
|
20618
20642
|
group: "account",
|
|
20619
20643
|
title: "List your organizations",
|
|
20620
20644
|
summary: "The organizations you belong to, your role in each and the one these credentials act for",
|
|
20621
|
-
description: "Every organization the signed-in person is a member of; with an API key, the member who created it (the key needs organizations:read). current marks the organization these credentials act for. Each organization has its own music, videos, Looks and credits: to work in another one, sign in again and pick it on the consent screen, or use an API key created in it.",
|
|
20645
|
+
description: "Every organization (workspace, in the app) the signed-in person is a member of; with an API key, the member who created it (the key needs organizations:read). type is artist (one artist and its songs) or label (a roster of artists). current marks the organization these credentials act for. Each organization has its own plan, music, videos, Looks and credits: to work in another one, sign in again and pick it on the consent screen, or use an API key created in it.",
|
|
20622
20646
|
method: "GET",
|
|
20623
20647
|
path: "/api/v1/organizations",
|
|
20624
20648
|
scopes: ["organizations:read"],
|
|
@@ -20634,17 +20658,40 @@ var OPERATIONS = [
|
|
|
20634
20658
|
group: "account",
|
|
20635
20659
|
title: "Create an organization",
|
|
20636
20660
|
summary: "A new organization owned by you, with its own music, videos, Looks and credits",
|
|
20637
|
-
description: "Creates an empty organization with the signed-in person as its owner; with an API key, the member who created the key (the key needs organizations:write). It starts with no credits. These credentials keep acting for their current organization: to work in the new one, sign in again and pick it, or create an API key in it.",
|
|
20661
|
+
description: "Creates an empty organization (a workspace, in the app) with the signed-in person as its owner; with an API key, the member who created the key (the key needs organizations:write). type artist is for one artist (add that artist next with create_artist; its songs then need no artist_id), label for a roster. It starts with no plan and no credits: the owner chooses a plan in the app before anything can be created in it. These credentials keep acting for their current organization: to work in the new one, sign in again and pick it, or create an API key in it.",
|
|
20638
20662
|
method: "POST",
|
|
20639
20663
|
path: "/api/v1/organizations",
|
|
20640
20664
|
scopes: ["organizations:write"],
|
|
20641
|
-
input: external_exports.object({
|
|
20665
|
+
input: external_exports.object({
|
|
20666
|
+
name: external_exports.string().trim().min(2).max(80).describe("The workspace name, as people see it in the app (an artist workspace usually carries the artist name)"),
|
|
20667
|
+
type: external_exports.enum(["artist", "label"]).describe("artist: one artist and its songs; label: a roster of artists")
|
|
20668
|
+
}),
|
|
20642
20669
|
readOnly: false,
|
|
20643
20670
|
destructive: false,
|
|
20644
20671
|
idempotent: false,
|
|
20645
20672
|
cli: ["organizations", "create"],
|
|
20646
20673
|
mcp: "create_organization",
|
|
20647
|
-
example: { name: "Night Shift Records" }
|
|
20674
|
+
example: { name: "Night Shift Records", type: "label" }
|
|
20675
|
+
},
|
|
20676
|
+
{
|
|
20677
|
+
id: "organizations.update",
|
|
20678
|
+
group: "account",
|
|
20679
|
+
title: "Update the organization",
|
|
20680
|
+
summary: "Rename the organization (workspace) these credentials act for, or switch it between artist and label",
|
|
20681
|
+
description: "Owners and admins only. An artist workspace can become a label any time; a label can become an artist workspace only while it has one artist or none (409 otherwise).",
|
|
20682
|
+
method: "PATCH",
|
|
20683
|
+
path: "/api/v1/organization",
|
|
20684
|
+
scopes: ["organizations:write"],
|
|
20685
|
+
input: external_exports.object({
|
|
20686
|
+
name: external_exports.string().trim().min(2).max(80).optional().describe("The new workspace name"),
|
|
20687
|
+
type: external_exports.enum(["artist", "label"]).optional().describe("artist (one artist) or label (a roster)")
|
|
20688
|
+
}),
|
|
20689
|
+
readOnly: false,
|
|
20690
|
+
destructive: false,
|
|
20691
|
+
idempotent: true,
|
|
20692
|
+
cli: ["organizations", "update"],
|
|
20693
|
+
mcp: "update_organization",
|
|
20694
|
+
example: { type: "label" }
|
|
20648
20695
|
},
|
|
20649
20696
|
/* Artists */
|
|
20650
20697
|
{
|
|
@@ -20668,7 +20715,7 @@ var OPERATIONS = [
|
|
|
20668
20715
|
group: "artists",
|
|
20669
20716
|
title: "Create an artist",
|
|
20670
20717
|
summary: "Add an artist by name",
|
|
20671
|
-
description:
|
|
20718
|
+
description: `Names are unique per organization (409 when taken). An artist workspace holds one artist: a second one is refused (409) until the workspace becomes a label (update_organization). Works without a plan, so onboarding can add the artist first.`,
|
|
20672
20719
|
method: "POST",
|
|
20673
20720
|
path: "/api/v1/artists",
|
|
20674
20721
|
scopes: ["music:write", "videos:write"],
|
|
@@ -20771,7 +20818,7 @@ var OPERATIONS = [
|
|
|
20771
20818
|
group: "artists",
|
|
20772
20819
|
title: "Add artist photos",
|
|
20773
20820
|
summary: "Upload one or more photos of the artist (JPEG, PNG or WebP)",
|
|
20774
|
-
description:
|
|
20821
|
+
description: `Up to 6 per artist, at least 512 px on the short side, up to 15 MB each. Only with the rights to use them (rights_confirmed). They are identity references only: never shown publicly or used as they are. Each is kept upright at up to 1536 px, with a small thumbnail; the uploaded file itself is not kept. ${NEEDS_PLAN}`,
|
|
20775
20822
|
method: "POST",
|
|
20776
20823
|
path: "/api/v1/artists/{artist_id}/photos",
|
|
20777
20824
|
scopes: ["music:write", "videos:write"],
|
|
@@ -20830,12 +20877,12 @@ var OPERATIONS = [
|
|
|
20830
20877
|
group: "songs",
|
|
20831
20878
|
title: "Upload a song",
|
|
20832
20879
|
summary: "Add a song: master audio and square cover art",
|
|
20833
|
-
description:
|
|
20880
|
+
description: `Audio: MP3, WAV or M4A up to 250 MB. Cover: a square JPEG or PNG, 1000\u20136000 px (3000\xD73000 recommended), up to 20 MB; it is kept at 1536, 640 and 160 px, not as uploaded. The song is analyzed next (lyrics, beats, sections): poll get_song until analysis.status is "ready", usually about a minute. Pass lyrics (or set them later with set_song_lyrics) to have the videos spell every word right. ${NEEDS_PLAN}`,
|
|
20834
20881
|
method: "POST",
|
|
20835
20882
|
path: "/api/v1/songs",
|
|
20836
20883
|
scopes: ["music:write", "videos:write"],
|
|
20837
20884
|
input: external_exports.object({
|
|
20838
|
-
artist_id: artistId,
|
|
20885
|
+
artist_id: artistId.optional().describe("The artist id. An artist workspace may leave it out: its songs are its artist's"),
|
|
20839
20886
|
title: external_exports.string().trim().min(1).max(300).describe("The song title"),
|
|
20840
20887
|
language: external_exports.string().regex(/^[a-z]{2,3}$/).optional().describe('Lyrics language (ISO 639-1, e.g. "en"); detected when omitted'),
|
|
20841
20888
|
audio_url: httpsUrl("the master audio").optional(),
|
|
@@ -20945,7 +20992,7 @@ var OPERATIONS = [
|
|
|
20945
20992
|
input: external_exports.object({ song_id: songId, lyrics: external_exports.string().min(1).max(1e5).describe("The lyrics: text, or an SRT, WebVTT or LRC file\u2019s contents") }),
|
|
20946
20993
|
textFiles: ["lyrics"],
|
|
20947
20994
|
readOnly: false,
|
|
20948
|
-
destructive:
|
|
20995
|
+
destructive: true,
|
|
20949
20996
|
idempotent: true,
|
|
20950
20997
|
cli: ["songs", "set-lyrics"],
|
|
20951
20998
|
mcp: "set_song_lyrics"
|
|
@@ -21061,7 +21108,7 @@ var OPERATIONS = [
|
|
|
21061
21108
|
group: "looks",
|
|
21062
21109
|
title: "Upload a background",
|
|
21063
21110
|
summary: "Upload your own photo or video to design a New Look around",
|
|
21064
|
-
description:
|
|
21111
|
+
description: `Photo: JPEG, PNG or WebP, at least 720 px on the short side, up to 25 MB. Video: MP4, MOV or WebM, 4\u2013180 seconds, at least 720 px on the short side, up to 300 MB; it becomes a seamless loop of up to 20 s. Only with the rights to use it. Then quote a lyric video with look {"mode":"new","category":"\u2026","background":{"source":"upload-photo" or "upload-video","upload_id":"\u2026"},"visibility":"private"}. ${NEEDS_PLAN}`,
|
|
21065
21112
|
method: "POST",
|
|
21066
21113
|
path: "/api/v1/backgrounds",
|
|
21067
21114
|
scopes: ["library:write", "videos:write"],
|
|
@@ -21138,7 +21185,7 @@ var OPERATIONS = [
|
|
|
21138
21185
|
group: "videos",
|
|
21139
21186
|
title: "Create a lyric video",
|
|
21140
21187
|
summary: "Make the lyric video a quote priced (spends credits)",
|
|
21141
|
-
description:
|
|
21188
|
+
description: `Send the same request as the quote plus its quote_id. Returns the video ids at once; poll get_video until status is completed (or failed). Each video has one file per format. ${NEEDS_PLAN}`,
|
|
21142
21189
|
method: "POST",
|
|
21143
21190
|
path: "/api/v1/videos",
|
|
21144
21191
|
scopes: ["videos:write"],
|
|
@@ -21155,7 +21202,7 @@ var OPERATIONS = [
|
|
|
21155
21202
|
group: "videos",
|
|
21156
21203
|
title: "Create a Canvas",
|
|
21157
21204
|
summary: "Make the Canvas a quote priced (spends credits)",
|
|
21158
|
-
description:
|
|
21205
|
+
description: `Send the same request as the quote plus its quote_id. Returns the video ids at once; poll get_video until status is completed. Upload the file in Spotify for Artists. ${NEEDS_PLAN}`,
|
|
21159
21206
|
method: "POST",
|
|
21160
21207
|
path: "/api/v1/videos",
|
|
21161
21208
|
scopes: ["videos:write"],
|
|
@@ -21172,7 +21219,7 @@ var OPERATIONS = [
|
|
|
21172
21219
|
group: "videos",
|
|
21173
21220
|
title: "List videos",
|
|
21174
21221
|
summary: "Videos, newest first, with status and thumbnails",
|
|
21175
|
-
description: "Each video's outputs carry aspect_ratio, poster_url, poster_seconds and web_url (for thumbnails and previews); get_video has the download links.",
|
|
21222
|
+
description: "Each video's outputs carry aspect_ratio, poster_url, poster_seconds and web_url (for thumbnails and previews); get_video has the download links. A video that is waiting has queue: why (plan_limit or render_capacity), its place in line or about how long.",
|
|
21176
21223
|
method: "GET",
|
|
21177
21224
|
path: "/api/v1/videos",
|
|
21178
21225
|
scopes: ["videos:read"],
|
|
@@ -21188,7 +21235,7 @@ var OPERATIONS = [
|
|
|
21188
21235
|
group: "videos",
|
|
21189
21236
|
title: "Get a video",
|
|
21190
21237
|
summary: "Status, progress, credits and, when completed, the download links",
|
|
21191
|
-
description: "status is queued, processing, completed, failed or cancelled. Completed videos have outputs with download_url (full quality), web_url (720p) and poster_url, signed for 7 days. A lyric video's poster is a frame with one whole lyric line on screen (the hook when it can be), ready to set as the thumbnail where you post it; a Canvas's is its first frame. poster_seconds says where in that file the poster was cut, for posts that take a cover frame offset instead of an image (TikTok); null on videos made before it was kept. Failed videos have error and error_code; AI_VIDEO_UNAVAILABLE means the AI video couldn\u2019t be made for a reason on our side, so make it again later.",
|
|
21238
|
+
description: "status is queued, processing, completed, failed or cancelled. While it waits, queue says why: plan_limit (the organization already makes as many videos at once as its plan allows; position is its place in line) or render_capacity (every render machine is busy; estimated_wait_seconds is about how long). Completed videos have outputs with download_url (full quality), web_url (720p) and poster_url, signed for 7 days. A lyric video's poster is a frame with one whole lyric line on screen (the hook when it can be), ready to set as the thumbnail where you post it; a Canvas's is its first frame. poster_seconds says where in that file the poster was cut, for posts that take a cover frame offset instead of an image (TikTok); null on videos made before it was kept. Failed videos have error and error_code; AI_VIDEO_UNAVAILABLE means the AI video couldn\u2019t be made for a reason on our side, so make it again later.",
|
|
21192
21239
|
method: "GET",
|
|
21193
21240
|
path: "/api/v1/videos/{video_id}",
|
|
21194
21241
|
scopes: ["videos:read"],
|
|
@@ -21327,7 +21374,7 @@ function openApiDocument(input2) {
|
|
|
21327
21374
|
"201": { description: "Created" },
|
|
21328
21375
|
"400": { description: "Invalid request" },
|
|
21329
21376
|
"401": { description: "Missing or invalid credentials" },
|
|
21330
|
-
"402": { description: "Not enough credits" },
|
|
21377
|
+
"402": { description: "Not enough credits, or no active plan (code plan_required)" },
|
|
21331
21378
|
"403": { description: "Missing scope" },
|
|
21332
21379
|
"404": { description: "Not found" },
|
|
21333
21380
|
"409": { description: "Conflict" },
|
|
@@ -24891,7 +24938,7 @@ async function revoke(config2) {
|
|
|
24891
24938
|
// package.json
|
|
24892
24939
|
var package_default = {
|
|
24893
24940
|
name: "@kinetune/cli",
|
|
24894
|
-
version: "0.
|
|
24941
|
+
version: "0.8.0",
|
|
24895
24942
|
description: "Command line for Kinetune: lyric videos and Spotify Canvas loops from your songs, for people and AI agents.",
|
|
24896
24943
|
license: "MIT",
|
|
24897
24944
|
homepage: "https://kinetune.com/developers#cli",
|
|
@@ -24960,7 +25007,7 @@ function print(data) {
|
|
|
24960
25007
|
if (Array.isArray(items) && items.length && typeof items[0] === "object") {
|
|
24961
25008
|
const keys = ["id", "name", "title", "artist_name", "song_title", "song_count", "type", "status", "stage", "progress", "category", "visibility", "analysis", "created_at"].filter((k) => items.some((i) => i[k] !== void 0)).slice(0, 6);
|
|
24962
25009
|
const cell = (v) => v === null || v === void 0 ? "" : typeof v === "object" ? (v.status ?? JSON.stringify(v)).toString() : String(v);
|
|
24963
|
-
const rows = [keys, ...items.map((i) => keys.map((k) => cell(i[k])))];
|
|
25010
|
+
const rows = [keys, ...items.map((i) => keys.map((k) => k === "progress" && i.queue ? queueLabel(i.queue) : cell(i[k])))];
|
|
24964
25011
|
const widths = keys.map((_, c) => Math.min(48, Math.max(...rows.map((r) => r[c].length))));
|
|
24965
25012
|
for (const row of rows) process.stdout.write(row.map((v, c) => v.slice(0, widths[c]).padEnd(widths[c])).join(" ") + "\n");
|
|
24966
25013
|
return;
|
|
@@ -24973,7 +25020,7 @@ async function credentials() {
|
|
|
24973
25020
|
if (config2.auth?.type === "api_key") return { token: config2.auth.api_key, config: config2 };
|
|
24974
25021
|
const token = await accessToken(config2);
|
|
24975
25022
|
if (token) return { token, config: config2 };
|
|
24976
|
-
throw new UsageError("Not signed in. Run `kinetune auth login` (or set KINETUNE_API_KEY to
|
|
25023
|
+
throw new UsageError("Not signed in. Run `kinetune auth login` (or set KINETUNE_API_KEY to a workspace API key).");
|
|
24977
25024
|
}
|
|
24978
25025
|
async function call(op, input2, files = []) {
|
|
24979
25026
|
const { token, config: config2 } = await credentials();
|
|
@@ -25110,7 +25157,8 @@ async function waitFor(videoId2, timeoutSeconds) {
|
|
|
25110
25157
|
let last = "";
|
|
25111
25158
|
for (; ; ) {
|
|
25112
25159
|
const video = await call(op, { video_id: videoId2 });
|
|
25113
|
-
const
|
|
25160
|
+
const detail = video.queue ? ` \xB7 ${queueLabel(video.queue)}` : video.progress !== void 0 ? ` \xB7 ${video.progress}%` : "";
|
|
25161
|
+
const line = `${video.status}${video.stage && video.stage !== video.status ? ` \xB7 ${video.stage}` : ""}${detail}`;
|
|
25114
25162
|
if (line !== last) {
|
|
25115
25163
|
say(line);
|
|
25116
25164
|
last = line;
|
|
@@ -25149,8 +25197,8 @@ function program2() {
|
|
|
25149
25197
|
return parent;
|
|
25150
25198
|
};
|
|
25151
25199
|
for (const op of OPERATIONS) addOperation(group(op.cli.slice(0, -1)), op);
|
|
25152
|
-
const auth = root.command("auth").description("Sign in with the app (OAuth) or
|
|
25153
|
-
auth.command("login").description("Sign in: opens the browser to sign in with the app, or stores an API key").option("--api-key <key>", "Use
|
|
25200
|
+
const auth = root.command("auth").description("Sign in with the app (OAuth) or a workspace API key");
|
|
25201
|
+
auth.command("login").description("Sign in: opens the browser to sign in with the app, or stores an API key").option("--api-key <key>", "Use a workspace API key instead (created in the app under API keys)").option("--no-browser", "Print the sign-in URL instead of opening the browser").option("--organization <id>", "Preselect this workspace on the consent screen (an id from `kinetune organizations list`)").option("--api-url <url>", "API base URL").option("--app-url <url>", "App base URL").action(async (options) => {
|
|
25154
25202
|
const config2 = { ...await loadConfig(), ...options.apiUrl ? { api_url: options.apiUrl } : {}, ...options.appUrl ? { app_url: options.appUrl } : {} };
|
|
25155
25203
|
if (options.apiKey) {
|
|
25156
25204
|
await saveConfig({ ...config2, auth: { type: "api_key", api_key: options.apiKey } });
|
|
@@ -25159,9 +25207,10 @@ function program2() {
|
|
|
25159
25207
|
await login(config2, { log: say, noBrowser: options.browser === false, organization: options.organization });
|
|
25160
25208
|
}
|
|
25161
25209
|
const account = await call(operation("account.get"), {});
|
|
25162
|
-
|
|
25210
|
+
const plan = account.plan?.active ? `${account.plan.name} plan, ${account.credits.available} credits` : "no plan yet: choose one in the app to upload and make videos";
|
|
25211
|
+
say(`Signed in to ${account.organization.name} (${plan}). Credentials: ${configFile()}`);
|
|
25163
25212
|
});
|
|
25164
|
-
auth.command("status").description("The
|
|
25213
|
+
auth.command("status").description("The workspace, its plan, how you are signed in and the credit balance").action(async () => print(await call(operation("account.get"), {})));
|
|
25165
25214
|
auth.command("token").description("Print the current bearer token (for curl or other tools)").action(async () => {
|
|
25166
25215
|
process.stdout.write((await credentials()).token + "\n");
|
|
25167
25216
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinetune/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Command line for Kinetune: lyric videos and Spotify Canvas loops from your songs, for people and AI agents.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://kinetune.com/developers#cli",
|