augteam 1.1.3 → 1.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "augteam",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "CLI tool for rotating Augment session accounts",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -1,5 +1,6 @@
1
1
  const { apiRequest } = require("../utils/api");
2
2
  const { requireAuth } = require("../utils/auth");
3
+ const { getCliName } = require("../utils/paths");
3
4
 
4
5
  async function statusCommand() {
5
6
  requireAuth();
@@ -8,7 +9,7 @@ async function statusCommand() {
8
9
  const data = await apiRequest("GET", "/api/session/status");
9
10
 
10
11
  if (!data.current) {
11
- console.log("ℹ️ No active session. Run: auggw switch");
12
+ console.log(`ℹ️ No active session. Run: ${getCliName()} switch`);
12
13
  console.log();
13
14
  } else {
14
15
  console.log("📋 Current Account");
@@ -46,7 +47,7 @@ async function statusCommand() {
46
47
  console.log(` Total: ${data.pool.total} accounts`);
47
48
  } catch (err) {
48
49
  if (err.status === 401) {
49
- console.error("❌ Session expired. Please login again: auggw login");
50
+ console.error(`❌ Session expired. Please login again: ${getCliName()} login`);
50
51
  } else {
51
52
  console.error(`❌ Error: ${err.message}`);
52
53
  }
package/src/index.js CHANGED
@@ -1,50 +1,51 @@
1
- const { Command } = require('commander');
2
- const loginCommand = require('./commands/login');
3
- const logoutCommand = require('./commands/logout');
4
- const switchCommand = require('./commands/switch');
5
- const statusCommand = require('./commands/status');
6
- const updateCommand = require('./commands/update');
7
- const fetchCommand = require('./commands/fetch');
8
- const { checkUpdate } = require('./utils/update');
9
- const pkg = require('../package.json');
10
-
11
- const program = new Command();
12
-
13
- program
14
- .name(Object.keys(pkg.bin)[0] || 'auggw')
15
- .description('CLI tool for rotating Augment session accounts')
16
- .version(pkg.version);
17
-
18
- program
19
- .command('login')
20
- .description('Authenticate with the session rotator backend')
21
- .action(loginCommand);
22
-
23
- program
24
- .command('logout')
25
- .description('Remove saved token and log out')
26
- .action(logoutCommand);
27
-
28
- program
29
- .command('switch')
30
- .description('Switch to the next available Augment session')
31
- .action(switchCommand);
32
-
33
- program
34
- .command('status')
35
- .description('View current account and pool status')
36
- .action(statusCommand);
37
-
38
- program
39
- .command('update')
40
- .description('Update CLI to the latest version')
41
- .action(updateCommand);
42
-
43
- program
44
- .command('fetch')
45
- .description('Fetch resources from server')
46
- .option('--prompts', 'Fetch commands & skills to ~/.augment and/or ~/.claude')
47
- .action(fetchCommand);
48
-
49
- program.parseAsync().then(() => checkUpdate());
50
-
1
+ const path = require("path");
2
+ require("dotenv").config({ path: path.join(__dirname, "..", ".env"), quiet: true });
3
+ const { Command } = require("commander");
4
+ const loginCommand = require("./commands/login");
5
+ const logoutCommand = require("./commands/logout");
6
+ const switchCommand = require("./commands/switch");
7
+ const statusCommand = require("./commands/status");
8
+ const updateCommand = require("./commands/update");
9
+ const fetchCommand = require("./commands/fetch");
10
+ const { checkUpdate } = require("./utils/update");
11
+ const pkg = require("../package.json");
12
+
13
+ const program = new Command();
14
+
15
+ program
16
+ .name(Object.keys(pkg.bin)[0] || "auggw")
17
+ .description("CLI tool for rotating Augment session accounts")
18
+ .version(pkg.version);
19
+
20
+ program
21
+ .command("login")
22
+ .description("Authenticate with the session rotator backend")
23
+ .action(loginCommand);
24
+
25
+ program
26
+ .command("logout")
27
+ .description("Remove saved token and log out")
28
+ .action(logoutCommand);
29
+
30
+ program
31
+ .command("switch")
32
+ .description("Switch to the next available Augment session")
33
+ .action(switchCommand);
34
+
35
+ program
36
+ .command("status")
37
+ .description("View current account and pool status")
38
+ .action(statusCommand);
39
+
40
+ program
41
+ .command("update")
42
+ .description("Update CLI to the latest version")
43
+ .action(updateCommand);
44
+
45
+ program
46
+ .command("fetch")
47
+ .description("Fetch resources from server")
48
+ .option("--prompts", "Fetch commands & skills to ~/.augment and/or ~/.claude")
49
+ .action(fetchCommand);
50
+
51
+ program.parseAsync().then(() => checkUpdate());
package/src/utils/api.js CHANGED
@@ -1,11 +1,13 @@
1
1
  const os = require("os");
2
2
  const { loadToken } = require("./token");
3
+ const { getCliName } = require("./paths");
3
4
 
4
5
  const DEFAULT_API_URL = "https://augteam.quangit.site";
5
6
  // const DEFAULT_API_URL = "http://localhost:3000";
6
7
 
7
8
  function getBaseURL() {
8
- return process.env.auggw_API_URL || DEFAULT_API_URL;
9
+ const envKey = `${getCliName()}_API_URL`;
10
+ return process.env[envKey] || DEFAULT_API_URL;
9
11
  }
10
12
 
11
13
  function getLocalIP() {
package/src/utils/auth.js CHANGED
@@ -1,9 +1,10 @@
1
1
  const { loadToken } = require("./token");
2
+ const { getCliName } = require("./paths");
2
3
 
3
4
  function requireAuth() {
4
5
  const token = loadToken();
5
6
  if (!token) {
6
- console.error("❌ Please login first: auggw login");
7
+ console.error(`❌ Please login first: ${getCliName()} login`);
7
8
  process.exit(1);
8
9
  }
9
10
  }
@@ -1,12 +1,19 @@
1
1
  const os = require("os");
2
2
  const path = require("path");
3
3
 
4
+ const pkg = require("../../package.json");
5
+ const CLI_NAME = Object.keys(pkg.bin || {})[0] || "auggw";
6
+
4
7
  function getTokenPath() {
5
- return path.join(os.homedir(), ".auggw", "token");
8
+ return path.join(os.homedir(), `.${CLI_NAME}`, "token");
6
9
  }
7
10
 
8
11
  function getSessionPath() {
9
12
  return path.join(os.homedir(), ".augment", "session.json");
10
13
  }
11
14
 
12
- module.exports = { getTokenPath, getSessionPath };
15
+ function getCliName() {
16
+ return CLI_NAME;
17
+ }
18
+
19
+ module.exports = { getTokenPath, getSessionPath, getCliName };