pixelmuse 0.3.0 → 0.4.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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  PATHS
4
- } from "./chunk-7ARYEFAH.js";
4
+ } from "./chunk-PSHBBAJV.js";
5
5
 
6
6
  // src/core/image.ts
7
7
  import { execSync } from "child_process";
@@ -18,6 +18,7 @@ var DEFAULT_SETTINGS = {
18
18
  defaultModel: "nano-banana-2",
19
19
  defaultAspectRatio: "1:1",
20
20
  defaultStyle: "none",
21
+ defaultVisibility: "private",
21
22
  autoPreview: true,
22
23
  autoSave: true
23
24
  };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  PATHS,
4
4
  ensureDirs
5
- } from "./chunk-7ARYEFAH.js";
5
+ } from "./chunk-PSHBBAJV.js";
6
6
 
7
7
  // src/core/types.ts
8
8
  var ApiError = class extends Error {
@@ -17,7 +17,7 @@ var ApiError = class extends Error {
17
17
  };
18
18
 
19
19
  // src/core/client.ts
20
- var CLI_VERSION = "0.3.0";
20
+ var CLI_VERSION = "0.4.0";
21
21
  var BASE_URL = "https://www.pixelmuse.studio/api/v1";
22
22
  var CLIENT_HEADERS = {
23
23
  "User-Agent": `pixelmuse-cli/${CLI_VERSION}`,
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  pollGeneration,
4
4
  slugify
5
- } from "./chunk-H6VI5DLX.js";
5
+ } from "./chunk-Q5SB7WKR.js";
6
6
  import {
7
7
  autoSave,
8
8
  imageToBuffer,
9
9
  saveImage
10
- } from "./chunk-MZZY4JXW.js";
10
+ } from "./chunk-M4N6UFDD.js";
11
11
 
12
12
  // src/core/generate.ts
13
13
  import { existsSync } from "fs";
@@ -29,6 +29,7 @@ async function generateImage(client, options) {
29
29
  model = "nano-banana-2",
30
30
  aspectRatio = "1:1",
31
31
  style,
32
+ visibility,
32
33
  output,
33
34
  noSave = false,
34
35
  onProgress
@@ -38,7 +39,8 @@ async function generateImage(client, options) {
38
39
  prompt,
39
40
  model,
40
41
  aspect_ratio: aspectRatio,
41
- style: style === "none" ? void 0 : style
42
+ style: style === "none" ? void 0 : style,
43
+ visibility
42
44
  });
43
45
  if (gen.status === "processing" || gen.status === "pending") {
44
46
  gen = await pollGeneration(client, gen.id, { onProgress });
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  generateImage
4
- } from "./chunk-4DZUZTTL.js";
4
+ } from "./chunk-STJDWR4Q.js";
5
5
  import {
6
6
  CLI_VERSION,
7
7
  PixelmuseClient,
@@ -15,14 +15,14 @@ import {
15
15
  saveApiKey,
16
16
  saveTemplate,
17
17
  slugify
18
- } from "./chunk-H6VI5DLX.js";
18
+ } from "./chunk-Q5SB7WKR.js";
19
19
  import {
20
20
  renderImageDirect
21
- } from "./chunk-MZZY4JXW.js";
21
+ } from "./chunk-M4N6UFDD.js";
22
22
  import {
23
23
  readSettings,
24
24
  writeSettings
25
- } from "./chunk-7ARYEFAH.js";
25
+ } from "./chunk-PSHBBAJV.js";
26
26
 
27
27
  // src/cli.ts
28
28
  import meow from "meow";
