@kinetune/cli 0.7.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 +13 -7
- package/dist/kinetune.mjs +59 -24
- 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,6 +39,7 @@ 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
45
|
kinetune videos wait VIDEO_ID # its progress, or why it waits (its place in line, or busy machines)
|
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 ?? ""))
|
|
@@ -20501,8 +20511,8 @@ var SCOPE_DESCRIPTIONS = {
|
|
|
20501
20511
|
"music:write": "Add, rename and archive artists and songs, upload songs and artist photos",
|
|
20502
20512
|
"library:read": "Browse Looks",
|
|
20503
20513
|
"library:write": "Rename, delete and publish your Looks",
|
|
20504
|
-
"organizations:read": "See the
|
|
20505
|
-
"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"
|
|
20506
20516
|
};
|
|
20507
20517
|
var id = (what) => external_exports.string().min(1).max(120).describe(`The ${what} id`);
|
|
20508
20518
|
var songId = id("song");
|
|
@@ -20516,6 +20526,7 @@ var search = (q) => ({
|
|
|
20516
20526
|
});
|
|
20517
20527
|
var httpsUrl = (what) => external_exports.string().url().max(2e3).describe(`A public https URL of ${what}`);
|
|
20518
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).";
|
|
20519
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.";
|
|
20520
20531
|
var { type: _lyricType, quote_id: _lyricQuote, ...lyricShape } = LyricVideoRequestSchema.shape;
|
|
20521
20532
|
var { type: _canvasType, quote_id: _canvasQuote, ...canvasShape } = CanvasRequestSchema.shape;
|
|
@@ -20527,7 +20538,7 @@ var lyricInput = external_exports.object({
|
|
|
20527
20538
|
song_id: songId,
|
|
20528
20539
|
callback_url: CALLBACK,
|
|
20529
20540
|
metadata: METADATA,
|
|
20530
|
-
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`),
|
|
20531
20542
|
aspect_ratios: lyricShape.aspect_ratios.describe('Formats to render, each its own file: "9:16" (vertical), "16:9" (wide), "1:1" (square)'),
|
|
20532
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"),
|
|
20533
20544
|
trim: lyricShape.trim.describe("Render only this section of the song (at least 8 seconds)"),
|
|
@@ -20598,8 +20609,8 @@ var OPERATIONS = [
|
|
|
20598
20609
|
id: "account.get",
|
|
20599
20610
|
group: "account",
|
|
20600
20611
|
title: "Get the account",
|
|
20601
|
-
summary: "Who you are signed in as, the organization and its credit balance",
|
|
20602
|
-
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.",
|
|
20603
20614
|
method: "GET",
|
|
20604
20615
|
path: "/api/v1/account",
|
|
20605
20616
|
scopes: ["videos:read", "music:read", "library:read"],
|
|
@@ -20631,7 +20642,7 @@ var OPERATIONS = [
|
|
|
20631
20642
|
group: "account",
|
|
20632
20643
|
title: "List your organizations",
|
|
20633
20644
|
summary: "The organizations you belong to, your role in each and the one these credentials act for",
|
|
20634
|
-
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.",
|
|
20635
20646
|
method: "GET",
|
|
20636
20647
|
path: "/api/v1/organizations",
|
|
20637
20648
|
scopes: ["organizations:read"],
|
|
@@ -20647,17 +20658,40 @@ var OPERATIONS = [
|
|
|
20647
20658
|
group: "account",
|
|
20648
20659
|
title: "Create an organization",
|
|
20649
20660
|
summary: "A new organization owned by you, with its own music, videos, Looks and credits",
|
|
20650
|
-
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.",
|
|
20651
20662
|
method: "POST",
|
|
20652
20663
|
path: "/api/v1/organizations",
|
|
20653
20664
|
scopes: ["organizations:write"],
|
|
20654
|
-
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
|
+
}),
|
|
20655
20669
|
readOnly: false,
|
|
20656
20670
|
destructive: false,
|
|
20657
20671
|
idempotent: false,
|
|
20658
20672
|
cli: ["organizations", "create"],
|
|
20659
20673
|
mcp: "create_organization",
|
|
20660
|
-
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" }
|
|
20661
20695
|
},
|
|
20662
20696
|
/* Artists */
|
|
20663
20697
|
{
|
|
@@ -20681,7 +20715,7 @@ var OPERATIONS = [
|
|
|
20681
20715
|
group: "artists",
|
|
20682
20716
|
title: "Create an artist",
|
|
20683
20717
|
summary: "Add an artist by name",
|
|
20684
|
-
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.`,
|
|
20685
20719
|
method: "POST",
|
|
20686
20720
|
path: "/api/v1/artists",
|
|
20687
20721
|
scopes: ["music:write", "videos:write"],
|
|
@@ -20784,7 +20818,7 @@ var OPERATIONS = [
|
|
|
20784
20818
|
group: "artists",
|
|
20785
20819
|
title: "Add artist photos",
|
|
20786
20820
|
summary: "Upload one or more photos of the artist (JPEG, PNG or WebP)",
|
|
20787
|
-
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}`,
|
|
20788
20822
|
method: "POST",
|
|
20789
20823
|
path: "/api/v1/artists/{artist_id}/photos",
|
|
20790
20824
|
scopes: ["music:write", "videos:write"],
|
|
@@ -20843,12 +20877,12 @@ var OPERATIONS = [
|
|
|
20843
20877
|
group: "songs",
|
|
20844
20878
|
title: "Upload a song",
|
|
20845
20879
|
summary: "Add a song: master audio and square cover art",
|
|
20846
|
-
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}`,
|
|
20847
20881
|
method: "POST",
|
|
20848
20882
|
path: "/api/v1/songs",
|
|
20849
20883
|
scopes: ["music:write", "videos:write"],
|
|
20850
20884
|
input: external_exports.object({
|
|
20851
|
-
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"),
|
|
20852
20886
|
title: external_exports.string().trim().min(1).max(300).describe("The song title"),
|
|
20853
20887
|
language: external_exports.string().regex(/^[a-z]{2,3}$/).optional().describe('Lyrics language (ISO 639-1, e.g. "en"); detected when omitted'),
|
|
20854
20888
|
audio_url: httpsUrl("the master audio").optional(),
|
|
@@ -21074,7 +21108,7 @@ var OPERATIONS = [
|
|
|
21074
21108
|
group: "looks",
|
|
21075
21109
|
title: "Upload a background",
|
|
21076
21110
|
summary: "Upload your own photo or video to design a New Look around",
|
|
21077
|
-
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}`,
|
|
21078
21112
|
method: "POST",
|
|
21079
21113
|
path: "/api/v1/backgrounds",
|
|
21080
21114
|
scopes: ["library:write", "videos:write"],
|
|
@@ -21151,7 +21185,7 @@ var OPERATIONS = [
|
|
|
21151
21185
|
group: "videos",
|
|
21152
21186
|
title: "Create a lyric video",
|
|
21153
21187
|
summary: "Make the lyric video a quote priced (spends credits)",
|
|
21154
|
-
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}`,
|
|
21155
21189
|
method: "POST",
|
|
21156
21190
|
path: "/api/v1/videos",
|
|
21157
21191
|
scopes: ["videos:write"],
|
|
@@ -21168,7 +21202,7 @@ var OPERATIONS = [
|
|
|
21168
21202
|
group: "videos",
|
|
21169
21203
|
title: "Create a Canvas",
|
|
21170
21204
|
summary: "Make the Canvas a quote priced (spends credits)",
|
|
21171
|
-
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}`,
|
|
21172
21206
|
method: "POST",
|
|
21173
21207
|
path: "/api/v1/videos",
|
|
21174
21208
|
scopes: ["videos:write"],
|
|
@@ -21340,7 +21374,7 @@ function openApiDocument(input2) {
|
|
|
21340
21374
|
"201": { description: "Created" },
|
|
21341
21375
|
"400": { description: "Invalid request" },
|
|
21342
21376
|
"401": { description: "Missing or invalid credentials" },
|
|
21343
|
-
"402": { description: "Not enough credits" },
|
|
21377
|
+
"402": { description: "Not enough credits, or no active plan (code plan_required)" },
|
|
21344
21378
|
"403": { description: "Missing scope" },
|
|
21345
21379
|
"404": { description: "Not found" },
|
|
21346
21380
|
"409": { description: "Conflict" },
|
|
@@ -24904,7 +24938,7 @@ async function revoke(config2) {
|
|
|
24904
24938
|
// package.json
|
|
24905
24939
|
var package_default = {
|
|
24906
24940
|
name: "@kinetune/cli",
|
|
24907
|
-
version: "0.
|
|
24941
|
+
version: "0.8.0",
|
|
24908
24942
|
description: "Command line for Kinetune: lyric videos and Spotify Canvas loops from your songs, for people and AI agents.",
|
|
24909
24943
|
license: "MIT",
|
|
24910
24944
|
homepage: "https://kinetune.com/developers#cli",
|
|
@@ -24986,7 +25020,7 @@ async function credentials() {
|
|
|
24986
25020
|
if (config2.auth?.type === "api_key") return { token: config2.auth.api_key, config: config2 };
|
|
24987
25021
|
const token = await accessToken(config2);
|
|
24988
25022
|
if (token) return { token, config: config2 };
|
|
24989
|
-
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).");
|
|
24990
25024
|
}
|
|
24991
25025
|
async function call(op, input2, files = []) {
|
|
24992
25026
|
const { token, config: config2 } = await credentials();
|
|
@@ -25163,8 +25197,8 @@ function program2() {
|
|
|
25163
25197
|
return parent;
|
|
25164
25198
|
};
|
|
25165
25199
|
for (const op of OPERATIONS) addOperation(group(op.cli.slice(0, -1)), op);
|
|
25166
|
-
const auth = root.command("auth").description("Sign in with the app (OAuth) or
|
|
25167
|
-
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) => {
|
|
25168
25202
|
const config2 = { ...await loadConfig(), ...options.apiUrl ? { api_url: options.apiUrl } : {}, ...options.appUrl ? { app_url: options.appUrl } : {} };
|
|
25169
25203
|
if (options.apiKey) {
|
|
25170
25204
|
await saveConfig({ ...config2, auth: { type: "api_key", api_key: options.apiKey } });
|
|
@@ -25173,9 +25207,10 @@ function program2() {
|
|
|
25173
25207
|
await login(config2, { log: say, noBrowser: options.browser === false, organization: options.organization });
|
|
25174
25208
|
}
|
|
25175
25209
|
const account = await call(operation("account.get"), {});
|
|
25176
|
-
|
|
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()}`);
|
|
25177
25212
|
});
|
|
25178
|
-
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"), {})));
|
|
25179
25214
|
auth.command("token").description("Print the current bearer token (for curl or other tools)").action(async () => {
|
|
25180
25215
|
process.stdout.write((await credentials()).token + "\n");
|
|
25181
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",
|