@kinetune/cli 0.3.0 → 0.5.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 +17 -0
- package/dist/kinetune.mjs +53 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,6 +19,14 @@ kinetune auth login --api-key kt_live_KEY # or store an organization API key
|
|
|
19
19
|
kinetune auth status
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
A sign-in acts for the organization you picked. To work in another one, sign in again and pick it:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
kinetune organizations list # yours, with your role; "current" is the one you act for
|
|
26
|
+
kinetune organizations create --name "Night Shift Records"
|
|
27
|
+
kinetune auth login --organization ORG_ID # the consent screen preselects it
|
|
28
|
+
```
|
|
29
|
+
|
|
22
30
|
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).
|
|
23
31
|
|
|
24
32
|
## Make a video
|
|
@@ -45,6 +53,15 @@ kinetune songs list --status ready --sort newest # analyzed songs, late
|
|
|
45
53
|
kinetune songs list --artist-id ARTIST_ID --offset 50 # the next page of one artist's songs
|
|
46
54
|
```
|
|
47
55
|
|
|
56
|
+
## Looks
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
kinetune looks list --scope official --lyric-style neon # browse
|
|
60
|
+
kinetune looks list --artist-id ARTIST_ID # leave out Looks that show another artist
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
A New Look leaves the singer out unless you ask: `"feature_artist":"always"` in the look (AI image or AI video, private, with `"cover":false` in display) makes them the subject of the background.
|
|
64
|
+
|
|
48
65
|
## For agents and scripts
|
|
49
66
|
|
|
50
67
|
- Path ids are arguments, fields are flags, `--input file.json` (or `-` for stdin) takes the whole request.
|
package/dist/kinetune.mjs
CHANGED
|
@@ -20396,8 +20396,8 @@ var BACKGROUND_UPLOAD_LIMITS = {
|
|
|
20396
20396
|
var isUploadSource = (source) => BACKGROUND_SOURCES2[source].source === "upload";
|
|
20397
20397
|
var backgroundSourcesFor = (category) => categoryUsesImages(category) ? MEDIA_BACKGROUND_SOURCES : ["designed"];
|
|
20398
20398
|
var backgroundSourceFor = (category, background) => background.source ?? backgroundSourcesFor(category)[0];
|
|
20399
|
-
var
|
|
20400
|
-
var
|
|
20399
|
+
var LOOK_FEATURE_ARTIST_MODES = ["never", "always"];
|
|
20400
|
+
var CANVAS_FEATURE_ARTIST_MODES = ["auto", "always", "never"];
|
|
20401
20401
|
var LookRequestSchema = external_exports.discriminatedUnion("mode", [
|
|
20402
20402
|
external_exports.object({
|
|
20403
20403
|
mode: external_exports.literal("new"),
|
|
@@ -20405,7 +20405,7 @@ var LookRequestSchema = external_exports.discriminatedUnion("mode", [
|
|
|
20405
20405
|
background: BackgroundRequestSchema.default({ quality: "high" }),
|
|
20406
20406
|
visibility: external_exports.enum(["private", "public"]).default("private"),
|
|
20407
20407
|
direction: external_exports.string().trim().max(2e3).optional(),
|
|
20408
|
-
feature_artist:
|
|
20408
|
+
feature_artist: external_exports.enum(LOOK_FEATURE_ARTIST_MODES).default("never"),
|
|
20409
20409
|
lyric_style: external_exports.enum(LYRIC_STYLE_IDS).optional()
|
|
20410
20410
|
}).strict(),
|
|
20411
20411
|
external_exports.object({ mode: external_exports.literal("existing"), id: external_exports.string().min(1).max(120), lyric_style: external_exports.enum(LYRIC_STYLE_IDS).optional() }).strict()
|
|
@@ -20449,6 +20449,7 @@ var LyricVideoRequestSchema = external_exports.object({
|
|
|
20449
20449
|
if (value.look.mode === "new" && value.look.feature_artist === "always") {
|
|
20450
20450
|
if (BACKGROUND_SOURCES2[backgroundSourceFor(value.look.category, value.look.background)].source !== "generated")
|
|
20451
20451
|
ctx.addIssue({ code: "custom", path: ["look", "feature_artist"], message: "Only an AI image or AI video background can show the artist" });
|
|
20452
|
+
if (value.display.cover) ctx.addIssue({ code: "custom", path: ["look", "feature_artist"], message: "Switch off the cover to show the artist: the cover would hide them" });
|
|
20452
20453
|
if (value.look.visibility === "public") ctx.addIssue({ code: "custom", path: ["look", "feature_artist"], message: "A Look that shows the artist stays private" });
|
|
20453
20454
|
}
|
|
20454
20455
|
});
|
|
@@ -20472,7 +20473,7 @@ var CanvasRequestSchema = external_exports.object({
|
|
|
20472
20473
|
resolution: external_exports.enum(CANVAS_RESOLUTIONS).default("1080p"),
|
|
20473
20474
|
style: external_exports.enum(CANVAS_STYLES).optional(),
|
|
20474
20475
|
direction: external_exports.string().trim().max(2e3).optional(),
|
|
20475
|
-
feature_artist:
|
|
20476
|
+
feature_artist: external_exports.enum(CANVAS_FEATURE_ARTIST_MODES).default("auto"),
|
|
20476
20477
|
seconds: external_exports.number().int().min(CANVAS_MIN_SECONDS).max(CANVAS_MAX_SECONDS).default(CANVAS_MAX_SECONDS),
|
|
20477
20478
|
/** The Pexels photo or video (GET /stock) for the stock sources; omitted, the director searches and picks. */
|
|
20478
20479
|
stock_id: StockIdSchema.optional()
|
|
@@ -20485,14 +20486,16 @@ var CanvasRequestSchema = external_exports.object({
|
|
|
20485
20486
|
var VideoRequestSchema = external_exports.discriminatedUnion("type", [LyricVideoRequestSchema, CanvasRequestSchema]);
|
|
20486
20487
|
|
|
20487
20488
|
// ../api-spec/src/index.ts
|
|
20488
|
-
var SCOPES = ["videos:read", "videos:write", "music:read", "music:write", "library:read", "library:write"];
|
|
20489
|
+
var SCOPES = ["videos:read", "videos:write", "music:read", "music:write", "library:read", "library:write", "organizations:read", "organizations:write"];
|
|
20489
20490
|
var SCOPE_DESCRIPTIONS = {
|
|
20490
20491
|
"videos:read": "See videos, quotes and your credit balance",
|
|
20491
20492
|
"videos:write": "Quote, create, cancel, retry and delete videos (spends credits)",
|
|
20492
20493
|
"music:read": "See artists, their photos and songs",
|
|
20493
20494
|
"music:write": "Add, rename and archive artists and songs, upload songs and artist photos",
|
|
20494
20495
|
"library:read": "Browse Looks",
|
|
20495
|
-
"library:write": "Rename, delete and publish your Looks"
|
|
20496
|
+
"library:write": "Rename, delete and publish your Looks",
|
|
20497
|
+
"organizations:read": "See the organizations you belong to",
|
|
20498
|
+
"organizations:write": "Create organizations you own"
|
|
20496
20499
|
};
|
|
20497
20500
|
var id = (what) => external_exports.string().min(1).max(120).describe(`The ${what} id`);
|
|
20498
20501
|
var songId = id("song");
|
|
@@ -20516,9 +20519,9 @@ var lyricInput = external_exports.object({
|
|
|
20516
20519
|
song_id: songId,
|
|
20517
20520
|
callback_url: CALLBACK,
|
|
20518
20521
|
metadata: METADATA,
|
|
20519
|
-
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"
|
|
20522
|
+
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 Pexels item 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`),
|
|
20520
20523
|
aspect_ratios: lyricShape.aspect_ratios.describe('Formats to render, each its own file: "9:16" (vertical), "16:9" (wide), "1:1" (square)'),
|
|
20521
|
-
display: lyricShape.display.describe("Which elements show (title, artist, cover, lyrics, badges, headline) and their sizes"),
|
|
20524
|
+
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"),
|
|
20522
20525
|
trim: lyricShape.trim.describe("Render only this section of the song (at least 8 seconds)"),
|
|
20523
20526
|
variations: lyricShape.variations.describe("1\u20134 different New Looks, one video each (an Existing Look renders one)")
|
|
20524
20527
|
});
|
|
@@ -20533,7 +20536,7 @@ var canvasInput = external_exports.object({
|
|
|
20533
20536
|
resolution: canvasShape.resolution.describe("1080p (1080\xD71920) or 720p"),
|
|
20534
20537
|
style: canvasShape.style.describe("Optional visual style"),
|
|
20535
20538
|
direction: canvasShape.direction.describe("Optional mood, motifs or references; the concept still comes from the cover"),
|
|
20536
|
-
feature_artist:
|
|
20539
|
+
feature_artist: canvasShape.feature_artist.describe('Whether the Canvas shows the artist: auto (the director decides), always or never (AI sources; needs artist photos for "always")'),
|
|
20537
20540
|
seconds: canvasShape.seconds.describe("Canvas length in whole seconds, 5\u20138 (default 8). Spotify loops it, so no part of the song is chosen"),
|
|
20538
20541
|
variations: canvasShape.variations.describe("1\u20134 different Canvases")
|
|
20539
20542
|
});
|
|
@@ -20572,6 +20575,39 @@ var OPERATIONS = [
|
|
|
20572
20575
|
cli: ["options"],
|
|
20573
20576
|
mcp: "get_options"
|
|
20574
20577
|
},
|
|
20578
|
+
{
|
|
20579
|
+
id: "organizations.list",
|
|
20580
|
+
group: "account",
|
|
20581
|
+
title: "List your organizations",
|
|
20582
|
+
summary: "The organizations you belong to, your role in each and the one these credentials act for",
|
|
20583
|
+
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.",
|
|
20584
|
+
method: "GET",
|
|
20585
|
+
path: "/api/v1/organizations",
|
|
20586
|
+
scopes: ["organizations:read"],
|
|
20587
|
+
input: external_exports.object({}),
|
|
20588
|
+
readOnly: true,
|
|
20589
|
+
destructive: false,
|
|
20590
|
+
idempotent: true,
|
|
20591
|
+
cli: ["organizations", "list"],
|
|
20592
|
+
mcp: "list_organizations"
|
|
20593
|
+
},
|
|
20594
|
+
{
|
|
20595
|
+
id: "organizations.create",
|
|
20596
|
+
group: "account",
|
|
20597
|
+
title: "Create an organization",
|
|
20598
|
+
summary: "A new organization owned by you, with its own music, videos, Looks and credits",
|
|
20599
|
+
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.",
|
|
20600
|
+
method: "POST",
|
|
20601
|
+
path: "/api/v1/organizations",
|
|
20602
|
+
scopes: ["organizations:write"],
|
|
20603
|
+
input: external_exports.object({ name: external_exports.string().trim().min(2).max(80).describe("The organization name, as people see it in the app") }),
|
|
20604
|
+
readOnly: false,
|
|
20605
|
+
destructive: false,
|
|
20606
|
+
idempotent: false,
|
|
20607
|
+
cli: ["organizations", "create"],
|
|
20608
|
+
mcp: "create_organization",
|
|
20609
|
+
example: { name: "Night Shift Records" }
|
|
20610
|
+
},
|
|
20575
20611
|
/* Artists */
|
|
20576
20612
|
{
|
|
20577
20613
|
id: "artists.list",
|
|
@@ -20863,7 +20899,7 @@ var OPERATIONS = [
|
|
|
20863
20899
|
group: "looks",
|
|
20864
20900
|
title: "List Looks",
|
|
20865
20901
|
summary: "Browse Official, Community and your own Looks",
|
|
20866
|
-
description:
|
|
20902
|
+
description: `A Look is a complete, reusable lyric-video design. Pass its id as {"mode":"existing","id":\u2026} to reuse it exactly. A Look that shows an artist (featured_artist) is private and only serves that artist's songs: choosing for a song, pass its artist_id to leave out Looks that show another artist.`,
|
|
20867
20903
|
method: "GET",
|
|
20868
20904
|
path: "/api/v1/looks",
|
|
20869
20905
|
scopes: ["library:read", "videos:read"],
|
|
@@ -20871,6 +20907,7 @@ var OPERATIONS = [
|
|
|
20871
20907
|
scope: external_exports.enum(["all", "official", "community", "mine"]).optional().describe("Which library; default all"),
|
|
20872
20908
|
category: external_exports.string().max(40).optional().describe("A category id from get_options"),
|
|
20873
20909
|
lyric_style: external_exports.string().max(40).optional().describe("A lyric style id from get_options (how the lyrics move)"),
|
|
20910
|
+
artist_id: artistId.optional().describe("The artist of the song you are choosing for: Looks that show another artist are left out"),
|
|
20874
20911
|
q: external_exports.string().max(100).optional().describe("Search words"),
|
|
20875
20912
|
sort: external_exports.enum(["newest", "popular"]).optional(),
|
|
20876
20913
|
limit: external_exports.number().int().min(1).max(100).optional(),
|
|
@@ -24700,7 +24737,9 @@ async function login(config2, input2) {
|
|
|
24700
24737
|
state,
|
|
24701
24738
|
code_challenge: challenge,
|
|
24702
24739
|
code_challenge_method: "S256",
|
|
24703
|
-
resource
|
|
24740
|
+
resource,
|
|
24741
|
+
// The consent screen preselects this organization (one of `kinetune organizations list`).
|
|
24742
|
+
...input2.organization ? { organization_hint: input2.organization } : {}
|
|
24704
24743
|
})) authorize.searchParams.set(k, v);
|
|
24705
24744
|
input2.log(`Opening your browser to sign in. If it doesn't open, visit:
|
|
24706
24745
|
${authorize}`);
|
|
@@ -24757,7 +24796,7 @@ async function revoke(config2) {
|
|
|
24757
24796
|
// package.json
|
|
24758
24797
|
var package_default = {
|
|
24759
24798
|
name: "@kinetune/cli",
|
|
24760
|
-
version: "0.
|
|
24799
|
+
version: "0.5.0",
|
|
24761
24800
|
description: "Command line for Kinetune: lyric videos and Spotify Canvas loops from your songs, for people and AI agents.",
|
|
24762
24801
|
license: "MIT",
|
|
24763
24802
|
homepage: "https://kinetune.com/developers#cli",
|
|
@@ -25010,13 +25049,13 @@ function program2() {
|
|
|
25010
25049
|
};
|
|
25011
25050
|
for (const op of OPERATIONS) addOperation(group(op.cli.slice(0, -1)), op);
|
|
25012
25051
|
const auth = root.command("auth").description("Sign in with the app (OAuth) or an organization API key");
|
|
25013
|
-
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 an organization API key instead (created in the app under API keys)").option("--no-browser", "Print the sign-in URL instead of opening the browser").option("--api-url <url>", "API base URL").option("--app-url <url>", "App base URL").action(async (options) => {
|
|
25052
|
+
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 an organization 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 organization 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) => {
|
|
25014
25053
|
const config2 = { ...await loadConfig(), ...options.apiUrl ? { api_url: options.apiUrl } : {}, ...options.appUrl ? { app_url: options.appUrl } : {} };
|
|
25015
25054
|
if (options.apiKey) {
|
|
25016
25055
|
await saveConfig({ ...config2, auth: { type: "api_key", api_key: options.apiKey } });
|
|
25017
25056
|
} else {
|
|
25018
25057
|
await saveConfig(config2);
|
|
25019
|
-
await login(config2, { log: say, noBrowser: options.browser === false });
|
|
25058
|
+
await login(config2, { log: say, noBrowser: options.browser === false, organization: options.organization });
|
|
25020
25059
|
}
|
|
25021
25060
|
const account = await call(operation("account.get"), {});
|
|
25022
25061
|
say(`Signed in to ${account.organization.name} (${account.credits.available} credits). Credentials: ${configFile()}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinetune/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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",
|