Laminar AI CLI for Observability

0.1.9 · active · verified Wed Apr 22

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.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to programmatically execute `lmnr-cli` to run a SQL query against Laminar data and process its JSON output.

import { exec } from 'child_process';

const projectApiKey = process.env.LMNR_PROJECT_API_KEY ?? '';

if (!projectApiKey) {
  console.error('Error: LMNR_PROJECT_API_KEY environment variable is not set.');
  process.exit(1);
}

// Example: Run a SQL query against Laminar project data and output as JSON
const command = `npx lmnr-cli@latest sql query "SELECT * FROM spans LIMIT 5" --json --project-api-key ${projectApiKey}`;

exec(command, (error, stdout, stderr) => {
  if (error) {
    console.error(`exec error: ${error}`);
    return;
  }
  if (stderr) {
    console.error(`stderr: ${stderr}`);
    return;
  }
  console.log(`Query results:\n${stdout}`);
  try {
    const results = JSON.parse(stdout);
    console.log(`Parsed ${results.length} records.`);
  } catch (parseError) {
    console.error(`Failed to parse JSON output: ${parseError}`);
  }
});

view raw JSON →