Dashboard › cli › Distillation
a1a623e6-48c6-49ab-9af2-0c68b8767d67["lore_tm_v1_chxIXv0MswBVyzYmzlbbfNSNWcz4xkIDTtr-GrQs5C4"]
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts, the method flag is parsed by parseInstallationMethod, is optional, uses placeholder "method", and is documented as supporting curl, brew, npm, pnpm, bun, and yarn.func() calls resolveContext(version, flags) to obtain { channel, versionArg, channelChanged, method }, then debug-logs the installation method and CLI_VERSION.withProgress({ message: "Checking for updates...", json: flags.json }, ...), invoking resolveTargetWithFallback() with resolveOpts: { method, channel, versionArg, channelChanged, flags }, versionArg, offline: flags.offline, method, and persistChannelFn: () => persistChannel(channel, channelChanged, version).resolveTargetWithFallback() returns kind === "done", the command returns its result immediately; however, for an online action === "checked" result where currentVersion !== targetVersion, it first populates result.changelog via startChangelogFetch({ channel, currentVersion: CLI_VERSION, targetVersion: result.targetVersion, offline: false, source: resolved.source }).startChangelogFetch() before downloading so changelog retrieval runs in parallel with the upgrade; it passes channel, CLI_VERSION, target, resolved offline, and resolved source.--check fallback is represented by resolveTargetWithFallback() as kind: "target" rather than "done"; the command therefore explicitly guards on flags.check and calls buildCheckResultWithChangelog({ target, versionArg, method, channel, flags, offline, changelogPromise }) instead of performing an upgrade."up-to-date" without installing when CLI_VERSION === target, except when flags.force is true or channelChanged is true. The result includes currentVersion, targetVersion, channel, method, forced: false, and offline: true only when operating offline.downgrade = isDowngrade(CLI_VERSION, target) and logs either "Downgrading" or "Upgrading" with the target version.channel === "nightly" and method !== "curl", the command calls migrateToStandaloneForNightly() with method, target, versionArg, noAgentSkills: flags["no-agent-skills"], json: flags.json, and the resolved source; returned migration warnings are retained.executeStandardUpgrade() with method, channel, versionArg, target, execPath: this.process.execPath, entryPath: this.process.argv?.[1], pathEnv: this.process.env.PATH, offline, json: flags.json, noAgentSkills: flags["no-agent-skills"], and resolved source.changelogPromise and begins constructing a CommandOutput whose action is "downgraded" when isDowngrade() was true and "upgraded" otherwise.