Set up OneMinute Logs in an existing application from the terminal.
npx oneminute initThe CLI discovers supported applications, signs you in, reuses or creates an API key, installs the correct OML SDK, and previews every configuration change before applying it. It supports Next.js, Express, NestJS, and React projects, including monorepos.
Requires Node.js 20.19 or newer.
# Interactive project setup
npx oneminute init
# Inspect detected applications without changing files
npx oneminute init --no-interactive
# Return discovery results as JSON
npx oneminute init --json
# Show additional package and repository details
npx oneminute init --verbose
# Sign out of the shared CLI and Pilot session
npx oneminute logoutRun init from the root of a project or monorepo. Repeated runs reuse valid
configuration and avoid duplicate providers, middleware, logger utilities, and
environment entries.
- Installs the appropriate official OML SDK for every selected application.
- Creates or reuses a server-only logger and
measureOperation()helper. - Configures native request monitoring for Express and NestJS.
- Configures the Next.js logger, request error hook, browser provider, and secure same-origin forwarding route when applicable.
- Configures React browser monitoring through a selected server backend without exposing the ingestion API key to the browser.
- Offers to add the embedded OML dashboard to a compatible Next.js App Router application.
- Writes a secret-free
oml.jsonmanifest used by OneMinute Pilot and OML MCP. - Optionally registers OML MCP with installed Codex and Claude Code clients.
Existing application behavior, error propagation, return values, retries, and custom logging utilities are preserved. If the CLI cannot determine a safe setup, it reports the unresolved file instead of guessing.
For a new Next.js setup, the shared server utility follows this structure:
import "server-only";
import { createLogger } from "@oneminutelogs/next";
export const log = createLogger({
apiKey: process.env.ONE_MINUTE_LOGS_API_KEY!,
projectName: "your-project",
environment: process.env.NODE_ENV ?? "development",
});
export { log as logger };The generated measureOperation() helper records structured duration and outcome
telemetry with fields such as operation.category, operation.type,
operation.target, http.route, http.request.method, and perf.duration_ms.
The CLI uses the trusted OML V2 API:
https://api.oneminutelogs.com/api/v2
Login sessions and ingestion keys are stored in the current user's configuration
directory with restricted filesystem permissions. API keys are written only to
the selected application's server-side environment file and are never stored in
oml.json or printed in terminal output.
The browser authorization page defaults to https://dashboard.oneminutelogs.com.
CLI and OneMinute Pilot reuse the same authenticated session when they run as the
same operating-system user.
For a compatible Next.js App Router application, the CLI can create an
observability page using OMLDashboard from @oneminutelogs/next/dashboard. It
also creates the required authenticated forwarding routes and dashboard access
configuration. Existing routes and custom pages are never overwritten.
Interactive setup can register the bundled OML MCP server with Codex and Claude
Code. The registration is scoped to the current project and uses the published
oneminute package, so no separate MCP package is required.
The available tools are:
oml_project_contextoml_conventionsoml_validateoml_update_report
Existing MCP registrations are preserved.