Keywords: telemetry, PostHog, ErrorReporter, captureException, session, disable telemetry, BASE44_DISABLE_TELEMETRY
The CLI reports errors to PostHog for monitoring. This is handled by the ErrorReporter class in src/cli/telemetry/.
src/cli/telemetry/
├── consts.ts # PostHog API key, env var names
├── posthog.ts # PostHog client singleton
├── error-reporter.ts # ErrorReporter class
├── commander-hooks.ts # Adds command info to error context
└── index.ts # Barrel exports
The ErrorReporter is created once in runCLI() and injected via CLIContext:
// In runCLI() - creates and injects the reporter
const errorReporter = new ErrorReporter();
errorReporter.registerProcessErrorHandlers();
const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
const context: CLIContext = { errorReporter, isNonInteractive };
const program = createProgram(context);
// Context is set throughout execution
errorReporter.setContext({ user: { email, name } });
errorReporter.setContext({ appId: "..." });
errorReporter.setContext({ command: { name, args, options } });
// Errors are captured automatically in runCLI's catch block
errorReporter.captureException(error);- Session ID and duration
- User email (if logged in)
- Command name, args, and options
- App ID (if in a project)
- System info (Node version, OS, platform)
- Error stack traces
- Error code and
isUserError(forCLIErrorinstances)
Set the environment variable:
BASE44_DISABLE_TELEMETRY=1runCLI()createsErrorReporterand registers process error handlerscreateProgram(context)builds the command tree with injected context- Commands throw errors --
runCommand()catches, logs withlog.error(), displays hints, re-throws runCLI()catches errors, reports to PostHog (if notCLIExitError)- Uses
process.exitCode = 1(notprocess.exit()) to let event loop drain for telemetry flush