@@ -193,6 +193,7 @@ var cli = meow(
193
193
  --no-preview Skip image preview
194
194
  --open Open result in system viewer
195
195
  --watch <file> Watch a prompt file and regenerate on save
196
+ --public Make image public (default: private)
196
197
  --no-save Don't save image to disk
197
198
  --clipboard Copy image to clipboard
198
199
  -h, --help Show this help
@@ -215,6 +216,7 @@ var cli = meow(
215
216
  preview: { type: "boolean", default: true },
216
217
  open: { type: "boolean", default: false },
217
218
  watch: { type: "string" },
219
+ public: { type: "boolean", default: false },
218
220
  save: { type: "boolean", default: true },
219
221
  clipboard: { type: "boolean", default: false },
220
222
  var: { type: "string", isMultiple: true }
@@ -257,6 +259,7 @@ async function handleGenerate(prompt) {
257
259
  const model = cli.flags.model ?? settings.defaultModel;
258
260
  const aspectRatio = cli.flags.aspectRatio ?? settings.defaultAspectRatio;
259
261
  const style = cli.flags.style ?? settings.defaultStyle;
262
+ const visibility = cli.flags.public ? "public" : settings.defaultVisibility;
260
263
  let balance = null;
261
264
  let creditCost = null;
262
265
  try {
@@ -275,6 +278,7 @@ async function handleGenerate(prompt) {
275
278
  model,
276
279
  aspectRatio,
277
280
  style,
281
+ visibility,
278
282
  output: cli.flags.output,
279
283
  noSave: !cli.flags.save
280
284
  });
@@ -285,6 +289,7 @@ async function handleGenerate(prompt) {
285
289
  model: result.generation.model,
286
290
  prompt: result.generation.prompt,
287
291
  credits_charged: result.generation.credits_charged,
292
+ visibility: result.generation.visibility,
288
293
  elapsed_seconds: Math.round(result.elapsed * 10) / 10,
289
294
  output_path: result.imagePath
290
295
  })
@@ -304,6 +309,7 @@ async function handleGenerate(prompt) {
304
309
  model,
305
310
  aspectRatio,
306
311
  style,
312
+ visibility,
307
313
  output: cli.flags.output,
308
314
  noSave: !cli.flags.save,
309
315
  onProgress: (elapsed) => {
@@ -313,8 +319,9 @@ async function handleGenerate(prompt) {
313
319
  const charged = result.generation.credits_charged;
314
320
  const remaining = balance !== null ? balance - charged : null;
315
321
  const remainStr = remaining !== null ? ` (remaining: ${remaining})` : "";
322
+ const visLabel = result.generation.visibility === "public" ? chalk.green("public") : chalk.gray("private");
316
323
  spinner.succeed(
317
- `Generated in ${result.elapsed.toFixed(1)}s \xB7 ${charged} credit${charged > 1 ? "s" : ""} charged${remainStr}`
324
+ `Generated in ${result.elapsed.toFixed(1)}s \xB7 ${charged} credit${charged > 1 ? "s" : ""} charged${remainStr} \xB7 ${visLabel}`
318
325
  );
319
326
  if (result.imagePath) {
320
327
  console.log(chalk.gray(` Saved to ${result.imagePath}`));
@@ -353,6 +360,7 @@ async function handleWatch(filePath) {
353
360
  const model = cli.flags.model ?? settings.defaultModel;
354
361
  const aspectRatio = cli.flags.aspectRatio ?? settings.defaultAspectRatio;
355
362
  const style = cli.flags.style ?? settings.defaultStyle;
363
+ const watchVisibility = cli.flags.public ? "public" : settings.defaultVisibility;
356
364
  const time = (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", { hour12: false });
357
365
  const spinner = ora(`[${time}] Generating... (${model})`).start();
358
366
  try {
@@ -361,6 +369,7 @@ async function handleWatch(filePath) {
361
369
  model,
362
370
  aspectRatio,
363
371
  style,
372
+ visibility: watchVisibility,
364
373
  output: cli.flags.output
365
374
  });
366
375
  spinner.succeed(`[${time}] Saved to ${result.imagePath} (${result.elapsed.toFixed(1)}s)`);
@@ -440,8 +449,9 @@ async function handleHistory() {
440
449
  const prompt = gen.prompt.length > 30 ? gen.prompt.slice(0, 30) + "..." : gen.prompt;
441
450
  const date = timeAgo(new Date(gen.created_at));
442
451
  const status = gen.status === "succeeded" ? chalk.green("\u25CF") : gen.status === "failed" ? chalk.red("\u2717") : chalk.yellow("\u25CC");
452
+ const vis = gen.visibility === "private" ? chalk.gray(" \u{1F512}") : "";
443
453
  console.log(
444
- chalk.gray(id.padEnd(idW)) + `${status} ${gen.model}`.padEnd(modelW + status.length - 1) + prompt.padEnd(promptW) + chalk.gray(date)
454
+ chalk.gray(id.padEnd(idW)) + `${status} ${gen.model}${vis}`.padEnd(modelW + status.length - 1 + vis.length) + prompt.padEnd(promptW) + chalk.gray(date)
445
455
  );
446
456
  }
447
457
  } catch (err) {
@@ -456,8 +466,8 @@ async function handleOpen(id) {
456
466
  const gen = await client.getGeneration(id);
457
467
  spinner.stop();
458
468
  if (gen.output?.[0]) {
459
- const { imageToBuffer: imageToBuffer2, saveImage: saveImage2 } = await import("./image-2H3GUQI6.js");
460
- const { PATHS: PATHS2 } = await import("./config-RMVFR3GN.js");
469
+ const { imageToBuffer: imageToBuffer2, saveImage: saveImage2 } = await import("./image-GQSNVWNN.js");
470
+ const { PATHS: PATHS2 } = await import("./config-Z76UJLDX.js");
461
471
  const { join: join2 } = await import("path");
462
472
  const buf = await imageToBuffer2(gen.output[0]);
463
473
  const path = join2(PATHS2.generations, `${gen.id}.png`);
@@ -693,7 +703,7 @@ ${chalk.bold("Prompt:")} ${template.prompt}`);
693
703
  tags: []
694
704
  };
695
705
  saveTemplate(template);
696
- const { PATHS: PATHS2 } = await import("./config-RMVFR3GN.js");
706
+ const { PATHS: PATHS2 } = await import("./config-Z76UJLDX.js");
697
707
  const path = `${PATHS2.prompts}/${slugify(name)}.yaml`;
698
708
  console.log(`Created template: ${chalk.bold(path)}`);
699
709
  console.log(chalk.gray("Edit the YAML file to customize your template."));
@@ -4,7 +4,7 @@ import {
4
4
  ensureDirs,
5
5
  readSettings,
6
6
  writeSettings
7
- } from "./chunk-7ARYEFAH.js";
7
+ } from "./chunk-PSHBBAJV.js";
8
8
  export {
9
9
  PATHS,
10
10
  ensureDirs,
@@ -5,8 +5,8 @@ import {
5
5
  imageToBuffer,
6
6
  renderImageDirect,
7
7
  saveImage
8
- } from "./chunk-MZZY4JXW.js";
9
- import "./chunk-7ARYEFAH.js";
8
+ } from "./chunk-M4N6UFDD.js";
9
+ import "./chunk-PSHBBAJV.js";
10
10
  export {
11
11
  autoSave,
12
12
  hasChafa,
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  generateImage
4
- } from "../chunk-4DZUZTTL.js";
4
+ } from "../chunk-STJDWR4Q.js";
5
5
  import {
6
6
  CLI_VERSION,
7
7
  PixelmuseClient,
8
8
  getApiKey
9
- } from "../chunk-H6VI5DLX.js";
10
- import "../chunk-MZZY4JXW.js";
9
+ } from "../chunk-Q5SB7WKR.js";
10
+ import "../chunk-M4N6UFDD.js";
11
11
  import {
12
12
  readSettings
13
- } from "../chunk-7ARYEFAH.js";
13
+ } from "../chunk-PSHBBAJV.js";
14
14
 
15
15
  // src/mcp/server.ts
16
16
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -43,7 +43,8 @@ server.tool(
43
43
  model: z.enum(MODELS).optional().default("nano-banana-2").describe("Model to use"),
44
44
  aspect_ratio: z.enum(ASPECT_RATIOS).optional().default("1:1").describe("Image aspect ratio"),
45
45
  style: z.enum(STYLES).optional().default("none").describe("Visual style"),
46
- output_path: z.string().optional().describe("Where to save the image (default: current directory)")
46
+ output_path: z.string().optional().describe("Where to save the image (default: current directory)"),
47
+ visibility: z.enum(["public", "private"]).optional().describe("Image visibility (default: private)")
47
48
  },
48
49
  async (args) => {
49
50
  const client = await getClient();
@@ -53,6 +54,7 @@ server.tool(
53
54
  model: args.model ?? settings.defaultModel,
54
55
  aspectRatio: args.aspect_ratio ?? settings.defaultAspectRatio,
55
56
  style: args.style ?? settings.defaultStyle,
57
+ visibility: args.visibility ?? settings.defaultVisibility,
56
58
  output: args.output_path
57
59
  });
58
60
  return {
@@ -65,6 +67,7 @@ server.tool(
65
67
  model: result.generation.model,
66
68
  prompt: result.generation.prompt,
67
69
  credits_charged: result.generation.credits_charged,
70
+ visibility: result.generation.visibility,
68
71
  elapsed_seconds: Math.round(result.elapsed * 10) / 10,
69
72
  output_path: result.imagePath
70
73
  }, null, 2)
package/dist/tui.js CHANGED
@@ -11,17 +11,17 @@ import {
11
11
  pollGeneration,
12
12
  saveApiKey,
13
13
  saveTemplate
14
- } from "./chunk-H6VI5DLX.js";
14
+ } from "./chunk-Q5SB7WKR.js";
15
15
  import {
16
16
  autoSave,
17
17
  hasChafa,
18
18
  imageToBuffer,
19
19
  renderImageDirect
20
- } from "./chunk-MZZY4JXW.js";
20
+ } from "./chunk-M4N6UFDD.js";
21
21
  import {
22
22
  readSettings,
23
23
  writeSettings
24
- } from "./chunk-7ARYEFAH.js";
24
+ } from "./chunk-PSHBBAJV.js";
25
25
 
26
26
  // src/tui.tsx
27
27
  import { render } from "ink";
@@ -330,7 +330,8 @@ function Generate({
330
330
  initialStyle,
331
331
  defaultModel = "nano-banana-2",
332
332
  defaultAspectRatio = "1:1",
333
- defaultStyle = "none"
333
+ defaultStyle = "none",
334
+ defaultVisibility = "private"
334
335
  }) {
335
336
  const { exit } = useApp();
336
337
  const [step, setStep] = useState4(initialPrompt ? "model" : "prompt");
@@ -367,7 +368,8 @@ function Generate({
367
368
  prompt,
368
369
  model,
369
370
  aspect_ratio: aspectRatio,
370
- style: style === "none" ? void 0 : style
371
+ style: style === "none" ? void 0 : style,
372
+ visibility: defaultVisibility
371
373
  });
372
374
  if (gen.status === "processing" || gen.status === "pending") {
373
375
  gen = await pollGeneration(client, gen.id, {
@@ -523,7 +525,8 @@ function ImageGrid({ generations, columns = 3, onSelect }) {
523
525
  /* @__PURE__ */ jsxs7(Text7, { color: gen.status === "succeeded" ? "green" : gen.status === "failed" ? "red" : "yellow", children: [
524
526
  gen.status === "succeeded" ? "\u25CF" : gen.status === "failed" ? "\u2717" : "\u25CC",
525
527
  " ",
526
- gen.model
528
+ gen.model,
529
+ gen.visibility === "private" ? " \u{1F512}" : ""
527
530
  ] }),
528
531
  /* @__PURE__ */ jsx7(Text7, { color: "gray", wrap: "truncate", children: gen.prompt.slice(0, cellWidth - 4) }),
529
532
  /* @__PURE__ */ jsx7(Text7, { color: "gray", dimColor: true, children: new Date(gen.created_at).toLocaleDateString() })
@@ -1154,7 +1157,8 @@ function App({ initialRoute }) {
1154
1157
  initialStyle: route.style,
1155
1158
  defaultModel: settings.defaultModel,
1156
1159
  defaultAspectRatio: settings.defaultAspectRatio,
1157
- defaultStyle: settings.defaultStyle
1160
+ defaultStyle: settings.defaultStyle,
1161
+ defaultVisibility: settings.defaultVisibility
1158
1162
  }
1159
1163
  );
1160
1164
  case "gallery":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelmuse",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "AI image generation from the terminal — CLI, TUI, and MCP server for text-to-image with Flux, Imagen, Recraft, and more",
5
5
  "homepage": "https://pixelmuse.studio",
6
6
  "repository": {
@@ -19,17 +19,6 @@
19
19
  "files": [
20
20
  "dist"
21
21
  ],
22
- "scripts": {
23
- "build": "tsup",
24
- "dev": "tsup --watch",
25
- "start": "node dist/cli.js",
26
- "typecheck": "tsc --noEmit",
27
- "lint": "eslint src/",
28
- "lint:fix": "eslint src/ --fix",
29
- "test": "vitest run",
30
- "test:watch": "vitest",
31
- "ci": "pnpm lint && pnpm typecheck && pnpm build && pnpm test"
32
- },
33
22
  "keywords": [
34
23
  "cli",
35
24
  "image-generation",
@@ -83,12 +72,15 @@
83
72
  "engines": {
84
73
  "node": ">=20"
85
74
  },
86
- "pnpm": {
87
- "onlyBuiltDependencies": [
88
- "esbuild"
89
- ],
90
- "overrides": {
91
- "phin@<3.7.1": ">=3.7.1"
92
- }
75
+ "scripts": {
76
+ "build": "tsup",
77
+ "dev": "tsup --watch",
78
+ "start": "node dist/cli.js",
79
+ "typecheck": "tsc --noEmit",
80
+ "lint": "eslint src/",
81
+ "lint:fix": "eslint src/ --fix",
82
+ "test": "vitest run",
83
+ "test:watch": "vitest",
84
+ "ci": "pnpm lint && pnpm typecheck && pnpm build && pnpm test"
93
85
  }
94
- }
86
+ }