can1357/oh-my-pi · error · CliUsageError

--canary and --stable are mutually exclusive

Error message

--canary and --stable are mutually exclusive

What it means

omp update can install either the canary (pre-release) or the stable channel, but not both. Passing --canary and --stable together is ambiguous, so the command throws a CliUsageError before any update logic runs.

Source

Thrown at packages/coding-agent/src/commands/update.ts:32

	static flags = {
		force: Flags.boolean({ char: "f", description: "Force update", default: false }),
		check: Flags.boolean({ char: "c", description: "Check for updates without installing", default: false }),
		plugins: Flags.boolean({ char: "l", description: "Update installed plugins", default: false }),
		canary: Flags.boolean({ description: "Switch to the canary channel and update", default: false }),
		stable: Flags.boolean({ description: "Switch back to the stable channel", default: false }),
	};

	static examples = [
		"omp update",
		"omp update --check",
		"omp update --canary",
		"# If GitHub rate-limits release metadata, set GITHUB_TOKEN or GH_TOKEN\n  GITHUB_TOKEN=... omp update",
	];

	async run(): Promise<void> {
		const { flags } = await this.parse(Update);
		await initTheme();
		if (flags.canary && flags.stable) throw new CliUsageError("--canary and --stable are mutually exclusive");
		if (flags.plugins) {
			await pluginCli.runPluginCommand({ action: "upgrade", args: [], flags: {} });
		} else {
			await updateCli.runUpdateCommand({
				force: flags.force,
				check: flags.check,
				channel: flags.canary ? "canary" : flags.stable ? "stable" : undefined,
			});
		}
	}
}

View on GitHub (pinned to 9690622007)

Solutions

  1. Pass only one channel flag: --canary OR --stable
  2. If neither is passed, the command uses its default channel
  3. Fix wrapper scripts/aliases so they do not hardcode a conflicting channel flag

Example fix

// before
omp update --canary --stable
// after
omp update --canary
Defensive patterns

Strategy: validation

Validate before calling

if (flags.canary && flags.stable) {
  throw new Error('--canary and --stable are mutually exclusive');
}

Try / catch

try {
  await Update.run(rawArgs);
} catch (err) {
  if (err instanceof CliUsageError && err.message.includes('--canary')) {
    console.error('Pick one channel: --canary OR --stable.');
    process.exitCode = 1;
  } else throw err;
}

Prevention

When it happens

Trigger: 'omp update --canary --stable'; wrapper scripts that append --stable while a user adds --canary (or vice versa).

Common situations: Aliases/scripts encoding a channel preference that collide with a manually typed opposite flag; CI configs merging two channel inputs.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/635af62949058049. Report an issue: GitHub.