@revstackhq/cli 0.0.0-dev-20260226063200 → 0.0.0-dev-20260226064743

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.
@@ -1,39 +1,39 @@
1
- /**
2
- * @file commands/login.ts
3
- * @description Interactive authentication flow. Prompts the user for their
4
- * Revstack Secret Key and stores it globally for subsequent CLI commands.
5
- */
6
-
7
- import { Command } from "commander";
8
- import chalk from "chalk";
9
- import prompts from "prompts";
10
- import { setApiKey } from "@/utils/auth.js";
11
-
12
- export const loginCommand = new Command("login")
13
- .description("Authenticate with your Revstack Secret Key")
14
- .action(async () => {
15
- console.log(
16
- "\n" + chalk.bold(" Revstack ") + chalk.dim("— Authentication\n")
17
- );
18
-
19
- const response = await prompts({
20
- type: "password",
21
- name: "secretKey",
22
- message: "Enter your Revstack Secret Key",
23
- validate: (value: string) =>
24
- value.startsWith("sk_") ? true : "Secret key must start with sk_",
25
- });
26
-
27
- if (!response.secretKey) {
28
- console.log(chalk.dim("\n Login cancelled.\n"));
29
- process.exit(0);
30
- }
31
-
32
- setApiKey(response.secretKey);
33
-
34
- console.log(
35
- "\n" +
36
- chalk.green(" ✔ Authenticated successfully!\n") +
37
- chalk.dim(" Credentials saved to ~/.revstack/credentials.json\n")
38
- );
39
- });
1
+ /**
2
+ * @file commands/login.ts
3
+ * @description Interactive authentication flow. Prompts the user for their
4
+ * Revstack Secret Key and stores it globally for subsequent CLI commands.
5
+ */
6
+
7
+ import { Command } from "commander";
8
+ import chalk from "chalk";
9
+ import prompts from "prompts";
10
+ import { setApiKey } from "@/utils/auth.js";
11
+
12
+ export const loginCommand = new Command("login")
13
+ .description("Authenticate with your Revstack Secret Key")
14
+ .action(async () => {
15
+ console.log(
16
+ "\n" + chalk.bold(" Revstack ") + chalk.dim("— Authentication\n"),
17
+ );
18
+
19
+ const response = await prompts({
20
+ type: "password",
21
+ name: "secretKey",
22
+ message: "Enter your Revstack Secret Key",
23
+ validate: (value: string) =>
24
+ value.startsWith("sk_") ? true : "Secret key must start with sk_",
25
+ });
26
+
27
+ if (!response.secretKey) {
28
+ console.log(chalk.dim("\n Login cancelled.\n"));
29
+ process.exit(0);
30
+ }
31
+
32
+ setApiKey(response.secretKey);
33
+
34
+ console.log(
35
+ "\n" +
36
+ chalk.green(" ✔ Authenticated successfully!\n") +
37
+ chalk.dim(" Credentials saved to ~/.revstack/credentials.json\n"),
38
+ );
39
+ });
@@ -1,25 +1,27 @@
1
- /**
2
- * @file commands/logout.ts
3
- * @description Clears stored Revstack credentials.
4
- */
5
-
6
- import { Command } from "commander";
7
- import chalk from "chalk";
8
- import { clearApiKey, getApiKey } from "@/utils/auth.js";
9
-
10
- export const logoutCommand = new Command("logout")
11
- .description("Clear stored Revstack credentials")
12
- .action(() => {
13
- if (!getApiKey()) {
14
- console.log(chalk.dim("\n Not currently logged in.\n"));
15
- return;
16
- }
17
-
18
- clearApiKey();
19
-
20
- console.log(
21
- "\n" +
22
- chalk.green(" ✔ Successfully logged out.\n") +
23
- chalk.dim(" Credentials removed from ~/.revstack/credentials.json\n")
24
- );
25
- });
1
+ /**
2
+ * @file commands/logout.ts
3
+ * @description Clears stored Revstack credentials.
4
+ */
5
+
6
+ import { Command } from "commander";
7
+ import chalk from "chalk";
8
+ import { clearApiKey, getApiKey } from "@/utils/auth.js";
9
+
10
+ export const logoutCommand = new Command("logout")
11
+ .description("Clear stored Revstack credentials")
12
+ .action(() => {
13
+ if (!getApiKey()) {
14
+ console.log(chalk.dim("\n Not currently logged in.\n"));
15
+ return;
16
+ }
17
+
18
+ clearApiKey();
19
+
20
+ console.log(
21
+ "\n" +
22
+ chalk.green(" ✔ Successfully logged out.\n") +
23
+ chalk.dim(
24
+ " Credentials removed from ~/.revstack/credentials.json\n",
25
+ ),
26
+ );
27
+ });