claude-use 2.5.4 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.cjs +12 -8
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -221824,7 +221824,7 @@ var program = new Command();
221824
221824
  // package.json
221825
221825
  var package_default = {
221826
221826
  name: "claude-use",
221827
- version: "2.5.4",
221827
+ version: "2.6.0",
221828
221828
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
221829
221829
  license: "Apache-2.0",
221830
221830
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -241675,8 +241675,10 @@ var ProviderSchema = external_exports.strictObject({
241675
241675
  $schema: external_exports.string().optional(),
241676
241676
  displayName: external_exports.string().min(1),
241677
241677
  baseUrl: external_exports.url(),
241678
- tokenEnv: external_exports.string().min(1),
241678
+ tokenEnv: external_exports.string().min(1).optional(),
241679
241679
  env: external_exports.record(external_exports.string().min(1), external_exports.string()).optional()
241680
+ }).refine((provider) => provider.tokenEnv !== void 0 || (provider.env?.ANTHROPIC_AUTH_TOKEN ?? "") !== "", {
241681
+ message: "a provider needs either tokenEnv (the name of the environment variable holding its token) or a non-empty env.ANTHROPIC_AUTH_TOKEN"
241680
241682
  });
241681
241683
  var ConfigProfileSchema = external_exports.strictObject({
241682
241684
  $schema: external_exports.string().optional(),
@@ -247978,7 +247980,7 @@ function addProvider(paths, name, input2) {
247978
247980
  const parsed = ProviderSchema.safeParse({
247979
247981
  displayName: input2.displayName,
247980
247982
  baseUrl: input2.baseUrl,
247981
- tokenEnv: input2.tokenEnv,
247983
+ ...input2.tokenEnv === void 0 ? {} : { tokenEnv: input2.tokenEnv },
247982
247984
  ...input2.env === void 0 || Object.keys(input2.env).length === 0 ? {} : { env: input2.env }
247983
247985
  });
247984
247986
  if (!parsed.success) {
@@ -248017,12 +248019,12 @@ function resolveProvider(params) {
248017
248019
  message: `claude-use: no provider named "${name}". ` + (known.length > 0 ? `Known providers: ${known.join(", ")}.` : "No providers are defined yet; run `claude-use provider add`.")
248018
248020
  };
248019
248021
  }
248020
- const token = params.env[definition.tokenEnv];
248022
+ const token = definition.tokenEnv !== void 0 ? params.env[definition.tokenEnv] : definition.env?.ANTHROPIC_AUTH_TOKEN;
248021
248023
  if (token === void 0 || token === "") {
248022
248024
  return {
248023
248025
  ok: false,
248024
248026
  status: PROVIDER_MISSING_TOKEN_EXIT,
248025
- message: `claude-use: provider ${name} needs ${definition.tokenEnv} set in your environment`
248027
+ message: definition.tokenEnv !== void 0 ? `claude-use: provider ${name} needs ${definition.tokenEnv} set in your environment` : `claude-use: provider ${name} has no usable credential: its env.ANTHROPIC_AUTH_TOKEN is empty`
248026
248028
  };
248027
248029
  }
248028
248030
  return { ok: true, provider: { name, definition, token } };
@@ -248041,14 +248043,16 @@ function collectEnvPairs(value, previous = {}) {
248041
248043
  }
248042
248044
  function registerProviderCommand(program2, paths) {
248043
248045
  const provider = program2.command("provider").description("Manage API providers the launcher can route a session through.");
248044
- provider.command("add <name>").description("Create a new API provider definition.").requiredOption("--display-name <name>", "Human-readable name, exported to the child as CLAUDE_USE_PROVIDER.").requiredOption("--base-url <url>", "Anthropic-compatible base URL the child's requests are sent to.").requiredOption("--token-env <var>", "NAME of the environment variable holding the provider's token (never the token itself).").option("--env <pair>", "Extra KEY=VALUE environment entry for the child (repeatable).", collectEnvPairs).action((name, options) => {
248046
+ provider.command("add <name>").description("Create a new API provider definition.").requiredOption("--display-name <name>", "Human-readable name, exported to the child as CLAUDE_USE_PROVIDER.").requiredOption("--base-url <url>", "Anthropic-compatible base URL the child's requests are sent to.").option("--token-env <var>", "NAME of the environment variable holding the provider's token (never the token itself). Optional only when --env carries ANTHROPIC_AUTH_TOKEN (a local proxy's fixed dummy token).").option("--env <pair>", "Extra KEY=VALUE environment entry for the child (repeatable).", collectEnvPairs).action((name, options) => {
248045
248047
  addProvider(paths, name, {
248046
248048
  displayName: options.displayName,
248047
248049
  baseUrl: options.baseUrl,
248048
- tokenEnv: options.tokenEnv,
248050
+ ...options.tokenEnv === void 0 ? {} : { tokenEnv: options.tokenEnv },
248049
248051
  ...options.env === void 0 ? {} : { env: options.env }
248050
248052
  });
248051
- console.log(`Created provider "${name}" (${options.baseUrl}, token from ${options.tokenEnv}).`);
248053
+ console.log(
248054
+ options.tokenEnv === void 0 ? `Created provider "${name}" (${options.baseUrl}, fixed env credential).` : `Created provider "${name}" (${options.baseUrl}, token from ${options.tokenEnv}).`
248055
+ );
248052
248056
  });
248053
248057
  provider.command("list").description("List every API provider.").action(() => {
248054
248058
  const entries = listProviders(paths);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "2.5.4",
3
+ "version": "2.6.0",
4
4
  "description": "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Joseph Mearman <joseph@mearman.co.uk>",