{"id":43513,"library":"opscale","title":"opscale","description":"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.","status":"active","version":"0.1.4","language":"javascript","source_language":"en","source_url":"https://github.com/Tsukikage7/opscale","tags":["javascript","opscale","cli","sql","database","analytics","ai"],"install":[{"cmd":"npm install opscale","lang":"bash","label":"npm"},{"cmd":"yarn add opscale","lang":"bash","label":"yarn"},{"cmd":"pnpm add opscale","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Use npx since it's a CLI tool; global install is not recommended.","wrong":"opscale <command>","symbol":"cli","correct":"npx opscale <command>"},{"note":"Package is ESM-only; CommonJS require will fail. Use dynamic import if needed.","wrong":"const { Skill } = require('opscale')","symbol":"Skill","correct":"import { Skill } from 'opscale'"},{"note":"TypeScript users should import the type explicitly for database configuration.","wrong":"","symbol":"DatabaseConfig","correct":"import type { DatabaseConfig } from 'opscale'"}],"quickstart":{"code":"// Install and run the CLI\nnpx opscale --help\n\n// Analyze database\nnpx opscale analyze \\\n  --host localhost \\\n  --port 5432 \\\n  --user admin \\\n  --password ${DB_PASSWORD}\n\n// Programmatic usage with AI Skill\nimport { Skill } from 'opscale'\n\nconst skill = new Skill({\n  database: 'postgresql',\n  connection: {\n    host: process.env.DB_HOST ?? 'localhost',\n    port: 5432,\n    user: process.env.DB_USER ?? 'admin',\n    password: process.env.DB_PASSWORD ?? ''\n  }\n})\n\nconst result = await skill.query('Show me the slowest queries today')\nconsole.log(result)","lang":"typescript","description":"Demonstrates two usage modes: CLI for ad-hoc analysis and programmatic AI Skill for natural language queries."},"warnings":[{"fix":"Upgrade Node.js to v22.13 or later.","message":"Node.js >=22.13 required; lower versions will throw ERR_UNSUPPORTED_NODE_VERSION.","severity":"breaking","affected_versions":"<0.1.0"},{"fix":"Use only SELECT queries; the tool is designed for analytics, not data modification.","message":"Read-only operations: no write commands are supported; attempting to INSERT/UPDATE/DELETE will be rejected at database level.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Set OPENAI_API_KEY in your environment before using the Skill.","message":"AI Skill requires an OpenAI API key set via OPENAI_API_KEY environment variable; missing key will cause 401 errors.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use 'opscale analyze' instead of 'opscale analytics'.","message":"The 'analytics' command is deprecated and will be removed in v0.2.0, replaced by the 'analyze' command.","severity":"deprecated","affected_versions":">=0.1.0 <0.2.0"},{"fix":"Run as a dedicated non-root user.","message":"Do not run opscale with root privileges; it may expose database credentials in process lists.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.1.4':19 'ai':12,37,62,91,99 'ai-pow':36 'analyt':9,84,98 'analyz':44 'assist':92 'built':88 'cadenc':26 'cli':10,95 'client':80 'command':31 'command-lin':30 'compar':76 'current':17 'databas':16,45,75,97 'differenti':52 'earli':22 'focus':55 'generic':78 'includ':53 'insight':89 'integr':61 'interfac':33 'javascript':93 'key':51 'languag':40,67 'line':32 'metric':47 'month':25 'multipl':73 'natur':39,66 'natural-language-to-sql':65 'op':83 'oper':8,46 'opscal':1,2,94 'permiss':50 'power':38 'pre':87 'pre-built':86 'provid':28 'queri':41 'read':6,58 'read-on':5,57 'releas':23 'safeti':60 'skill':13,42,63 'sql':15,69,74,79,96 'support':71 'target':82 'version':18 'without':48 'write':49","created_at":"2026-06-05T17:00:09.538598+00:00","updated_at":"2026-06-05T17:00:09.538598+00:00","problems":[{"fix":"Use dynamic import: await import('opscale') or switch to ESM.","cause":"Attempting to require('opscale') in a CommonJS environment when the package is ESM-only.","error":"Error: Cannot find module 'opscale'"},{"fix":"Use 'npx opscale' instead of just 'opscale'.","cause":"Running opscale directly without npx or global installation.","error":"Error: Command not found: opscale"},{"fix":"Set OPENAI_API_KEY=your_key_here before running the tool.","cause":"Missing OPENAI_API_KEY environment variable when using AI Skill.","error":"Error: OpenAI API key not provided"},{"fix":"Upgrade Node.js to v22.13 or later.","cause":"Node.js version is less than 22.13.","error":"Error: Unsupported Node.js version"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Tsukikage7/opscale#readme","github":"https://github.com/Tsukikage7/opscale","docs":null,"changelog":null,"pypi":null,"npm":"opscale","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}