@kinetune/cli 0.4.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 +8 -0
- package/dist/kinetune.mjs +43 -6
- 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
|
package/dist/kinetune.mjs
CHANGED
|
@@ -20486,14 +20486,16 @@ var CanvasRequestSchema = external_exports.object({
|
|
|
20486
20486
|
var VideoRequestSchema = external_exports.discriminatedUnion("type", [LyricVideoRequestSchema, CanvasRequestSchema]);
|
|
20487
20487
|
|
|
20488
20488
|
// ../api-spec/src/index.ts
|
|
20489
|
-
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"];
|
|
20490
20490
|
var SCOPE_DESCRIPTIONS = {
|
|
20491
20491
|
"videos:read": "See videos, quotes and your credit balance",
|
|
20492
20492
|
"videos:write": "Quote, create, cancel, retry and delete videos (spends credits)",
|
|
20493
20493
|
"music:read": "See artists, their photos and songs",
|
|
20494
20494
|
"music:write": "Add, rename and archive artists and songs, upload songs and artist photos",
|
|
20495
20495
|
"library:read": "Browse Looks",
|
|
20496
|
-
"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"
|
|
20497
20499
|
};
|
|
20498
20500
|
var id = (what) => external_exports.string().min(1).max(120).describe(`The ${what} id`);
|
|
20499
20501
|
var songId = id("song");
|
|
@@ -20573,6 +20575,39 @@ var OPERATIONS = [
|
|
|
20573
20575
|
cli: ["options"],
|
|
20574
20576
|
mcp: "get_options"
|
|
20575
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
|
+
},
|
|
20576
20611
|
/* Artists */
|
|
20577
20612
|
{
|
|
20578
20613
|
id: "artists.list",
|
|
@@ -24702,7 +24737,9 @@ async function login(config2, input2) {
|
|
|
24702
24737
|
state,
|
|
24703
24738
|
code_challenge: challenge,
|
|
24704
24739
|
code_challenge_method: "S256",
|
|
24705
|
-
resource
|
|
24740
|
+
resource,
|
|
24741
|
+
// The consent screen preselects this organization (one of `kinetune organizations list`).
|
|
24742
|
+
...input2.organization ? { organization_hint: input2.organization } : {}
|
|
24706
24743
|
})) authorize.searchParams.set(k, v);
|
|
24707
24744
|
input2.log(`Opening your browser to sign in. If it doesn't open, visit:
|
|
24708
24745
|
${authorize}`);
|
|
@@ -24759,7 +24796,7 @@ async function revoke(config2) {
|
|
|
24759
24796
|
// package.json
|
|
24760
24797
|
var package_default = {
|
|
24761
24798
|
name: "@kinetune/cli",
|
|
24762
|
-
version: "0.
|
|
24799
|
+
version: "0.5.0",
|
|
24763
24800
|
description: "Command line for Kinetune: lyric videos and Spotify Canvas loops from your songs, for people and AI agents.",
|
|
24764
24801
|
license: "MIT",
|
|
24765
24802
|
homepage: "https://kinetune.com/developers#cli",
|
|
@@ -25012,13 +25049,13 @@ function program2() {
|
|
|
25012
25049
|
};
|
|
25013
25050
|
for (const op of OPERATIONS) addOperation(group(op.cli.slice(0, -1)), op);
|
|
25014
25051
|
const auth = root.command("auth").description("Sign in with the app (OAuth) or an organization API key");
|
|
25015
|
-
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) => {
|
|
25016
25053
|
const config2 = { ...await loadConfig(), ...options.apiUrl ? { api_url: options.apiUrl } : {}, ...options.appUrl ? { app_url: options.appUrl } : {} };
|
|
25017
25054
|
if (options.apiKey) {
|
|
25018
25055
|
await saveConfig({ ...config2, auth: { type: "api_key", api_key: options.apiKey } });
|
|
25019
25056
|
} else {
|
|
25020
25057
|
await saveConfig(config2);
|
|
25021
|
-
await login(config2, { log: say, noBrowser: options.browser === false });
|
|
25058
|
+
await login(config2, { log: say, noBrowser: options.browser === false, organization: options.organization });
|
|
25022
25059
|
}
|
|
25023
25060
|
const account = await call(operation("account.get"), {});
|
|
25024
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",
|