@wbern/cc-ping 1.2.0 → 1.3.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.js +11 -5
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1164,6 +1164,7 @@ var init_service = __esm({
1164
1164
  });
1165
1165
 
1166
1166
  // src/cli.ts
1167
+ import { basename } from "path";
1167
1168
  import { Command } from "commander";
1168
1169
 
1169
1170
  // src/check.ts
@@ -1242,7 +1243,7 @@ function bashCompletion() {
1242
1243
  fi
1243
1244
  ;;
1244
1245
  add)
1245
- COMPREPLY=( $(compgen -W "--group" -- "\${cur}") )
1246
+ COMPREPLY=( $(compgen -W "--name --group" -- "\${cur}") )
1246
1247
  ;;
1247
1248
  list|history|status|next-reset|check)
1248
1249
  COMPREPLY=( $(compgen -W "--json" -- "\${cur}") )
@@ -1321,7 +1322,7 @@ _cc_ping() {
1321
1322
  _arguments '--json[JSON output]'
1322
1323
  ;;
1323
1324
  add)
1324
- _arguments '--group[Assign group]:group:'
1325
+ _arguments '--name[Override handle]:name:' '--group[Assign group]:group:'
1325
1326
  ;;
1326
1327
  daemon)
1327
1328
  local -a subcmds
@@ -1389,6 +1390,7 @@ complete -c cc-ping -n "__fish_seen_subcommand_from ping" -l stagger -r -d "Dela
1389
1390
  complete -c cc-ping -n "__fish_seen_subcommand_from ping" -a "(cc-ping list 2>/dev/null | string replace -r ' *(.*) ->.*' '$1')"
1390
1391
 
1391
1392
  complete -c cc-ping -n "__fish_seen_subcommand_from list history status next-reset check" -l json -d "JSON output"
1393
+ complete -c cc-ping -n "__fish_seen_subcommand_from add" -s n -l name -r -d "Override handle"
1392
1394
  complete -c cc-ping -n "__fish_seen_subcommand_from add" -s g -l group -r -d "Assign group"
1393
1395
  complete -c cc-ping -n "__fish_seen_subcommand_from completions" -a "bash zsh fish"
1394
1396
 
@@ -1554,7 +1556,7 @@ function showDefault(log = console.log, now = /* @__PURE__ */ new Date()) {
1554
1556
  log("No accounts configured.");
1555
1557
  log("\nGet started:");
1556
1558
  log(" cc-ping scan Auto-discover accounts");
1557
- log(" cc-ping add <h> <d> Add an account manually");
1559
+ log(" cc-ping add <dir> Add an account manually");
1558
1560
  return;
1559
1561
  }
1560
1562
  const dupes = findDuplicates(accounts);
@@ -1689,7 +1691,7 @@ function suggestAccount(accounts, now = /* @__PURE__ */ new Date()) {
1689
1691
  }
1690
1692
 
1691
1693
  // src/cli.ts
1692
- var program = new Command().name("cc-ping").description("Ping Claude Code sessions to trigger quota windows early").version("1.2.0").option(
1694
+ var program = new Command().name("cc-ping").description("Ping Claude Code sessions to trigger quota windows early").version("1.3.0").option(
1693
1695
  "--config <path>",
1694
1696
  "Path to config directory (default: ~/.config/cc-ping, env: CC_PING_CONFIG)"
1695
1697
  ).hook("preAction", (thisCommand) => {
@@ -1779,7 +1781,11 @@ program.command("scan").description("Auto-discover accounts from ~/.claude-accou
1779
1781
  }
1780
1782
  }
1781
1783
  });
1782
- program.command("add").description("Add an account manually").argument("<handle>", "Account handle/name").argument("<config-dir>", "Path to the CLAUDE_CONFIG_DIR for this account").option("-g, --group <group>", "Assign account to a group").action((handle, configDir, opts) => {
1784
+ program.command("add").description("Add an account manually").argument("<config-dir>", "Path to the CLAUDE_CONFIG_DIR for this account").option(
1785
+ "-n, --name <name>",
1786
+ "Override account handle (default: directory name)"
1787
+ ).option("-g, --group <group>", "Assign account to a group").action((configDir, opts) => {
1788
+ const handle = opts.name || basename(configDir);
1783
1789
  addAccount(handle, configDir, opts.group);
1784
1790
  const groupInfo = opts.group ? ` [${opts.group}]` : "";
1785
1791
  console.log(`Added: ${handle} -> ${configDir}${groupInfo}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wbern/cc-ping",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Ping Claude Code sessions to trigger quota windows early across multiple accounts",
5
5
  "type": "module",
6
6
  "bin": {