clawdentity 0.0.0 → 0.0.1

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.
package/dist/bin.js CHANGED
@@ -17080,6 +17080,9 @@ var ENV_KEY_MAP = {
17080
17080
  registryUrl: "CLAWDENTITY_REGISTRY_URL",
17081
17081
  apiKey: "CLAWDENTITY_API_KEY"
17082
17082
  };
17083
+ var LEGACY_ENV_KEY_MAP = {
17084
+ registryUrl: ["CLAWDENTITY_REGISTRY"]
17085
+ };
17083
17086
  var DEFAULT_CONFIG = {
17084
17087
  registryUrl: DEFAULT_REGISTRY_URL
17085
17088
  };
@@ -17126,7 +17129,10 @@ var readConfig = async () => {
17126
17129
  var resolveConfig = async () => {
17127
17130
  const config2 = await readConfig();
17128
17131
  for (const key of Object.keys(ENV_KEY_MAP)) {
17129
- const envVar = process.env[ENV_KEY_MAP[key]];
17132
+ const envKeys = [ENV_KEY_MAP[key], ...LEGACY_ENV_KEY_MAP[key] ?? []];
17133
+ const envVar = envKeys.map((envKey) => process.env[envKey]).find((value) => {
17134
+ return typeof value === "string" && value.length > 0;
17135
+ });
17130
17136
  if (typeof envVar === "string" && envVar.length > 0) {
17131
17137
  config2[key] = envVar;
17132
17138
  }
@@ -18416,12 +18422,21 @@ var getValidatedKey = (key) => {
18416
18422
  logger5.warn("cli.invalid_config_key", { key });
18417
18423
  return void 0;
18418
18424
  };
18425
+ var getEnvRegistryUrlOverride = () => {
18426
+ const envCandidates = [
18427
+ process.env.CLAWDENTITY_REGISTRY_URL,
18428
+ process.env.CLAWDENTITY_REGISTRY
18429
+ ];
18430
+ return envCandidates.find((value) => {
18431
+ return typeof value === "string" && value.length > 0;
18432
+ });
18433
+ };
18419
18434
  var createConfigCommand = () => {
18420
18435
  const configCommand = new Command4("config").description(
18421
18436
  "Manage local CLI configuration"
18422
18437
  );
18423
- configCommand.command("init").description("Initialize local config file").action(
18424
- withErrorHandling("config init", async () => {
18438
+ configCommand.command("init").description("Initialize local config file").option("--registry-url <url>", "Initialize config with registry URL").action(
18439
+ withErrorHandling("config init", async (options) => {
18425
18440
  const configFilePath = getConfigFilePath();
18426
18441
  try {
18427
18442
  await access2(configFilePath);
@@ -18433,9 +18448,15 @@ var createConfigCommand = () => {
18433
18448
  }
18434
18449
  }
18435
18450
  const config2 = await readConfig();
18436
- await writeConfig(config2);
18451
+ const registryUrl = options.registryUrl ?? getEnvRegistryUrlOverride() ?? config2.registryUrl;
18452
+ await writeConfig({
18453
+ ...config2,
18454
+ registryUrl
18455
+ });
18437
18456
  writeStdoutLine(`Initialized config at ${configFilePath}`);
18438
- writeStdoutLine(JSON.stringify(maskApiKey(config2), null, 2));
18457
+ writeStdoutLine(
18458
+ JSON.stringify(maskApiKey({ ...config2, registryUrl }), null, 2)
18459
+ );
18439
18460
  })
18440
18461
  );
18441
18462
  configCommand.command("set <key> <value>").description("Set a config value").action(
package/dist/index.js CHANGED
@@ -17080,6 +17080,9 @@ var ENV_KEY_MAP = {
17080
17080
  registryUrl: "CLAWDENTITY_REGISTRY_URL",
17081
17081
  apiKey: "CLAWDENTITY_API_KEY"
17082
17082
  };
17083
+ var LEGACY_ENV_KEY_MAP = {
17084
+ registryUrl: ["CLAWDENTITY_REGISTRY"]
17085
+ };
17083
17086
  var DEFAULT_CONFIG = {
17084
17087
  registryUrl: DEFAULT_REGISTRY_URL
17085
17088
  };
@@ -17126,7 +17129,10 @@ var readConfig = async () => {
17126
17129
  var resolveConfig = async () => {
17127
17130
  const config2 = await readConfig();
17128
17131
  for (const key of Object.keys(ENV_KEY_MAP)) {
17129
- const envVar = process.env[ENV_KEY_MAP[key]];
17132
+ const envKeys = [ENV_KEY_MAP[key], ...LEGACY_ENV_KEY_MAP[key] ?? []];
17133
+ const envVar = envKeys.map((envKey) => process.env[envKey]).find((value) => {
17134
+ return typeof value === "string" && value.length > 0;
17135
+ });
17130
17136
  if (typeof envVar === "string" && envVar.length > 0) {
17131
17137
  config2[key] = envVar;
17132
17138
  }
@@ -18416,12 +18422,21 @@ var getValidatedKey = (key) => {
18416
18422
  logger5.warn("cli.invalid_config_key", { key });
18417
18423
  return void 0;
18418
18424
  };
18425
+ var getEnvRegistryUrlOverride = () => {
18426
+ const envCandidates = [
18427
+ process.env.CLAWDENTITY_REGISTRY_URL,
18428
+ process.env.CLAWDENTITY_REGISTRY
18429
+ ];
18430
+ return envCandidates.find((value) => {
18431
+ return typeof value === "string" && value.length > 0;
18432
+ });
18433
+ };
18419
18434
  var createConfigCommand = () => {
18420
18435
  const configCommand = new Command4("config").description(
18421
18436
  "Manage local CLI configuration"
18422
18437
  );
18423
- configCommand.command("init").description("Initialize local config file").action(
18424
- withErrorHandling("config init", async () => {
18438
+ configCommand.command("init").description("Initialize local config file").option("--registry-url <url>", "Initialize config with registry URL").action(
18439
+ withErrorHandling("config init", async (options) => {
18425
18440
  const configFilePath = getConfigFilePath();
18426
18441
  try {
18427
18442
  await access2(configFilePath);
@@ -18433,9 +18448,15 @@ var createConfigCommand = () => {
18433
18448
  }
18434
18449
  }
18435
18450
  const config2 = await readConfig();
18436
- await writeConfig(config2);
18451
+ const registryUrl = options.registryUrl ?? getEnvRegistryUrlOverride() ?? config2.registryUrl;
18452
+ await writeConfig({
18453
+ ...config2,
18454
+ registryUrl
18455
+ });
18437
18456
  writeStdoutLine(`Initialized config at ${configFilePath}`);
18438
- writeStdoutLine(JSON.stringify(maskApiKey(config2), null, 2));
18457
+ writeStdoutLine(
18458
+ JSON.stringify(maskApiKey({ ...config2, registryUrl }), null, 2)
18459
+ );
18439
18460
  })
18440
18461
  );
18441
18462
  configCommand.command("set <key> <value>").description("Set a config value").action(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawdentity",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -59,6 +59,8 @@ Use these commands as the default execution path for skill utilization:
59
59
 
60
60
  - Initialize local CLI config:
61
61
  - `clawdentity config init`
62
+ - `clawdentity config init --registry-url <registry-url>` (supports first-run registry URL override)
63
+ - or set env before init: `CLAWDENTITY_REGISTRY=<registry-url>` (supports env-based first-run override)
62
64
  - Configure registry URL and API key when missing:
63
65
  - `clawdentity config set registryUrl <registry-url>`
64
66
  - `clawdentity config set apiKey <api-key>`