usetraceforge-cli 0.1.8 → 0.1.10

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/index.js CHANGED
@@ -3,47 +3,47 @@ import { intro, outro, text, select, spinner } from "@clack/prompts";
3
3
  import chalk from "chalk";
4
4
  import { execa } from "execa";
5
5
  import { installNextJs } from "./installers/nextjs.js";
6
- import { runGeminiAgent } from "./installers/gemini.js";
7
6
  async function main() {
8
7
  console.log();
9
- intro(chalk.bgBlue.white.bold(" TraceForge Wizard "));
8
+ intro(chalk.bgBlue(chalk.white(" Welcome to TraceForge ")));
10
9
  const apiKey = await text({
11
10
  message: "What is your TraceForge API Key?",
12
11
  placeholder: "tf_...",
13
12
  validate(value) {
14
13
  if (value.length === 0)
15
- return "API Key is required";
14
+ return "API Key is required!";
16
15
  },
17
16
  });
18
17
  if (typeof apiKey !== "string") {
19
18
  outro(chalk.red("Installation cancelled."));
20
19
  process.exit(1);
21
20
  }
21
+ const endpoint = await text({
22
+ message: "What is your TraceForge Ingest Endpoint URL?",
23
+ placeholder: "http://localhost:80/ingest",
24
+ defaultValue: "http://localhost:80/ingest",
25
+ });
22
26
  const framework = await select({
23
27
  message: "Which framework are you using?",
24
28
  options: [
25
29
  { value: "nextjs", label: "Next.js (Prebuilt)" },
26
30
  { value: "express", label: "Express.js (Prebuilt)" },
27
- { value: "gemini", label: "🤖 Let AI scan my codebase (Gemini Agent)" },
28
31
  ],
29
32
  });
30
33
  if (typeof framework !== "string") {
31
34
  outro(chalk.red("Installation cancelled."));
32
35
  process.exit(1);
33
36
  }
34
- const endpoint = await text({
35
- message: "What is your TraceForge Ingest Endpoint URL?",
36
- placeholder: "http://localhost:80/ingest",
37
- defaultValue: "http://localhost:80/ingest",
38
- });
39
37
  const s = spinner();
40
- s.start("Installing usetraceforge SDK...");
38
+ s.start("Installing usetraceforge...");
41
39
  try {
42
- await execa("npm", ["install", "usetraceforge@latest"]);
43
- s.stop(chalk.green("SDK installed successfully."));
40
+ await execa("npm", ["install", "usetraceforge"]);
41
+ s.stop(chalk.green("Package usetraceforge installed successfully!"));
44
42
  }
45
43
  catch (error) {
46
- s.stop(chalk.red("Failed to install SDK. Please run 'npm install usetraceforge' manually."));
44
+ s.stop(chalk.red("Failed to install usetraceforge."));
45
+ console.error(error);
46
+ process.exit(1);
47
47
  }
48
48
  if (framework === "nextjs") {
49
49
  await installNextJs(apiKey, endpoint);
@@ -51,9 +51,6 @@ async function main() {
51
51
  else if (framework === "express") {
52
52
  console.log(chalk.yellow("Express auto-installation coming soon."));
53
53
  }
54
- else if (framework === "gemini") {
55
- await runGeminiAgent(apiKey, endpoint);
56
- }
57
54
  outro(chalk.green("✨ You're all set! TraceForge is now protecting your application."));
58
55
  }
59
56
  main().catch((err) => {
@@ -60,6 +60,7 @@ ${folderStructure}
60
60
 
61
61
  Here is the documentation for usetraceforge:
62
62
  - Next.js 15+ Server: Create 'instrumentation.ts' (or 'src/instrumentation.ts') exporting 'register' and 'onRequestError(err, request)' which calls 'TraceForge.captureException(err, { tags: { route: request.url } })'.
63
+ - Next.js App Router API Routes: If developers use try/catch in their API routes, they must wrap their route export with 'withTraceForgeRoute' from 'usetraceforge/next' to auto-initialize and catch errors (e.g. 'export const GET = withTraceForgeRoute(async (req) => { ... })').
63
64
  - Next.js Client: Wrap your app with '<TraceForgeProvider>' from 'usetraceforge/react'.
64
65
  - Express: Call 'app.use(TraceForge.expressErrorHandler())' AFTER all routes but BEFORE custom error handlers.
65
66
  - Initialization: You must always call 'TraceForge.init({ apiKey, endpoint })' as early as possible.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usetraceforge-cli",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "TraceForge CLI Wizard for 2-click installations",
5
5
  "bin": {
6
6
  "traceforge": "./dist/index.js"
@@ -17,7 +17,6 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@clack/prompts": "^0.7.0",
20
- "@google/generative-ai": "^0.24.1",
21
20
  "chalk": "^5.3.0",
22
21
  "execa": "^9.3.0",
23
22
  "ts-morph": "^28.0.0"