{"id":17284,"library":"lmnr-cli","title":"Laminar AI CLI for Observability","description":"lmnr-cli is the command-line interface tool for interacting with the Laminar AI observability platform. It allows developers to debug AI agent rollouts, run SQL queries against project data (spans, traces, events), and manage datasets (list, push, pull, create). While the core Laminar TypeScript SDK (`@lmnr-ai/lmnr`) is at version 0.8.20 (as of recent changelogs), the `lmnr-cli` itself is currently at version 0.1.9, with new features and dependency bumps frequently integrated from the monorepo. Laminar is an open-source platform designed to help developers build and monitor reliable AI agents by providing tools for tracing, evaluating, and analyzing AI agent performance. Its key differentiators include comprehensive tracing of AI agents compatible with popular LLM frameworks, tools for creating and running evaluations, and a built-in SQL editor for data analysis.","status":"active","version":"0.1.9","language":"javascript","source_language":"en","source_url":"https://github.com/lmnr-ai/lmnr-ts","tags":["javascript","laminar","lmnr","cli","debugger"],"install":[{"cmd":"npm install lmnr-cli","lang":"bash","label":"npm"},{"cmd":"yarn add lmnr-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add lmnr-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"The CLI interacts with the core Laminar AI functionalities provided by this SDK for tracing, evaluation, and data management.","package":"@lmnr-ai/lmnr","optional":false}],"imports":[{"note":"This package is a command-line interface tool. Its functionality is accessed by executing commands in the shell, typically via `npx` for temporary use or after global installation.","symbol":"lmnr-cli","correct":"npx lmnr-cli@latest <command>"},{"note":"For repeated use, globally installing `lmnr-cli` allows direct execution without `npx`. Attempting to `import` this package as a standard JavaScript/TypeScript library for programmatic use will result in an error as it does not export a public API in this manner.","wrong":"import { lmnrCli } from 'lmnr-cli';","symbol":"lmnr-cli","correct":"npm install -g lmnr-cli\nlmnr-cli <command>"},{"note":"Many `lmnr-cli` commands require authentication via a Laminar Project API Key. This can be provided as an environment variable or via the `--project-api-key` flag.","wrong":"lmnr-cli sql schema","symbol":"LMNR_PROJECT_API_KEY (environment variable)","correct":"export LMNR_PROJECT_API_KEY='your_api_key'\nlmnr-cli sql schema"}],"quickstart":{"code":"import { exec } from 'child_process';\n\nconst projectApiKey = process.env.LMNR_PROJECT_API_KEY ?? '';\n\nif (!projectApiKey) {\n  console.error('Error: LMNR_PROJECT_API_KEY environment variable is not set.');\n  process.exit(1);\n}\n\n// Example: Run a SQL query against Laminar project data and output as JSON\nconst command = `npx lmnr-cli@latest sql query \"SELECT * FROM spans LIMIT 5\" --json --project-api-key ${projectApiKey}`;\n\nexec(command, (error, stdout, stderr) => {\n  if (error) {\n    console.error(`exec error: ${error}`);\n    return;\n  }\n  if (stderr) {\n    console.error(`stderr: ${stderr}`);\n    return;\n  }\n  console.log(`Query results:\\n${stdout}`);\n  try {\n    const results = JSON.parse(stdout);\n    console.log(`Parsed ${results.length} records.`);\n  } catch (parseError) {\n    console.error(`Failed to parse JSON output: ${parseError}`);\n  }\n});","lang":"typescript","description":"Demonstrates how to programmatically execute `lmnr-cli` to run a SQL query against Laminar data and process its JSON output."},"warnings":[{"fix":"Review the official Laminar documentation for updated recommendations on agent frameworks and integrations. If previously using `llamaindex` indirectly through Laminar, identify and migrate to supported alternatives or direct OpenTelemetry instrumentation.","message":"The monorepo containing `lmnr-cli` recently deprecated `llamaindex` support and migrated to TypeScript 6. While this specifically affects the core `@lmnr-ai/lmnr` SDK, users of `lmnr-cli` relying on features that previously leveraged `llamaindex` integrations might experience breaking changes or need to update their workflows to alternative methods.","severity":"breaking","affected_versions":">=0.8.18 (monorepo), potential impact on lmnr-cli from v0.1.8"},{"fix":"Always refer to the `lmnr-cli` section of the monorepo's changelog or `npm` page for CLI-specific updates. Use `npx lmnr-cli -v` to confirm your installed CLI version.","message":"The `lmnr-cli` and the core `@lmnr-ai/lmnr` library exist within a monorepo, meaning their version numbers often diverge. The `lmnr-cli` itself has its own versioning (e.g., 0.1.9) which may be less frequent than the core library (e.g., 0.8.20). Ensure you are checking the changelog specifically for `lmnr-cli` when looking for updates relevant to CLI commands.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Consult the updated CLI documentation for `sql` and `dataset` commands to ensure your scripts use the latest syntax and arguments. Test existing automation after upgrading the CLI.","message":"Several features of `lmnr-cli`, such as dataset management and the SQL tool, have undergone refactoring and new feature introductions (e.g., `refactor: datasets to lmnr cli`, `feat/cli sql tool`, `feat: cli-table3 for table rendering`). This means scripts relying on older command syntax or output formats for these features may break.","severity":"breaking","affected_versions":">=0.1.7"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Set the `LMNR_PROJECT_API_KEY` environment variable (e.g., `export LMNR_PROJECT_API_KEY='your_key'`) or pass it directly using the `--project-api-key` flag (e.g., `lmnr-cli sql schema --project-api-key 'your_key'`).","cause":"The CLI could not find the Laminar Project API Key, which is necessary for authenticating with the Laminar platform.","error":"Error: LMNR_PROJECT_API_KEY environment variable or --project-api-key option is required."},{"fix":"Verify the command name against the `lmnr-cli` documentation or run `lmnr-cli --help` to see the list of available commands (e.g., `sql`, `dev`, `dataset`).","cause":"A command was entered that `lmnr-cli` does not recognize, likely due to a typo or an attempt to use a non-existent command.","error":"Unknown command \"mycommand\". Did you mean sql, dev, dataset?"},{"fix":"Ensure Node.js and npm are correctly installed on your system. If they are, you might need to reinstall npm or check your system's PATH configuration. `npx` is available with npm version 5.2.0 and higher.","cause":"`npx` is not installed or not in your system's PATH. It is typically bundled with `npm` (Node Package Manager).","error":"npx: command not found"}],"ecosystem":"npm","meta_description":null}