syvain-metrics 0.0.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 ADDED
@@ -0,0 +1,48 @@
1
+ # syvain-metrics
2
+
3
+ Command line tools for inspecting [Syvain Metrics](https://metrics.syvain.com/)
4
+ experiments, folders, metric rows, metric metadata, and annotations.
5
+
6
+ ## Install
7
+
8
+ ```sh
9
+ npm install -g syvain-metrics
10
+ ```
11
+
12
+ The package installs the `syvain-metrics` binary.
13
+
14
+ ## Authenticate
15
+
16
+ Create an API key from the Syvain Metrics dashboard, then log in:
17
+
18
+ ```sh
19
+ syvain-metrics auth login
20
+ syvain-metrics auth status --human
21
+ ```
22
+
23
+ For scripts or CI, pass the API key on stdin:
24
+
25
+ ```sh
26
+ printf '%s' "$SYVAIN_METRICS_API_KEY" | syvain-metrics auth login --stdin
27
+ ```
28
+
29
+ By default the CLI talks to `https://metrics.syvain.com`.
30
+
31
+ ## Usage
32
+
33
+ The default output is newline-delimited JSON so commands can be piped into
34
+ automation. Add `--human` for readable tables.
35
+
36
+ ```sh
37
+ syvain-metrics folders list --human
38
+ syvain-metrics folders create --name dendro-mamba
39
+ syvain-metrics experiments list --limit 20 --human
40
+ syvain-metrics experiments get --slug dendro-mamba-run-001
41
+ syvain-metrics experiments metrics --id exp_123 --metric-name train_loss --limit 500
42
+ syvain-metrics experiments catalog --id exp_123
43
+ syvain-metrics experiments catalog-values --id exp_123 --metric train_loss
44
+ syvain-metrics experiments annotate --id exp_123 --annotation "Good validation run"
45
+ ```
46
+
47
+ Run `syvain-metrics --help` or `syvain-metrics <command> --help` for the full
48
+ command list and options.
@@ -0,0 +1,113 @@
1
+ #!/usr/bin/env node
2
+ // Auto-generated by crust build --package -- do not edit
3
+ import { spawn } from "node:child_process";
4
+ import { chmodSync, existsSync } from "node:fs";
5
+ import { dirname, resolve } from "node:path";
6
+ import process from "node:process";
7
+ import { fileURLToPath } from "node:url";
8
+
9
+ const PLATFORMS = {
10
+ "linux-x64": {
11
+ "packagePathSegment": "syvain-metrics-linux-x64",
12
+ "packageName": "syvain-metrics-linux-x64",
13
+ "binaryFilename": "syvain-metrics-bun-linux-x64-baseline"
14
+ },
15
+ "linux-arm64": {
16
+ "packagePathSegment": "syvain-metrics-linux-arm64",
17
+ "packageName": "syvain-metrics-linux-arm64",
18
+ "binaryFilename": "syvain-metrics-bun-linux-arm64"
19
+ },
20
+ "darwin-x64": {
21
+ "packagePathSegment": "syvain-metrics-darwin-x64",
22
+ "packageName": "syvain-metrics-darwin-x64",
23
+ "binaryFilename": "syvain-metrics-bun-darwin-x64"
24
+ },
25
+ "darwin-arm64": {
26
+ "packagePathSegment": "syvain-metrics-darwin-arm64",
27
+ "packageName": "syvain-metrics-darwin-arm64",
28
+ "binaryFilename": "syvain-metrics-bun-darwin-arm64"
29
+ },
30
+ "win32-x64": {
31
+ "packagePathSegment": "syvain-metrics-windows-x64",
32
+ "packageName": "syvain-metrics-windows-x64",
33
+ "binaryFilename": "syvain-metrics-bun-windows-x64-baseline.exe"
34
+ },
35
+ "win32-arm64": {
36
+ "packagePathSegment": "syvain-metrics-windows-arm64",
37
+ "packageName": "syvain-metrics-windows-arm64",
38
+ "binaryFilename": "syvain-metrics-bun-windows-arm64.exe"
39
+ }
40
+ };
41
+ const dir = dirname(fileURLToPath(import.meta.url));
42
+ const platformKey = `${process.platform}-${process.arch}`;
43
+ const target = PLATFORMS[platformKey];
44
+
45
+ if (!target) {
46
+ console.error("[syvain-metrics] Unsupported platform: " + platformKey);
47
+ console.error("[syvain-metrics] Supported platforms: linux-x64, linux-arm64, darwin-x64, darwin-arm64, windows-x64, windows-arm64");
48
+ process.exit(1);
49
+ }
50
+
51
+ const candidateOne = resolve(
52
+ dir,
53
+ "..",
54
+ "..",
55
+ target.packagePathSegment,
56
+ "bin",
57
+ target.binaryFilename,
58
+ );
59
+ const candidateTwo = resolve(
60
+ dir,
61
+ "..",
62
+ "node_modules",
63
+ target.packageName,
64
+ "bin",
65
+ target.binaryFilename,
66
+ );
67
+
68
+ const binPath = existsSync(candidateOne)
69
+ ? candidateOne
70
+ : existsSync(candidateTwo)
71
+ ? candidateTwo
72
+ : null;
73
+
74
+ if (!binPath) {
75
+ console.error("[syvain-metrics] Missing platform package for " + platformKey);
76
+ console.error("[syvain-metrics] Tried:");
77
+ console.error(" " + candidateOne);
78
+ console.error(" " + candidateTwo);
79
+ console.error(
80
+ "[syvain-metrics] Reinstall dependencies on this platform and ensure optional dependencies are enabled.",
81
+ );
82
+ process.exit(1);
83
+ }
84
+
85
+ if (process.platform !== "win32") {
86
+ try {
87
+ chmodSync(binPath, 0o755);
88
+ } catch {
89
+ // Ignore permission adjustment failures and let spawn surface real errors.
90
+ }
91
+ }
92
+
93
+ const child = spawn(binPath, process.argv.slice(2), {
94
+ stdio: "inherit",
95
+ });
96
+
97
+ child.on("error", (error) => {
98
+ console.error("[syvain-metrics] Failed to launch binary: " + error.message);
99
+ process.exit(1);
100
+ });
101
+
102
+ child.on("exit", (code, signal) => {
103
+ if (signal) {
104
+ try {
105
+ process.kill(process.pid, signal);
106
+ } catch {
107
+ process.exit(1);
108
+ }
109
+ return;
110
+ }
111
+
112
+ process.exit(code ?? 0);
113
+ });
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "syvain-metrics",
3
+ "version": "0.0.0",
4
+ "description": "Syvain Metrics command line interface.",
5
+ "type": "module",
6
+ "files": [
7
+ "bin"
8
+ ],
9
+ "bin": {
10
+ "syvain-metrics": "bin/syvain-metrics.js"
11
+ },
12
+ "optionalDependencies": {
13
+ "syvain-metrics-linux-x64": "0.0.0",
14
+ "syvain-metrics-linux-arm64": "0.0.0",
15
+ "syvain-metrics-darwin-x64": "0.0.0",
16
+ "syvain-metrics-darwin-arm64": "0.0.0",
17
+ "syvain-metrics-windows-x64": "0.0.0",
18
+ "syvain-metrics-windows-arm64": "0.0.0"
19
+ }
20
+ }