From 50540d0e633c4ce0eddbf84f39c963e2bf599acb Mon Sep 17 00:00:00 2001 From: Satchmo <456719+rohenaz@users.noreply.github.com> Date: Fri, 4 Sep 2026 15:45:29 -0400 Subject: [PATCH] Allow fetch to select a plan version --- packages/cli/src/index.ts | 1 + packages/cli/test/cli.test.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index d97a1d6..0db4a4d 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -28,6 +28,7 @@ export function buildProgram(): Command { 'Create encrypted hosted plans and publish them as 1Sat Ordinals.', ) .version(CLI_VERSION) + .enablePositionalOptions() const auth = program .command('auth') diff --git a/packages/cli/test/cli.test.ts b/packages/cli/test/cli.test.ts index c823dec..de368ad 100644 --- a/packages/cli/test/cli.test.ts +++ b/packages/cli/test/cli.test.ts @@ -182,6 +182,21 @@ describe('cli surface', () => { ) }) + test('fetch --version selects a draft version', async () => { + const parsed = overridden() + const fetch = commandNamed(parsed, 'fetch') + let version: string | undefined + fetch.action((_origin: string, options: { version?: string }) => { + version = options.version + }) + + await parsed.parseAsync(['fetch', ORIGIN, '--version', '1'], { + from: 'user', + }) + + expect(version).toBe('1') + }) + test('catalog sync takes json, wallet-url, and site-url flags', () => { const catalog = commandNamed(program, 'catalog') expect(catalog.commands.map((c) => c.name())).toEqual(['sync'])