Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.insforge.dev/llms.txt

Use this file to discover all available pages before exploring further.

When something breaks, an agent should not have to guess. npx @insforge/cli diagnose turns the backend’s own signals into something an agent can fetch and act on directly: advisor findings with remediations, database health checks, instance metrics, and aggregated error logs. Each finding comes with a fix, so “what is wrong” and “what to do about it” arrive together. The agent pulls all of this itself, with no dashboard in the loop, which is what lets it close security gaps like a permissive RLS policy before they leak data.
Backend Advisor finding: a permissive RLS policy on public.messages with a Copy Remediation button

Full health report

Run diagnose with no subcommand for everything at once:
npx @insforge/cli diagnose
npx @insforge/cli diagnose --json
The report bundles the advisor scan, database health, instance metrics, and recent error logs into one output. In --json mode the agent gets it all as structured data.

Backend Advisor

The advisor scans for security, performance, and health issues and writes a remediation for each one. The dashboard shows the findings with a “Copy Remediation” button, but the agent does not need the dashboard: it fetches the same scan directly with --json and applies the fix itself, so a security issue gets closed without waiting for a human to notice it.
npx @insforge/cli diagnose advisor
npx @insforge/cli diagnose advisor --json
A typical finding is a permissive RLS policy that exposes a table to anonymous users. The advisor names the table, the severity, and the SQL to fix it. The agent reads the finding, applies the remediation as a migration, and re-scans to confirm it cleared.

Targeted checks

Each part of the report is also available on its own:
CommandWhat it checks
diagnose advisorLatest advisor scan: security, performance, and health issues
diagnose dbDatabase health: connections, table bloat, index usage
diagnose metricsInstance metrics: CPU, memory, disk, and network
diagnose logsError-level logs aggregated across every backend source
For raw logs from a single source, use the top-level command:
npx @insforge/cli logs function.logs
npx @insforge/cli logs postgres.logs
Sources include insforge.logs, postgREST.logs, postgres.logs, function.logs, and function-deploy.logs.

Let the agent interpret it

diagnose --ai hands the collected diagnostic data to a model and returns a plain-language analysis:
npx @insforge/cli diagnose --ai "why did write latency spike after the last deploy?"
This is the difference between dumping a stack trace and explaining the fix. The agent asks a question about the live backend and gets an answer grounded in the actual signals.

Next steps

  • Apply advisor remediations as migrations so the fix is versioned.
  • Rehearse a risky fix on a backend branch before it touches production.
  • Read the CLI harness for the rest of the command surface.