@mrgoonie/multix 1.0.6 → 1.0.7

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/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.7](https://github.com/mrgoonie/multix-cli/compare/v1.0.6...v1.0.7) (2026-10-11)
9
+
10
+
11
+ ### Fixed
12
+
13
+ * **core:** let a later .env file fill a blank value ([#129](https://github.com/mrgoonie/multix-cli/issues/129)) ([bdfb673](https://github.com/mrgoonie/multix-cli/commit/bdfb6739770f0e7bb9d2623606cdb32d454779d4))
14
+
8
15
  ## [1.0.6](https://github.com/mrgoonie/multix-cli/compare/v1.0.5...v1.0.6) (2026-10-11)
9
16
 
10
17
 
package/README.md CHANGED
@@ -115,7 +115,7 @@ Set at least one provider key. Add to `.env` in your project root or `~/.multix/
115
115
 
116
116
  Set extra keys as `GEMINI_API_KEY_2`, `GEMINI_API_KEY_3`, … (any numeric suffix; numbered keys alone are enough). `multix` tries `GEMINI_API_KEY` first, then the numbered keys in ascending order, skipping duplicates. When a key returns HTTP 429 (or 400/403 with `RESOURCE_EXHAUSTED`), it cools down for the server's `Retry-After`/`retryDelay` (default 60s) and the same request is retried with the next ready key; other errors are not rotated. A Files API upload is repeated on the new key if the following generate call is rate-limited. Veo rotates on submit only, so a rate limit while polling or downloading never starts a second billed job. `doc convert` stops its own retries on a rate limit. Cooldowns last for the current process only, and logs name the env var, never the key. `multix check` lists the keys in rotation and pings each one. Quotas are per Google Cloud project: keys from the same project share one quota, so rotation only helps across projects.
117
117
 
118
- Priority: `process.env` > `cwd/.env` > `~/.multix/.env`. Set `MULTIX_LEGACY_CLAUDE_ENV=1` (shell or `~/.multix/.env`) to also read legacy AgentKit files (`.claude/skills/{ai-multimodal,ak-ai-multimodal}/.env`, `.claude/skills/.env`, `.claude/.env`, project first, then home) with the lowest priority (credential names only, never endpoint/proxy settings); `multix check -v` lists the env files that were loaded.
118
+ Priority: `process.env` > `cwd/.env` > `~/.multix/.env`. A blank or whitespace-only value in a `.env` file does not count as set, so a project `.env` copied from `.env.example` does not hide `~/.multix/.env`; a shell variable wins even when blank. Set `MULTIX_LEGACY_CLAUDE_ENV=1` (shell or `~/.multix/.env`) to also read legacy AgentKit files (`.claude/skills/{ai-multimodal,ak-ai-multimodal}/.env`, `.claude/skills/.env`, `.claude/.env`, project first, then home) with the lowest priority (credential names only, never endpoint/proxy settings); `multix check -v` lists the env files that were loaded.
119
119
 
120
120
  A project `.env` may only set variables `multix` reads: provider keys, the provider settings in `.env.example` (`*_BASE_URL`, model overrides, Cloudflare IDs), the documented `MULTIX_*` settings (`MULTIX_OUTPUT_DIR`, so a project can choose where outputs go, `MULTIX_IMAGE_FORMAT`, `MULTIX_MAX_DOWNLOAD_MB`, `MULTIX_UPLOAD_MIN_KBPS`) and `NO_COLOR`. The opt-ins `MULTIX_ALLOW_PROJECT_BASE_URL` and `MULTIX_LEGACY_CLAUDE_ENV` are refused there; set them in the shell or `~/.multix/.env`. Other names, such as `NODE_OPTIONS`, `npm_config_registry`, `LD_PRELOAD` or `HTTPS_PROXY`, are not loaded, so they never reach `multix` or the tools it starts (`npm` in `multix update`, ffmpeg, ImageMagick, cwebp); one warning on stderr lists the ignored names, never their values. The shell and `~/.multix/.env` are not filtered.
121
121
 
package/dist/cli.js CHANGED
@@ -402,6 +402,12 @@ function parseFile(file) {
402
402
  return void 0;
403
403
  }
404
404
  }
405
+ function fileMaySet(name, value) {
406
+ const current = process.env[name];
407
+ if (current === void 0) return true;
408
+ if (current.trim() !== "" || value.trim() === "") return false;
409
+ return fileOrigins.get(envNameKey(name))?.value === current;
410
+ }
405
411
  function loadFile(file, source, accept = () => true, onRefused) {
406
412
  const parsed = parseFile(file);
407
413
  if (!parsed) return void 0;
@@ -410,7 +416,7 @@ function loadFile(file, source, accept = () => true, onRefused) {
410
416
  onRefused?.(name);
411
417
  continue;
412
418
  }
413
- if (process.env[name] !== void 0) continue;
419
+ if (!fileMaySet(name, value)) continue;
414
420
  process.env[name] = value;
415
421
  fileOrigins.set(envNameKey(name), { source, file, value });
416
422
  }
@@ -495,10 +501,8 @@ function inspectTrustedSetting(name, credentials, harmless) {
495
501
  if (origin?.source !== "project") {
496
502
  return value ? { status: "used", value, source: origin?.source ?? "shell" } : { status: "unset" };
497
503
  }
504
+ if (value === void 0) return { status: "unset" };
498
505
  const userValue = userFileValues[envNameKey(name)]?.trim() || void 0;
499
- if (value === void 0) {
500
- return userValue ? { status: "fallback", value: userValue, file: origin.file, reason: "it is empty" } : { status: "unset" };
501
- }
502
506
  const project = (basis) => ({
503
507
  status: "used",
504
508
  value,
@@ -518,10 +522,9 @@ function applyTrustedSetting(name, state) {
518
522
  if (state.status === "unset") return void 0;
519
523
  if (state.status === "used") return state.value;
520
524
  if (state.status === "refused") throw new ConfigError(trustedSettingRefusal(name, state));
521
- const hint = state.reason === "it is empty" ? "" : ` ${OPT_IN_HINT}`;
522
525
  warnOnce(
523
526
  `ignored:${name}`,
524
- `Ignoring ${name} from project env file ${state.file} (${state.reason}); using the value from ~/.multix/.env.${hint}`
527
+ `Ignoring ${name} from project env file ${state.file} (${state.reason}); using the value from ~/.multix/.env. ${OPT_IN_HINT}`
525
528
  );
526
529
  return state.value;
527
530
  }
@@ -3849,7 +3852,7 @@ var CLOUDFLARE_VIDEO_CREDENTIALS = [
3849
3852
  function getCloudflareModel(kind, requested) {
3850
3853
  const expected = kind === "image" ? CLOUDFLARE_IMAGE_MODEL : CLOUDFLARE_TTS_MODEL;
3851
3854
  const overrideName = kind === "image" ? "CLOUDFLARE_AI_IMAGE_MODEL" : "CLOUDFLARE_AI_TTS_MODEL";
3852
- const model = requested ?? resolveKey(overrideName) ?? expected;
3855
+ const model = requested ?? envDefault(overrideName, expected);
3853
3856
  if (model !== expected) {
3854
3857
  throw new ValidationError(`Unsupported Cloudflare ${kind} model: ${model}`);
3855
3858
  }
@@ -10806,7 +10809,7 @@ function registerOpenAIGenerateCommand(parent) {
10806
10809
  parent.command("generate").description("Generate images with OpenAI Image API or experimental Codex driver").requiredOption("--prompt <text>", "Text prompt").option("--driver <driver>", "api|codex|auto", "auto").option(
10807
10810
  "-m, --model <id>",
10808
10811
  "Image model",
10809
- resolveKey("OPENAI_IMAGE_MODEL") ?? DEFAULT_OPENAI_IMAGE_MODEL
10812
+ envDefault("OPENAI_IMAGE_MODEL", DEFAULT_OPENAI_IMAGE_MODEL)
10810
10813
  ).option("--size <size>", "1024x1024|1024x1536|1536x1024|auto", "1024x1024").option("--quality <q>", "low|medium|high", "medium").option(
10811
10814
  "--format <fmt>",
10812
10815
  "Provider output format png|jpeg|webp (explicit value keeps it; default png then WebP)"
@@ -10852,7 +10855,7 @@ function registerOpenAIImageToImageCommand(parent) {
10852
10855
  ).option("--driver <driver>", "api|codex|auto", "auto").option(
10853
10856
  "-m, --model <id>",
10854
10857
  "Image model",
10855
- resolveKey("OPENAI_IMAGE_MODEL") ?? DEFAULT_OPENAI_IMAGE_MODEL
10858
+ envDefault("OPENAI_IMAGE_MODEL", DEFAULT_OPENAI_IMAGE_MODEL)
10856
10859
  ).option("--size <size>", "1024x1024|1024x1536|1536x1024|auto", "1024x1024").option("--quality <q>", "low|medium|high", "medium").option(
10857
10860
  "--format <fmt>",
10858
10861
  "Provider output format png|jpeg|webp (explicit value keeps it; default png then WebP)"
@@ -11129,7 +11132,7 @@ function registerOpenRouterGenerateCommand(parent) {
11129
11132
  ).requiredOption("--prompt <text>", "Image generation prompt").option("--model <id>", "OpenRouter model id (e.g. google/gemini-3.1-flash-image-preview)").option("--aspect-ratio <ratio>", "Aspect ratio (e.g. 1:1, 16:9)", "1:1").option("--image-size <size>", "Image size hint (e.g. 1K, 2K)").option("--num-images <n>", "Number of images to generate", "1").option("--output <path>", "Copy first image to this path").addOption(imageFormatOption()).addOption(noWebpOption()).option("-v, --verbose", "Verbose logging").action(
11130
11133
  async (opts) => {
11131
11134
  const logger = createLogger({ verbose: opts.verbose ?? false });
11132
- const model = opts.model ?? resolveKey("OPENROUTER_IMAGE_MODEL") ?? DEFAULT_OPENROUTER_MODEL;
11135
+ const model = opts.model ?? envDefault("OPENROUTER_IMAGE_MODEL", DEFAULT_OPENROUTER_MODEL);
11133
11136
  const numImages = Math.max(1, Number.parseInt(opts.numImages, 10) || 1);
11134
11137
  logger.debug(`Generating ${numImages} image(s) via OpenRouter: ${model}`);
11135
11138
  const result = await generateOpenRouterImage({
@@ -11178,7 +11181,7 @@ function registerOpenRouterImageToImageCommand(parent) {
11178
11181
  throw new ValidationError("At least one --ref is required for image-to-image.");
11179
11182
  }
11180
11183
  const logger = createLogger({ verbose: opts.verbose ?? false });
11181
- const model = opts.model ?? resolveKey("OPENROUTER_IMAGE_MODEL") ?? DEFAULT_MODEL;
11184
+ const model = opts.model ?? envDefault("OPENROUTER_IMAGE_MODEL", DEFAULT_MODEL);
11182
11185
  const strength = parseStrength(opts.strength);
11183
11186
  const fallbackModels = (resolveKey("OPENROUTER_FALLBACK_MODELS") ?? "").split(",").map((m) => m.trim()).filter(Boolean);
11184
11187
  const resolvedRefs = [];
@@ -11394,7 +11397,7 @@ function registerOpenRouterImageToVideoCommand(parent) {
11394
11397
  ).requiredOption("--prompt <text>", "Motion/scene prompt").requiredOption("--image-url <url>", "First-frame image URL (https)").option("--last-frame-url <url>", "Optional last-frame image URL").option("--model <id>", "OpenRouter video model id (e.g. google/veo-3.1)").option("--resolution <r>", "Resolution hint (e.g. 720p, 1080p)").option("--aspect-ratio <r>", "Aspect ratio hint (e.g. 16:9, 9:16)").option("--duration <n>", "Duration seconds").option("--seed <n>", "Fixed seed").option("--wait", "Poll until status is 'completed' or 'failed'").option("--wait-timeout <ms>", "Poll timeout in ms (with --wait)", "600000").option("--download", "Download the generated video on success (implies --wait)").option("--output <path>", "Copy downloaded video to this path").option("--no-thumb", "Skip downloading the thumbnail if the API returns one").option("-v, --verbose", "Verbose logging").action(
11395
11398
  async (opts) => {
11396
11399
  const logger = createLogger({ verbose: opts.verbose ?? false });
11397
- const model = opts.model ?? resolveKey("OPENROUTER_VIDEO_MODEL") ?? "google/veo-3.1";
11400
+ const model = opts.model ?? envDefault("OPENROUTER_VIDEO_MODEL", "google/veo-3.1");
11398
11401
  const frame_images = [
11399
11402
  {
11400
11403
  type: "image_url",
@@ -12631,8 +12634,10 @@ function settingLine(label, state, commands = "commands that use it") {
12631
12634
  if (state.status === "used") {
12632
12635
  return { level: "info", message: `${label} in effect (from ${usedFrom(state)})` };
12633
12636
  }
12634
- const why = state.reason === "it is empty" ? "set empty in project .env" : `set in project .env while ${state.reason}`;
12635
- return { level: "warn", message: `${label} ignored: ${why}; using ~/.multix/.env` };
12637
+ return {
12638
+ level: "warn",
12639
+ message: `${label} ignored: set in project .env while ${state.reason}; using ~/.multix/.env`
12640
+ };
12636
12641
  }
12637
12642
  var sameState = (a, b) => JSON.stringify(a) === JSON.stringify(b);
12638
12643
  function routingSettingReport() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrgoonie/multix",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "AI multimodal CLI — OpenAI, Gemini, MiniMax, OpenRouter, Leonardo, BytePlus, ElevenLabs, fal.ai, Atlas Cloud, Replicate, HeyGen, ffmpeg, ImageMagick, doc-to-md",
5
5
  "type": "module",
6
6
  "bin": {
@@ -81,7 +81,6 @@
81
81
  "commander": "^12.1.0",
82
82
  "dotenv": "^16.4.5",
83
83
  "execa": "^9.4.0",
84
- "undici": "^7.2.0",
85
84
  "zod": "^3.23.8"
86
85
  },
87
86
  "devDependencies": {
package/skill/SKILL.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: multix
3
3
  description: AI multimodal CLI — generate and edit images (OpenAI, Codex driver, Gemini Nano Banana, Imagen, MiniMax, OpenRouter, Leonardo, BytePlus Seedream, Cloudflare Workers AI FLUX.1 Schnell, fal.ai FLUX, Replicate FLUX), generate video (Gemini Veo, MiniMax Hailuo, OpenRouter via Veo/Seedance/Kling, Leonardo via Motion/Veo/Kling/Hailuo/Seedance/LTX, BytePlus Seedance, Cloudflare AI Gateway via Replicate, fal.ai queue models, Replicate direct API models incl. P-Video, HeyGen Video Agent and scripted avatar videos), video translation and lipsync (HeyGen), TTS/STT/music (OpenAI, Gemini Flash TTS incl. Gemini 3.8 with delivery-style control, MiniMax, Cloudflare Workers AI MeloTTS, ElevenLabs), 3D models (BytePlus Hyper3D/Hitem3d), analyze/transcribe media, convert documents to Markdown, optimize media via ffmpeg/ImageMagick, and self-update the CLI. Use whenever the user wants to create, edit, or transform images/video/audio/3D/documents from a CLI, mentions any of: OpenAI, Codex image driver, image-to-image, i2i, image edit, watercolor/cyberpunk style transfer, reference image, OpenRouter, Nano Banana, Flux, Seedream, Veo, Hailuo, Seedance, Kling, Cloudflare Workers AI, AI Gateway, fal.ai, Atlas Cloud, Replicate, replicate.com models, Replicate predictions, HeyGen, avatar video, talking head, Video Agent, video translation, dubbing, lipsync, video generation, text-to-video, image-to-video, i2v, ElevenLabs voice cloning, updating/upgrading multix, or asks for batch media optimization.
4
- version: 1.0.6 # x-release-please-version
4
+ version: 1.0.7 # x-release-please-version
5
5
  ---
6
6
 
7
7
  # multix — AI Multimodal CLI
@@ -54,7 +54,7 @@ CLOUDFLARE_API_TOKEN # Cloudflare Workers AI / AI Gateway token
54
54
  # Video additionally requires CLOUDFLARE_AI_GATEWAY_ID and REPLICATE_API_TOKEN.
55
55
  ```
56
56
 
57
- Priority: `process.env` > `cwd/.env` > `~/.multix/.env`. Set `MULTIX_LEGACY_CLAUDE_ENV=1` to also read legacy AgentKit `.claude` env files (credential names only, lowest priority); `multix check -v` lists loaded env files. A project `.env` may only set names multix reads (provider keys and settings from `.env.example`, the documented `MULTIX_*` settings such as `MULTIX_OUTPUT_DIR`, `NO_COLOR`; never `MULTIX_ALLOW_PROJECT_BASE_URL` or `MULTIX_LEGACY_CLAUDE_ENV`); anything else there (`NODE_OPTIONS`, `npm_config_*`, `LD_PRELOAD`, proxy/TLS variables) is not loaded, with one stderr warning naming the ignored variables. Put such variables in the shell.
57
+ Priority: `process.env` > `cwd/.env` > `~/.multix/.env`; a blank value in a `.env` file does not count as set, so a later file can fill it (a shell value wins even when blank). Set `MULTIX_LEGACY_CLAUDE_ENV=1` to also read legacy AgentKit `.claude` env files (credential names only, lowest priority); `multix check -v` lists loaded env files. A project `.env` may only set names multix reads (provider keys and settings from `.env.example`, the documented `MULTIX_*` settings such as `MULTIX_OUTPUT_DIR`, `NO_COLOR`; never `MULTIX_ALLOW_PROJECT_BASE_URL` or `MULTIX_LEGACY_CLAUDE_ENV`); anything else there (`NODE_OPTIONS`, `npm_config_*`, `LD_PRELOAD`, proxy/TLS variables) is not loaded, with one stderr warning naming the ignored variables. Put such variables in the shell.
58
58
 
59
59
  ## Gemini text-output tasks
60
60