onlymetrix 0.1.0
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.
- package/README.md +44 -0
- package/install.js +80 -0
- package/package.json +22 -0
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# OnlyMetrix
|
|
2
|
+
|
|
3
|
+
Deterministic data access for AI agents.
|
|
4
|
+
|
|
5
|
+
Your data team defines metrics. Your agents just select them. No SQL generation. No hallucinations.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx onlymetrix
|
|
11
|
+
# or
|
|
12
|
+
npm install -g onlymetrix
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## What's included
|
|
16
|
+
|
|
17
|
+
- **`onlymetrix`** — MCP server for AI agents
|
|
18
|
+
- **`omx`** — CLI for setup, metrics management, and queries
|
|
19
|
+
|
|
20
|
+
## Quick start
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Set up with a YAML file
|
|
24
|
+
omx init setup.yaml
|
|
25
|
+
|
|
26
|
+
# Or interactive setup
|
|
27
|
+
omx init
|
|
28
|
+
|
|
29
|
+
# Search metrics
|
|
30
|
+
omx search "what's our revenue"
|
|
31
|
+
|
|
32
|
+
# Query a metric
|
|
33
|
+
omx query total_revenue
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Documentation
|
|
37
|
+
|
|
38
|
+
https://onlymetrix.com/docs
|
|
39
|
+
|
|
40
|
+
## Supported warehouses
|
|
41
|
+
|
|
42
|
+
- Snowflake
|
|
43
|
+
- PostgreSQL
|
|
44
|
+
- ClickHouse
|
package/install.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { execSync } = require("child_process");
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const https = require("https");
|
|
6
|
+
const http = require("http");
|
|
7
|
+
|
|
8
|
+
const VERSION = "0.1.0";
|
|
9
|
+
const REPO = "dreynow/onlymetrix";
|
|
10
|
+
|
|
11
|
+
const PLATFORM_MAP = {
|
|
12
|
+
"linux-x64": "onlymetrix-linux-x64.tar.gz",
|
|
13
|
+
"linux-arm64": "onlymetrix-linux-arm64.tar.gz",
|
|
14
|
+
"darwin-x64": "onlymetrix-darwin-x64.tar.gz",
|
|
15
|
+
"darwin-arm64": "onlymetrix-darwin-arm64.tar.gz",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const platform = `${process.platform}-${process.arch}`;
|
|
19
|
+
const archive = PLATFORM_MAP[platform];
|
|
20
|
+
|
|
21
|
+
if (!archive) {
|
|
22
|
+
console.error(`Unsupported platform: ${platform}`);
|
|
23
|
+
console.error("Supported: linux-x64, linux-arm64, darwin-x64, darwin-arm64");
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${archive}`;
|
|
28
|
+
const binDir = path.join(__dirname, "bin");
|
|
29
|
+
const tarPath = path.join(__dirname, archive);
|
|
30
|
+
|
|
31
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
32
|
+
|
|
33
|
+
function download(url, dest) {
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
35
|
+
const get = url.startsWith("https") ? https.get : http.get;
|
|
36
|
+
get(url, (res) => {
|
|
37
|
+
if (res.statusCode === 302 || res.statusCode === 301) {
|
|
38
|
+
return download(res.headers.location, dest).then(resolve).catch(reject);
|
|
39
|
+
}
|
|
40
|
+
if (res.statusCode !== 200) {
|
|
41
|
+
return reject(new Error(`Download failed: HTTP ${res.statusCode} from ${url}`));
|
|
42
|
+
}
|
|
43
|
+
const file = fs.createWriteStream(dest);
|
|
44
|
+
res.pipe(file);
|
|
45
|
+
file.on("finish", () => { file.close(); resolve(); });
|
|
46
|
+
file.on("error", reject);
|
|
47
|
+
}).on("error", reject);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function main() {
|
|
52
|
+
console.log(`Downloading OnlyMetrix v${VERSION} for ${platform}...`);
|
|
53
|
+
try {
|
|
54
|
+
await download(url, tarPath);
|
|
55
|
+
execSync(`tar xzf ${tarPath} -C ${binDir}`, { stdio: "inherit" });
|
|
56
|
+
fs.unlinkSync(tarPath);
|
|
57
|
+
|
|
58
|
+
// Make binaries executable
|
|
59
|
+
const bins = ["dataquery-mcp", "omx"];
|
|
60
|
+
for (const bin of bins) {
|
|
61
|
+
const binPath = path.join(binDir, bin);
|
|
62
|
+
if (fs.existsSync(binPath)) {
|
|
63
|
+
fs.chmodSync(binPath, 0o755);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Create onlymetrix wrapper that runs dataquery-mcp
|
|
68
|
+
const wrapperPath = path.join(binDir, "onlymetrix");
|
|
69
|
+
fs.writeFileSync(wrapperPath, `#!/bin/sh\nexec "${path.join(binDir, "dataquery-mcp")}" "$@"\n`);
|
|
70
|
+
fs.chmodSync(wrapperPath, 0o755);
|
|
71
|
+
|
|
72
|
+
console.log("OnlyMetrix installed successfully.");
|
|
73
|
+
} catch (err) {
|
|
74
|
+
console.error("Installation failed:", err.message);
|
|
75
|
+
console.error(`\nYou can install manually:\n curl -L ${url} | tar xz -C /usr/local/bin`);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "onlymetrix",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Deterministic data access for AI agents. MCP server and CLI.",
|
|
5
|
+
"keywords": ["mcp", "metrics", "ai", "agents", "data", "snowflake", "postgres", "clickhouse", "semantic-layer"],
|
|
6
|
+
"homepage": "https://onlymetrix.com",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dreynow/onlymetrix"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "Drey <drey@kanoniv.com>",
|
|
13
|
+
"bin": {
|
|
14
|
+
"onlymetrix": "./bin/onlymetrix",
|
|
15
|
+
"omx": "./bin/omx"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"postinstall": "node install.js"
|
|
19
|
+
},
|
|
20
|
+
"os": ["linux", "darwin"],
|
|
21
|
+
"cpu": ["x64", "arm64"]
|
|
22
|
+
}
|