From c34c296a450cb78aaed98c980cacc9443b0db06d Mon Sep 17 00:00:00 2001 From: Mathew Goldsborough <1759329+mgoldsborough@users.noreply.github.com> Date: Sat, 28 Mar 2026 11:26:08 -1000 Subject: [PATCH] Rename --update flag to --no-cache on mpak run --no-cache is the idiomatic flag name (npm, pip, docker) and better describes the behavior, especially with --local where there is no registry update involved. Renames RunOptions.update to .noCache and normalizes Commander.js --no-* boolean in both action handlers. --- packages/cli/src/commands/packages/run.ts | 10 +++++----- packages/cli/src/program.ts | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/cli/src/commands/packages/run.ts b/packages/cli/src/commands/packages/run.ts index 17d6b5e..530f057 100644 --- a/packages/cli/src/commands/packages/run.ts +++ b/packages/cli/src/commands/packages/run.ts @@ -25,7 +25,7 @@ import type { CacheMetadata } from "../../utils/cache.js"; import { ConfigManager } from "../../utils/config-manager.js"; export interface RunOptions { - update?: boolean; + noCache?: boolean; local?: string; // Path to local .mcpb file } @@ -367,7 +367,7 @@ export async function handleRun( cacheDir = getLocalCacheDir(bundlePath); const needsExtract = - options.update || + options.noCache || localBundleNeedsExtract(bundlePath, cacheDir); if (needsExtract) { @@ -407,12 +407,12 @@ export async function handleRun( cachedMeta = getCacheMetadata(cacheDir); // Check if we have a cached version - if (cachedMeta && !options.update) { + if (cachedMeta && !options.noCache) { if (requestedVersion) { // Specific version requested - check if cached version matches needsPull = !isSemverEqual(cachedMeta.version, requestedVersion); } else { - // Latest requested - use cache (user can --update to refresh) + // Latest requested - use cache (user can --no-cache to refresh) needsPull = false; } } @@ -424,7 +424,7 @@ export async function handleRun( if ( cachedMeta && isSemverEqual(cachedMeta.version, downloadInfo.bundle.version) && - !options.update + !options.noCache ) { needsPull = false; } diff --git a/packages/cli/src/program.ts b/packages/cli/src/program.ts index 1b3661e..404c0fc 100644 --- a/packages/cli/src/program.ts +++ b/packages/cli/src/program.ts @@ -64,9 +64,10 @@ export function createProgram(): Command { program .command("run [package]") .description('Run an MCP server (alias for "bundle run")') - .option("--update", "Force re-download even if cached") + .option("--no-cache", "Always re-extract, skip cache") .option("-l, --local ", "Run a local .mcpb bundle file") .action(async (packageSpec, options) => { + options.noCache = options.cache === false; await handleRun(packageSpec || "", options); }); @@ -130,9 +131,10 @@ export function createProgram(): Command { bundle .command("run [package]") .description("Run an MCP server from the registry") - .option("--update", "Force re-download even if cached") + .option("--no-cache", "Always re-extract, skip cache") .option("-l, --local ", "Run a local .mcpb bundle file") .action(async (packageSpec, options) => { + options.noCache = options.cache === false; await handleRun(packageSpec || "", options); });