metergraph-cli 0.2.0-preview.6 → 0.2.1
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# metergraph-cli
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/metergraph-cli)
|
|
4
4
|
[](https://github.com/metergraph/cli/actions/workflows/ci.yml)
|
|
5
5
|
[](https://github.com/metergraph/cli/blob/main/LICENSE)
|
|
6
6
|
|
|
@@ -13,11 +13,10 @@ token and route metadata back. Every command has stable `--json` output and exit
|
|
|
13
13
|
so agents can run it as well as people.
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
npx --yes metergraph-cli@
|
|
16
|
+
npx --yes metergraph-cli@latest --help
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
only `doctor` and `skill`. See the [changelog](https://github.com/metergraph/cli/blob/main/CHANGELOG.md).
|
|
19
|
+
Published on npm as `latest`. See the [changelog](https://github.com/metergraph/cli/blob/main/CHANGELOG.md).
|
|
21
20
|
|
|
22
21
|
## Quickstart
|
|
23
22
|
|
|
@@ -27,7 +26,7 @@ writes `METERGRAPH_APP_TOKEN` and `METERGRAPH_INGEST_URL` to a private `.env`, a
|
|
|
27
26
|
installs the skill for your coding agent.
|
|
28
27
|
|
|
29
28
|
```sh
|
|
30
|
-
npx --yes metergraph-cli@
|
|
29
|
+
npx --yes metergraph-cli@latest setup --runtime local --client claude
|
|
31
30
|
```
|
|
32
31
|
|
|
33
32
|
Use `--client codex` or `--client cursor` for the other agents.
|
|
@@ -40,20 +39,20 @@ ID or request ID and when the call started and ended.
|
|
|
40
39
|
exact trace is visible in your workspace.
|
|
41
40
|
|
|
42
41
|
```sh
|
|
43
|
-
npx --yes metergraph-cli@
|
|
42
|
+
npx --yes metergraph-cli@latest verify --trace-id TRACE_ID \
|
|
44
43
|
--since 2026-01-08T12:00:00Z --until 2026-01-08T12:00:05Z
|
|
45
44
|
```
|
|
46
45
|
|
|
47
46
|
Then read what Metergraph has recorded:
|
|
48
47
|
|
|
49
48
|
```sh
|
|
50
|
-
npx --yes metergraph-cli@
|
|
51
|
-
npx --yes metergraph-cli@
|
|
49
|
+
npx --yes metergraph-cli@latest usage --days 7 # calls, errors, cost and tokens per route per day
|
|
50
|
+
npx --yes metergraph-cli@latest traces --limit 20 # one page of trace metadata
|
|
52
51
|
```
|
|
53
52
|
|
|
54
|
-
To install it globally instead, run `npm install -g metergraph-cli@
|
|
55
|
-
`metergraph`. Pin an exact version, such as `metergraph-cli@0.2.
|
|
56
|
-
script must not change with the `next` tag.
|
|
53
|
+
To install it globally instead, run `npm install -g metergraph-cli@latest`. The command is
|
|
54
|
+
`metergraph`. Pin an exact version, such as `metergraph-cli@0.2.1`, when a
|
|
55
|
+
script must not change with the `latest` tag. Previews use the `next` tag.
|
|
57
56
|
|
|
58
57
|
## Requirements
|
|
59
58
|
|
|
@@ -80,7 +79,7 @@ The CLI is built to be run by Codex, Claude Code and Cursor as well as by people
|
|
|
80
79
|
network access:
|
|
81
80
|
|
|
82
81
|
```sh
|
|
83
|
-
npx --yes metergraph-cli@
|
|
82
|
+
npx --yes metergraph-cli@latest skill install --client codex
|
|
84
83
|
```
|
|
85
84
|
|
|
86
85
|
Python users can run `pip install metergraph-skills` and
|
|
@@ -94,7 +93,7 @@ The CLI is built to be run by Codex, Claude Code and Cursor as well as by people
|
|
|
94
93
|
the `metergraph/skills` plugin marketplace instead.
|
|
95
94
|
|
|
96
95
|
```sh
|
|
97
|
-
npx --yes metergraph-cli@
|
|
96
|
+
npx --yes metergraph-cli@latest skills install --client claude
|
|
98
97
|
```
|
|
99
98
|
|
|
100
99
|
`--runtime` defaults to `local`. Pass `--runtime cloud` when the client runs in a
|
|
@@ -121,7 +120,7 @@ The CLI is built to be run by Codex, Claude Code and Cursor as well as by people
|
|
|
121
120
|
Suggested `AGENTS.md` or `CLAUDE.md` lines for a project that uses Metergraph:
|
|
122
121
|
|
|
123
122
|
```md
|
|
124
|
-
- Metergraph CLI: `npx --yes metergraph-cli@
|
|
123
|
+
- Metergraph CLI: `npx --yes metergraph-cli@latest <command> --json`. Check exit codes;
|
|
125
124
|
follow `data.next_action` on failure.
|
|
126
125
|
- After changing instrumented code, run the app once and confirm the trace with
|
|
127
126
|
`metergraph verify` before reporting that tracing works.
|
|
@@ -155,7 +154,7 @@ Exit codes are stable. Changing one is a breaking change. Codes 10 to 18 are not
|
|
|
155
154
|
|
|
156
155
|
| Code | Outcome | Meaning |
|
|
157
156
|
| --- | --- | --- |
|
|
158
|
-
| 0 | `ok` | Command succeeded. `doctor` does not return this in this
|
|
157
|
+
| 0 | `ok` | Command succeeded. `doctor` does not return this in this release. For `skill`, the file is in place; discovery is still pending. |
|
|
159
158
|
| 1 | `internal_error` | Unexpected failure inside the CLI. |
|
|
160
159
|
| 2 | `invalid_input` | Unknown command or argument, or an invalid option value. No request was made. |
|
|
161
160
|
| 3 | `authentication_required` | Service is reachable, healthy and supported, and requires authentication. No workspace is connected. |
|
package/assets/skill/SKILL.md
CHANGED
|
@@ -109,4 +109,4 @@ rather than improvising the analysis steps.
|
|
|
109
109
|
4. Explain the failure or anomaly using only returned evidence. Cite workspace, time window, provenance, trace/report IDs, completeness/coverage, warnings and working app links when returned. Do not fabricate links. Distinguish no data, incomplete evidence, unavailable capability, classification pending, stale/mismatched identity, failed analysis and missing report. An empty result alone does not prove absence of traffic.
|
|
110
110
|
5. An optional approved replay must be eligible, bounded and non-persistent. Do not claim that it changed production telemetry or fixed the application. Refuse autonomous dashboard mutations or production configuration changes.
|
|
111
111
|
|
|
112
|
-
For an empty workspace, use https://www.metergraph.dev/docs/agents/instrument-a-repo/. If `metergraph setup` already ran in this project, it delivered the ingest credential: the project's `.env` holds `METERGRAPH_APP_TOKEN` and `METERGRAPH_INGEST_URL`. Use them; do not ask for or create another key, and never print their values. The SDK reads the process environment, not `.env`, so load it when you run the application (for example `set -a; . ./.env; set +a`, python-dotenv or `node --env-file=.env`). Otherwise confirm the ingestion destination and obtain a separate ingest credential securely. Ask before running anything that calls a paid model provider, and do not initiate provider calls or paid work merely to validate setup. Confirm the exact trace with `metergraph verify`; if the CLI is not installed, or `metergraph --version` lacks `verify`, use `npx --yes metergraph-cli@
|
|
112
|
+
For an empty workspace, use https://www.metergraph.dev/docs/agents/instrument-a-repo/. If `metergraph setup` already ran in this project, it delivered the ingest credential: the project's `.env` holds `METERGRAPH_APP_TOKEN` and `METERGRAPH_INGEST_URL`. Use them; do not ask for or create another key, and never print their values. The SDK reads the process environment, not `.env`, so load it when you run the application (for example `set -a; . ./.env; set +a`, python-dotenv or `node --env-file=.env`). Otherwise confirm the ingestion destination and obtain a separate ingest credential securely. Ask before running anything that calls a paid model provider, and do not initiate provider calls or paid work merely to validate setup. Confirm the exact trace with `metergraph verify`; if the CLI is not installed, or `metergraph --version` lacks `verify`, use `npx --yes metergraph-cli@latest verify`. Ingestion accepted, processed, retained content, classification readiness and analysis readiness are distinct states. Label synthetic/demo fixtures; they do not prove a first real application trace.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "metergraph",
|
|
4
4
|
"file": "SKILL.md",
|
|
5
5
|
"source_url": "https://www.metergraph.dev/SKILL.md",
|
|
6
|
-
"sha256": "
|
|
7
|
-
"size":
|
|
8
|
-
"revision": "sha256-
|
|
6
|
+
"sha256": "d527a67efc42a55245b9c2c8fd2687c1f31f553e154a6242d0f31466993e314e",
|
|
7
|
+
"size": 13666,
|
|
8
|
+
"revision": "sha256-d527a67efc42"
|
|
9
9
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": 1,
|
|
3
3
|
"repository": "metergraph/skills",
|
|
4
|
-
"commit": "
|
|
4
|
+
"commit": "839da0fc82c331598db78022610620390a81703a",
|
|
5
5
|
"skills": [
|
|
6
6
|
{
|
|
7
7
|
"name": "metergraph-analyze",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"name": "metergraph-local-bundle",
|
|
38
|
-
"sha256": "
|
|
39
|
-
"size":
|
|
40
|
-
"revision": "sha256-
|
|
38
|
+
"sha256": "c31286b7ee6dd8fc228e81565662ebaf4b0faf2ae92229602baf7c809202491b",
|
|
39
|
+
"size": 12265,
|
|
40
|
+
"revision": "sha256-c31286b7ee6d"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"name": "metergraph-model-swap",
|
|
@@ -27,8 +27,8 @@ done
|
|
|
27
27
|
|
|
28
28
|
If any is set, or this is otherwise a hosted/cloud runtime, download, verify,
|
|
29
29
|
extract and start nothing. Prefer an installed `metergraph` whose `--help`
|
|
30
|
-
lists `setup`; otherwise state that the fallback fetches the
|
|
31
|
-
use `npx --yes metergraph-cli@
|
|
30
|
+
lists `setup`; otherwise state that the fallback fetches the latest released CLI and
|
|
31
|
+
use `npx --yes metergraph-cli@latest` as the prefix. Run only:
|
|
32
32
|
|
|
33
33
|
```sh
|
|
34
34
|
metergraph setup --runtime cloud --deployment customer-local --url http://localhost:8080 --workspace 11111111-1111-4111-8111-111111111111 --skip-skill --json
|
|
@@ -236,8 +236,8 @@ status JSON's `workspace` check. The service listens only on localhost:8080.
|
|
|
236
236
|
## Run setup
|
|
237
237
|
|
|
238
238
|
Return to the application repository. Prefer installed `metergraph` only when
|
|
239
|
-
its help lists `setup`; otherwise state that `npx --yes metergraph-cli@
|
|
240
|
-
fetches the
|
|
239
|
+
its help lists `setup`; otherwise state that `npx --yes metergraph-cli@latest`
|
|
240
|
+
fetches the latest released CLI and use it as the prefix. Run with `--json`:
|
|
241
241
|
|
|
242
242
|
```sh
|
|
243
243
|
metergraph setup --runtime local --deployment customer-local --url http://localhost:8080 --workspace 11111111-1111-4111-8111-111111111111 --confirm-prerequisites --client <client> --json
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metergraph-cli",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Metergraph command line tool with a read-only connection probe, a project skill installer, Metadata-only sign in and bounded workspace Metadata reads",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"metergraph": "bin/metergraph.js"
|
package/src/skill-bundle.js
CHANGED
|
@@ -5,7 +5,7 @@ import { readFileSync } from "node:fs";
|
|
|
5
5
|
// public skill at the manifest's source_url. The source has no version of its
|
|
6
6
|
// own, so the revision is derived from the content hash. The hash is pinned
|
|
7
7
|
// here as well as in the manifest, so editing either file alone is detected.
|
|
8
|
-
const PINNED_SHA256 = "
|
|
8
|
+
const PINNED_SHA256 = "d527a67efc42a55245b9c2c8fd2687c1f31f553e154a6242d0f31466993e314e";
|
|
9
9
|
|
|
10
10
|
const ASSET_DIR = new URL("../assets/skill/", import.meta.url);
|
|
11
11
|
const MANIFEST_KEYS = ["file", "manifest_version", "name", "revision", "sha256", "size", "source_url"];
|
|
@@ -55,7 +55,7 @@ export function loadBundledSkill() {
|
|
|
55
55
|
// The workflow skills that "skills install" writes, vendored from the public
|
|
56
56
|
// skills repository at one commit. The manifest's own hash is pinned here, and
|
|
57
57
|
// the manifest pins each skill's hash, so changing any file alone is detected.
|
|
58
|
-
const PINNED_PACK_SHA256 = "
|
|
58
|
+
const PINNED_PACK_SHA256 = "c47c8920b633ddd9b52d0855f91361e4e193746a89d6a58f43902af6a38e9617";
|
|
59
59
|
|
|
60
60
|
const PACK_DIR = new URL("../assets/skills/", import.meta.url);
|
|
61
61
|
const PACK_KEYS = ["commit", "manifest_version", "repository", "skills"];
|