diff --git a/.changeset/create-expert-optional-query.md b/.changeset/create-expert-optional-query.md new file mode 100644 index 00000000..84bf241f --- /dev/null +++ b/.changeset/create-expert-optional-query.md @@ -0,0 +1,5 @@ +--- +"create-expert": patch +--- + +Make query argument optional and add --continue/--continue-job support diff --git a/apps/create-expert/bin/cli.ts b/apps/create-expert/bin/cli.ts index e6a3bc25..0d0a12f6 100644 --- a/apps/create-expert/bin/cli.ts +++ b/apps/create-expert/bin/cli.ts @@ -16,21 +16,18 @@ const config = parseWithFriendlyError( new Command() .name("create-expert") .description("Create and modify Perstack expert definitions") - .argument("", "Description of the expert to create or modify") - .action(async (query: string) => { - await startHandler( - "expert", - query, - {}, - { - perstackConfig: config, - additionalEnv: (env) => { - const provider = config.provider?.providerName ?? "anthropic" - const envKey = PROVIDER_ENV_MAP[provider] - const value = envKey ? env[envKey] : undefined - return value ? { PROVIDER_API_KEY: value } : ({} as Record) - }, + .argument("[query]", "Description of the expert to create or modify") + .option("--continue", "Continue the most recent job with new query") + .option("--continue-job ", "Continue the specified job with new query") + .action(async (query: string | undefined, options: Record) => { + await startHandler("expert", query, options, { + perstackConfig: config, + additionalEnv: (env) => { + const provider = config.provider?.providerName ?? "anthropic" + const envKey = PROVIDER_ENV_MAP[provider] + const value = envKey ? env[envKey] : undefined + return value ? { PROVIDER_API_KEY: value } : ({} as Record) }, - ) + }) }) .parse()