@tameflare/cli 0.10.3 → 0.11.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.
- package/dist/commands/logs.js +1 -1
- package/dist/commands/stop.d.ts +2 -0
- package/dist/commands/stop.js +69 -0
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/commands/logs.js
CHANGED
|
@@ -41,7 +41,7 @@ function logsCommand() {
|
|
|
41
41
|
.description("View traffic logs in the dashboard")
|
|
42
42
|
.action(async () => {
|
|
43
43
|
const cfg = (0, utils_1.requireConfig)();
|
|
44
|
-
const url = `${cfg.dashboard_url}/dashboard/
|
|
44
|
+
const url = `${cfg.dashboard_url}/dashboard/traffic`;
|
|
45
45
|
console.log(`[TF] Traffic logs are available in the dashboard:`);
|
|
46
46
|
console.log(` ${url}`);
|
|
47
47
|
console.log("");
|
package/dist/commands/stop.d.ts
CHANGED
package/dist/commands/stop.js
CHANGED
|
@@ -1,10 +1,79 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stopCommand = stopCommand;
|
|
4
|
+
exports.startCommand = startCommand;
|
|
5
|
+
exports.resetCommand = resetCommand;
|
|
4
6
|
const commander_1 = require("commander");
|
|
5
7
|
const fs_1 = require("fs");
|
|
6
8
|
const utils_1 = require("../utils");
|
|
7
9
|
function stopCommand() {
|
|
10
|
+
const cmd = new commander_1.Command("stop")
|
|
11
|
+
.description("Stop the cloud gateway — rejects all proxied traffic until started again")
|
|
12
|
+
.action(async () => {
|
|
13
|
+
const cfg = (0, utils_1.requireConfig)();
|
|
14
|
+
console.log("[TF] Stopping gateway...");
|
|
15
|
+
try {
|
|
16
|
+
const res = await fetch(`${cfg.dashboard_url}/api/gateway/v2/stop`, {
|
|
17
|
+
method: "POST",
|
|
18
|
+
headers: { "Content-Type": "application/json" },
|
|
19
|
+
body: JSON.stringify({
|
|
20
|
+
gateway_token: cfg.gateway_token,
|
|
21
|
+
action: "stop",
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
const data = await res.json();
|
|
25
|
+
if (!res.ok) {
|
|
26
|
+
console.error(`[TF] Failed to stop gateway: ${data.error || res.statusText}`);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
console.log("");
|
|
30
|
+
console.log(` \x1b[31m■\x1b[0m Gateway "${data.name}" stopped`);
|
|
31
|
+
console.log(` ID: ${data.gateway_id}`);
|
|
32
|
+
console.log(` All proxied traffic will be blocked.`);
|
|
33
|
+
console.log("");
|
|
34
|
+
console.log(" To resume: tf start");
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
console.error(`[TF] Cannot reach dashboard: ${err.message}`);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return cmd;
|
|
42
|
+
}
|
|
43
|
+
function startCommand() {
|
|
44
|
+
const cmd = new commander_1.Command("start")
|
|
45
|
+
.description("Start (resume) the cloud gateway — allows proxied traffic again")
|
|
46
|
+
.action(async () => {
|
|
47
|
+
const cfg = (0, utils_1.requireConfig)();
|
|
48
|
+
console.log("[TF] Starting gateway...");
|
|
49
|
+
try {
|
|
50
|
+
const res = await fetch(`${cfg.dashboard_url}/api/gateway/v2/stop`, {
|
|
51
|
+
method: "POST",
|
|
52
|
+
headers: { "Content-Type": "application/json" },
|
|
53
|
+
body: JSON.stringify({
|
|
54
|
+
gateway_token: cfg.gateway_token,
|
|
55
|
+
action: "start",
|
|
56
|
+
}),
|
|
57
|
+
});
|
|
58
|
+
const data = await res.json();
|
|
59
|
+
if (!res.ok) {
|
|
60
|
+
console.error(`[TF] Failed to start gateway: ${data.error || res.statusText}`);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
console.log("");
|
|
64
|
+
console.log(` \x1b[32m▶\x1b[0m Gateway "${data.name}" started`);
|
|
65
|
+
console.log(` ID: ${data.gateway_id}`);
|
|
66
|
+
console.log(` Proxied traffic is now allowed.`);
|
|
67
|
+
console.log("");
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
console.error(`[TF] Cannot reach dashboard: ${err.message}`);
|
|
71
|
+
process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return cmd;
|
|
75
|
+
}
|
|
76
|
+
function resetCommand() {
|
|
8
77
|
const cmd = new commander_1.Command("reset")
|
|
9
78
|
.description("Remove TameFlare configuration from this directory")
|
|
10
79
|
.action(async () => {
|
package/dist/index.js
CHANGED
|
@@ -12,12 +12,14 @@ const program = new commander_1.Command();
|
|
|
12
12
|
program
|
|
13
13
|
.name("tf")
|
|
14
14
|
.description("TameFlare - Route AI agent traffic through a secure cloud gateway")
|
|
15
|
-
.version("0.
|
|
15
|
+
.version("0.11.0");
|
|
16
16
|
program.addCommand((0, login_1.loginCommand)());
|
|
17
17
|
program.addCommand((0, login_1.logoutCommand)());
|
|
18
18
|
program.addCommand((0, init_1.initCommand)());
|
|
19
19
|
program.addCommand((0, run_1.runCommand)());
|
|
20
20
|
program.addCommand((0, status_1.statusCommand)());
|
|
21
21
|
program.addCommand((0, stop_1.stopCommand)());
|
|
22
|
+
program.addCommand((0, stop_1.startCommand)());
|
|
23
|
+
program.addCommand((0, stop_1.resetCommand)());
|
|
22
24
|
program.addCommand((0, logs_1.logsCommand)());
|
|
23
25
|
program.parse();
|