@llmops/cli 0.6.10 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +8 -16
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { command, run, string } from "@drizzle-team/brocli";
3
3
  import { logger } from "@llmops/core";
4
- import { createDatabaseFromConnection, detectDatabaseType, getMigrations } from "@llmops/core/db";
4
+ import { getMigrations } from "@llmops/core/db";
5
5
  import { existsSync } from "node:fs";
6
6
  import yoctoSpinner from "yocto-spinner";
7
7
  import chalk from "chalk";
@@ -30,7 +30,7 @@ const getConfig = async ({ cwd, configPath }) => {
30
30
  * 4. If the config file exists, read and parse it.
31
31
  * 5. If not passed, look for default config file locations.
32
32
  * 6. Use zod to validate the existing configuration schema.
33
- * 7. If valid, get the db adapter from the config.
33
+ * 7. If valid, get the telemetry store from the config.
34
34
  */
35
35
  const migrateCommand = command({
36
36
  name: "migrate",
@@ -59,23 +59,15 @@ const migrateCommand = command({
59
59
  logger.error("No valid LLMOps configuration found.");
60
60
  process.exit(1);
61
61
  }
62
- if (!config.database) {
63
- logger.error("No database configuration found.");
64
- process.exit(1);
65
- }
66
- const schema = config.schema ?? "llmops";
67
- const db = await createDatabaseFromConnection(config.database, { schema });
68
- if (!db) {
69
- logger.error("Failed to create database connection.");
70
- process.exit(1);
71
- }
72
- const dbType = detectDatabaseType(config.database);
73
- if (!dbType) {
74
- logger.error("Could not detect database type.");
62
+ const telemetry = config.telemetry;
63
+ const store = Array.isArray(telemetry) ? telemetry[0] : telemetry;
64
+ if (!store || !store._db) {
65
+ logger.error("No telemetry store with database found. Configure pgStore in your config.");
75
66
  process.exit(1);
76
67
  }
68
+ const db = store._db;
77
69
  const spinner = yoctoSpinner({ text: "preparing migration..." }).start();
78
- const { toBeAdded, toBeCreated, runMigrations } = await getMigrations(db, dbType, { schema });
70
+ const { toBeAdded, toBeCreated, runMigrations } = await getMigrations(db, "postgres", { schema: "llmops" });
79
71
  if (!toBeAdded.length && !toBeCreated.length) {
80
72
  spinner.stop();
81
73
  console.log("🚀 No migrations needed.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmops/cli",
3
- "version": "0.6.10",
3
+ "version": "1.0.0-beta.2",
4
4
  "type": "module",
5
5
  "description": "LLMOps CLI - A pluggable LLMOps toolkit for TypeScript teams",
6
6
  "license": "Apache-2.0",
@@ -45,8 +45,8 @@
45
45
  "kysely": "^0.28.8",
46
46
  "prompts": "^2.4.2",
47
47
  "yocto-spinner": "^1.0.0",
48
- "@llmops/core": "^0.6.10",
49
- "@llmops/sdk": "^0.6.10"
48
+ "@llmops/core": "^1.0.0-beta.2",
49
+ "@llmops/sdk": "^1.0.0-beta.2"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/pg": "^8.15.6",