burnboard-cli 0.3.2 → 0.3.3

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/cli.mjs CHANGED
@@ -26,9 +26,13 @@ function run(executable, runArgs) {
26
26
  return result.status ?? 1;
27
27
  }
28
28
 
29
- function setup(nameOverride, mode = "setup") {
29
+ function setup(nameOverride, mode = "setup", serverOverride) {
30
30
  const name = nameOverride || option("--name", args.find((value) => !value.startsWith("-")));
31
- const server = option("--server", "https://burnboard-public.vercel.app");
31
+ const requestedServer = option("--server", undefined);
32
+ const existingConfigPath = path.join(burnboardRoot, "config.json");
33
+ let savedServer;
34
+ if (fs.existsSync(existingConfigPath)) try { savedServer = JSON.parse(fs.readFileSync(existingConfigPath, "utf8").replace(/^\uFEFF/, "")).serverUrl; } catch {}
35
+ const server = requestedServer || serverOverride || (mode !== "connect" ? savedServer : undefined) || "https://burnboard.cc";
32
36
  if (!name || name.startsWith("--")) throw new Error('A name is required. Example: npx burnboard-cli setup --name "Harsh Sawant"');
33
37
  let status;
34
38
  if (process.platform === "win32") {
@@ -45,7 +49,7 @@ function setup(nameOverride, mode = "setup") {
45
49
 
46
50
  async function connect() {
47
51
  const code = option("--code", args.find((value) => !value.startsWith("-")));
48
- const server = option("--server", "https://burnboard-public.vercel.app");
52
+ const server = option("--server", "https://burnboard.cc");
49
53
  if (!code || code.startsWith("--")) throw new Error("A connection code is required. Copy the command shown on your BurnBoard profile.");
50
54
  console.log("Connecting this computer to BurnBoard...");
51
55
  const response = await fetch(`${server}/api/connect`, { method:"POST", headers:{"content-type":"application/json"}, body:JSON.stringify({ code, deviceName:os.hostname(), platform:process.platform, cliVersion }) });
@@ -73,7 +77,7 @@ function update() {
73
77
  return;
74
78
  }
75
79
  console.log(`Updating BurnBoard from ${installedVersion || "a legacy installation"} to ${cliVersion}...`);
76
- if (setup("Existing BurnBoard User", "update") !== 0) throw new Error("The update did not complete successfully; the existing tracker is unchanged.");
80
+ if (setup("Existing BurnBoard User", "update", config.serverUrl) !== 0) throw new Error("The update did not complete successfully; the existing tracker is unchanged.");
77
81
  }
78
82
 
79
83
  function sync() {
@@ -1,4 +1,4 @@
1
- param([Parameter(Mandatory=$true)][string]$Name,[string]$ServerUrl="https://burnboard-public.vercel.app")
1
+ param([Parameter(Mandatory=$true)][string]$Name,[string]$ServerUrl="https://burnboard.cc")
2
2
  $ErrorActionPreference="Stop"
3
3
  function Show-SetupProgress([int]$Percent,[string]$Status){Write-Progress -Activity "Connecting to BurnBoard" -Status $Status -PercentComplete $Percent}
4
4
  Show-SetupProgress 5 "Preparing your local tracker..."
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
- NAME="${1:?Usage: burnboard-setup.sh NAME [SERVER_URL]}"; SERVER_URL="${2:-https://burnboard-public.vercel.app}"; MODE="${3:-setup}"
3
+ NAME="${1:?Usage: burnboard-setup.sh NAME [SERVER_URL]}"; SERVER_URL="${2:-https://burnboard.cc}"; MODE="${3:-setup}"
4
4
  command -v node >/dev/null || { echo "Node.js is required." >&2; exit 1; }
5
5
  INSTALL_DIR="$HOME/.burnboard"; CONFIG="$INSTALL_DIR/config.json"; mkdir -p "$INSTALL_DIR" "$HOME/.claude"
6
6
  printf '[1/5] Preparing BurnBoard profile...\n'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "burnboard-cli",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Connect local AI coding token usage to BurnBoard",
5
5
  "type": "module",
6
6
  "bin": {