@flatkey-ai/cli 0.1.10 → 0.1.11

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.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +11 -16
  3. package/src/models.js +0 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatkey-ai/cli",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Flatkey media generation CLI for image, video, audio, credits, status, and models.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -533,23 +533,18 @@ async function handleUtility(command, deps) {
533
533
  async function handleModels(command, deps) {
534
534
  const { resolveApiKey } = await import("./config.js");
535
535
  const { getModels } = await import("./api.js");
536
- const { getBundledModels, normalizeModels } = await import("./models.js");
536
+ const { normalizeModels } = await import("./models.js");
537
537
 
538
- try {
539
- const apiKey = await resolveApiKey({
540
- apiKey: command.options.api_key,
541
- env: deps.env ?? process.env,
542
- });
543
- const response = await getModels({
544
- apiKey,
545
- baseUrl: firstNonEmpty(command.options.base_url, (deps.env ?? process.env).CONSOLE_ORIGIN),
546
- fetch: deps.fetch,
547
- });
548
- const models = normalizeModels(response, command.options.type);
549
- return { models: models.length ? models : getBundledModels(command.options.type) };
550
- } catch {
551
- return { models: getBundledModels(command.options.type) };
552
- }
538
+ const apiKey = await resolveApiKey({
539
+ apiKey: command.options.api_key,
540
+ env: deps.env ?? process.env,
541
+ });
542
+ const response = await getModels({
543
+ apiKey,
544
+ baseUrl: firstNonEmpty(command.options.base_url, (deps.env ?? process.env).CONSOLE_ORIGIN),
545
+ fetch: deps.fetch,
546
+ });
547
+ return { models: normalizeModels(response, command.options.type) };
553
548
  }
554
549
 
555
550
  function formatHuman(result) {
package/src/models.js CHANGED
@@ -1,24 +1,3 @@
1
- const BUNDLED_MODELS = [
2
- { id: "nano-banana-pro-preview", type: "image" },
3
- { id: "nano-banana-flash", type: "image" },
4
- { id: "gpt-image-2", type: "image" },
5
- { id: "veo-3", type: "video" },
6
- { id: "veo-3-fast", type: "video" },
7
- { id: "seedance2", type: "video" },
8
- { id: "gpt-5.5", type: "text" },
9
- { id: "eleven_multilingual_v2", type: "audio" },
10
- { id: "eleven_turbo_v2_5", type: "audio" },
11
- { id: "eleven_flash_v2_5", type: "audio" },
12
- { id: "sound-generation", type: "audio" },
13
- { id: "music", type: "audio" },
14
- ];
15
-
16
- export function getBundledModels(type) {
17
- return BUNDLED_MODELS
18
- .filter((model) => !type || model.type === type)
19
- .map((model) => ({ ...model, source: "bundled" }));
20
- }
21
-
22
1
  export function normalizeModels(response, type) {
23
2
  const rawModels = Array.isArray(response?.data)
24
3
  ? response.data