Registry / devops / opscale

opscale

JSON →
library0.1.4jsnpmunverified

opscale is a read-only operations analytics CLI and AI Skill for SQL databases. Current version 0.1.4 is an early release with monthly cadence. It provides a command-line interface and an AI-powered natural language query (Skill) for analyzing database operational metrics without write permissions. Key differentiators include its focus on read-only safety, integrated AI Skill for natural-language-to-SQL, and support for multiple SQL databases. Compared to generic SQL clients, it targets ops analytics with pre-built insights and AI assistance.

npm install opscale
INSTALL
IMPORT
SIG · OPSCALE
O
opscale
devopsjavascriptv0.1.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cli
npx opscale <command>
opscale <command>
Use npx since it's a CLI tool; global install is not recommended.
Skill
import { Skill } from 'opscale'
const { Skill } = require('opscale')
Package is ESM-only; CommonJS require will fail. Use dynamic import if needed.
DatabaseConfig
import type { DatabaseConfig } from 'opscale'
TypeScript users should import the type explicitly for database configuration.

Demonstrates two usage modes: CLI for ad-hoc analysis and programmatic AI Skill for natural language queries.

// Install and run the CLI npx opscale --help // Analyze database npx opscale analyze \ --host localhost \ --port 5432 \ --user admin \ --password ${DB_PASSWORD} // Programmatic usage with AI Skill import { Skill } from 'opscale' const skill = new Skill({ database: 'postgresql', connection: { host: process.env.DB_HOST ?? 'localhost', port: 5432, user: process.env.DB_USER ?? 'admin', password: process.env.DB_PASSWORD ?? '' } }) const result = await skill.query('Show me the slowest queries today') console.log(result)
Debug
Known issues
breakingNode.js >=22.13 required; lower versions will throw ERR_UNSUPPORTED_NODE_VERSION.
fix
Upgrade Node.js to v22.13 or later.
affects: <0.1.0
gotchaRead-only operations: no write commands are supported; attempting to INSERT/UPDATE/DELETE will be rejected at database level.
fix
Use only SELECT queries; the tool is designed for analytics, not data modification.
affects: >=0.1.0
gotchaAI Skill requires an OpenAI API key set via OPENAI_API_KEY environment variable; missing key will cause 401 errors.
fix
Set OPENAI_API_KEY in your environment before using the Skill.
affects: >=0.1.0
deprecatedThe 'analytics' command is deprecated and will be removed in v0.2.0, replaced by the 'analyze' command.
fix
Use 'opscale analyze' instead of 'opscale analytics'.
affects: >=0.1.0 <0.2.0
gotchaDo not run opscale with root privileges; it may expose database credentials in process lists.
fix
Run as a dedicated non-root user.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'opscale'
Attempting to require('opscale') in a CommonJS environment when the package is ESM-only.
fix
Use dynamic import: await import('opscale') or switch to ESM.
Error: Command not found: opscale
Running opscale directly without npx or global installation.
fix
Use 'npx opscale' instead of just 'opscale'.
Error: OpenAI API key not provided
Missing OPENAI_API_KEY environment variable when using AI Skill.
fix
Set OPENAI_API_KEY=your_key_here before running the tool.
Error: Unsupported Node.js version
Node.js version is less than 22.13.
fix
Upgrade Node.js to v22.13 or later.
Upgrade
Version history
0.1.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
opscale — npm install opscale · libregistry