@graphorin/cli 0.5.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/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +130 -0
- package/dist/bin/graphorin.d.ts +1 -0
- package/dist/bin/graphorin.js +606 -0
- package/dist/bin/graphorin.js.map +1 -0
- package/dist/commands/audit.d.ts +59 -0
- package/dist/commands/audit.d.ts.map +1 -0
- package/dist/commands/audit.js +156 -0
- package/dist/commands/audit.js.map +1 -0
- package/dist/commands/auth.d.ts +48 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +148 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/consolidator.d.ts +49 -0
- package/dist/commands/consolidator.d.ts.map +1 -0
- package/dist/commands/consolidator.js +97 -0
- package/dist/commands/consolidator.js.map +1 -0
- package/dist/commands/doctor.d.ts +64 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +150 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/guard.d.ts +35 -0
- package/dist/commands/guard.d.ts.map +1 -0
- package/dist/commands/guard.js +86 -0
- package/dist/commands/guard.js.map +1 -0
- package/dist/commands/index.d.ts +21 -0
- package/dist/commands/index.js +22 -0
- package/dist/commands/init.d.ts +46 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +131 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/memory.d.ts +243 -0
- package/dist/commands/memory.d.ts.map +1 -0
- package/dist/commands/memory.js +471 -0
- package/dist/commands/memory.js.map +1 -0
- package/dist/commands/migrate-config.d.ts +20 -0
- package/dist/commands/migrate-config.d.ts.map +1 -0
- package/dist/commands/migrate-config.js +48 -0
- package/dist/commands/migrate-config.js.map +1 -0
- package/dist/commands/migrate-export.d.ts +26 -0
- package/dist/commands/migrate-export.d.ts.map +1 -0
- package/dist/commands/migrate-export.js +67 -0
- package/dist/commands/migrate-export.js.map +1 -0
- package/dist/commands/migrate.d.ts +31 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +59 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/pricing.d.ts +66 -0
- package/dist/commands/pricing.d.ts.map +1 -0
- package/dist/commands/pricing.js +128 -0
- package/dist/commands/pricing.js.map +1 -0
- package/dist/commands/secrets.d.ts +96 -0
- package/dist/commands/secrets.d.ts.map +1 -0
- package/dist/commands/secrets.js +182 -0
- package/dist/commands/secrets.js.map +1 -0
- package/dist/commands/skills.d.ts +58 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +181 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/commands/start.d.ts +51 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +122 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/storage.d.ts +110 -0
- package/dist/commands/storage.d.ts.map +1 -0
- package/dist/commands/storage.js +274 -0
- package/dist/commands/storage.js.map +1 -0
- package/dist/commands/telemetry.d.ts +21 -0
- package/dist/commands/telemetry.d.ts.map +1 -0
- package/dist/commands/telemetry.js +75 -0
- package/dist/commands/telemetry.js.map +1 -0
- package/dist/commands/token.d.ts +109 -0
- package/dist/commands/token.d.ts.map +1 -0
- package/dist/commands/token.js +246 -0
- package/dist/commands/token.js.map +1 -0
- package/dist/commands/tools-lint.d.ts +103 -0
- package/dist/commands/tools-lint.d.ts.map +1 -0
- package/dist/commands/tools-lint.js +240 -0
- package/dist/commands/tools-lint.js.map +1 -0
- package/dist/commands/traces.d.ts +33 -0
- package/dist/commands/traces.d.ts.map +1 -0
- package/dist/commands/traces.js +103 -0
- package/dist/commands/traces.js.map +1 -0
- package/dist/commands/triggers.d.ts +49 -0
- package/dist/commands/triggers.d.ts.map +1 -0
- package/dist/commands/triggers.js +129 -0
- package/dist/commands/triggers.js.map +1 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/exit.js +17 -0
- package/dist/internal/exit.js.map +1 -0
- package/dist/internal/load-config.js +84 -0
- package/dist/internal/load-config.js.map +1 -0
- package/dist/internal/offline.d.ts +58 -0
- package/dist/internal/offline.d.ts.map +1 -0
- package/dist/internal/offline.js +72 -0
- package/dist/internal/offline.js.map +1 -0
- package/dist/internal/output.d.ts +56 -0
- package/dist/internal/output.d.ts.map +1 -0
- package/dist/internal/output.js +86 -0
- package/dist/internal/output.js.map +1 -0
- package/dist/internal/prompts.js +49 -0
- package/dist/internal/prompts.js.map +1 -0
- package/dist/internal/store-context.js +69 -0
- package/dist/internal/store-context.js.map +1 -0
- package/package.json +79 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Oleksiy Stepurenko
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# @graphorin/cli
|
|
2
|
+
|
|
3
|
+
> Operator CLI for the [Graphorin](https://github.com/o-stepper/graphorin) framework.
|
|
4
|
+
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
[](https://nodejs.org)
|
|
7
|
+
|
|
8
|
+
- **Version:** v0.5.0
|
|
9
|
+
- **License:** [MIT](./LICENSE) (© 2026 Oleksiy Stepurenko)
|
|
10
|
+
- **Repository:** <https://github.com/o-stepper/graphorin/tree/main/packages/cli>
|
|
11
|
+
- **Issues:** <https://github.com/o-stepper/graphorin/issues>
|
|
12
|
+
|
|
13
|
+
## What ships in v0.1 (Phases 14a + 15)
|
|
14
|
+
|
|
15
|
+
`@graphorin/cli` ships a single global binary, `graphorin`. Commands are grouped by purpose:
|
|
16
|
+
|
|
17
|
+
### Lifecycle (Phase 14a)
|
|
18
|
+
|
|
19
|
+
| Command | Purpose |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `graphorin init` | Generate a fresh `graphorin.config.ts` with documented defaults; mint a one-shot bootstrap admin token + a server pepper (printed to stderr exactly once); choose the cloud-upload sensitivity tier and the storage-encryption opt-in interactively or via flags. |
|
|
22
|
+
| `graphorin migrate` | Apply every pending storage migration against the configured SQLite store (idempotent). |
|
|
23
|
+
| `graphorin migrate-config <input>` | Migrate an old `graphorin.config` file to the current schema. |
|
|
24
|
+
| `graphorin start` | Boot the standalone server with lifecycle hooks + pre-bind validation + storage migrations + audit log + graceful SIGTERM drain. |
|
|
25
|
+
|
|
26
|
+
### Diagnostics (Phase 15)
|
|
27
|
+
|
|
28
|
+
| Command | Purpose |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `graphorin doctor [--all] [--check-*] [--fix-perms]` | Read-only host health check (POSIX file modes + secrets store + audit-encryption + systemd hardening). `--fix-perms` repairs drifted modes. |
|
|
31
|
+
| `graphorin telemetry status / enable / disable / inspect` | Reports the framework's zero-default telemetry policy (DEC-154 / ADR-041). |
|
|
32
|
+
| `graphorin traces status / prune` | Inspect the local trace cache; `prune --before <date>` enforces TTL. |
|
|
33
|
+
| `graphorin guard status / explain <toolName>` | Inspect the memory-modification guard tier policy (DEC-153). |
|
|
34
|
+
|
|
35
|
+
### Auth (Phase 15)
|
|
36
|
+
|
|
37
|
+
| Command | Purpose |
|
|
38
|
+
|---|---|
|
|
39
|
+
| `graphorin token create / list / revoke / rotate / rekey / verify` | Manage server auth tokens (HMAC + pepper, ADR-027). |
|
|
40
|
+
| `graphorin secrets list / get / set / delete / ref / rotate` | Manage secrets in the active store. Honours `--secrets-source` + `--strict-secrets`. |
|
|
41
|
+
| `graphorin auth login / list / refresh / revoke / status` | Outbound OAuth subsystem (e.g. for MCP servers, ADR-033). |
|
|
42
|
+
|
|
43
|
+
### Storage (Phase 15)
|
|
44
|
+
|
|
45
|
+
| Command | Purpose |
|
|
46
|
+
|---|---|
|
|
47
|
+
| `graphorin storage status / encrypt / rekey / cleanup-backups` | Inspect + encrypt + re-key the SQLite store. `encrypt` and `rekey` require the `@graphorin/store-sqlite-encrypted` sub-pack from Phase 16. |
|
|
48
|
+
| `graphorin audit verify / prune / export` | Operate on the encrypted, hash-chained audit log (DEC-124). |
|
|
49
|
+
| `graphorin memory status / migrate` | Inspect counts + active embedder; `migrate` swaps embedders. |
|
|
50
|
+
| `graphorin consolidator status / set-tier / stop` | Inspect + steer the background memory consolidator (DEC-134 / ADR-038). |
|
|
51
|
+
| `graphorin triggers list / status / fire / disable / prune` | Operate on the durable trigger registry (DEC-150). |
|
|
52
|
+
| `graphorin migrate-export <input> --to <file>` | Migrate session-export JSONL between schema versions (DEC-155 / ADR-042). |
|
|
53
|
+
|
|
54
|
+
### Catalogue (Phase 15)
|
|
55
|
+
|
|
56
|
+
| Command | Purpose |
|
|
57
|
+
|---|---|
|
|
58
|
+
| `graphorin pricing status / refresh / diff / lookup / missing` | Operate on the bundled LLM pricing snapshot (DEC-151). |
|
|
59
|
+
| `graphorin skills install / inspect / audit / migrate-frontmatter` | Manage operator-managed skill packages (DEC-140 / ADR-034 + DEC-156 / ADR-043). |
|
|
60
|
+
| `graphorin tools lint [--threshold <n>] [--format <text\|json>]` | Static AST analysis of every `tool({...})` registration with a per-tool grader rubric (40 / 30 / 30 = 100 points). |
|
|
61
|
+
|
|
62
|
+
Every Phase 15 subcommand accepts `--json` so CI pipelines can consume structured output instead of parsing the human report.
|
|
63
|
+
|
|
64
|
+
## Install
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pnpm add -g @graphorin/cli
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The published binary is named `graphorin`.
|
|
71
|
+
|
|
72
|
+
> Other npm-registry-compatible package managers work identically: `npm install -g @graphorin/cli`, `yarn global add @graphorin/cli`, `bun add -g @graphorin/cli`.
|
|
73
|
+
|
|
74
|
+
## Quickstart
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# 1. Generate a config + mint the bootstrap material in the current directory.
|
|
78
|
+
graphorin init --non-interactive --cloud-consent=public-and-internal
|
|
79
|
+
|
|
80
|
+
# 2. Apply storage migrations to the configured SQLite store.
|
|
81
|
+
graphorin migrate --config ./graphorin.config.ts
|
|
82
|
+
|
|
83
|
+
# 3. Boot the standalone server.
|
|
84
|
+
graphorin start --config ./graphorin.config.ts
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`GRAPHORIN_OFFLINE=1` is honoured by every subcommand — the CLI never makes implicit network calls (verified by the repository-wide `pnpm run check-no-network` CI check).
|
|
88
|
+
|
|
89
|
+
## Programmatic usage
|
|
90
|
+
|
|
91
|
+
Every command is exposed as an importable async (or sync, when no I/O is involved) function so CI / IDE / test pipelines can invoke them without spawning a child process:
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
import {
|
|
95
|
+
runDoctor,
|
|
96
|
+
runInit,
|
|
97
|
+
runMigrate,
|
|
98
|
+
runPricingStatus,
|
|
99
|
+
runStart,
|
|
100
|
+
runTokenCreate,
|
|
101
|
+
runToolsLint,
|
|
102
|
+
} from '@graphorin/cli';
|
|
103
|
+
|
|
104
|
+
await runInit({ nonInteractive: true, cloudConsent: 'public-only' });
|
|
105
|
+
await runMigrate({ config: './graphorin.config.ts' });
|
|
106
|
+
|
|
107
|
+
const report = await runDoctor({ all: true, json: true });
|
|
108
|
+
if (report.summary.fail > 0) process.exit(1);
|
|
109
|
+
|
|
110
|
+
const lint = await runToolsLint({ threshold: 60, format: 'json' });
|
|
111
|
+
|
|
112
|
+
await runStart({ config: './graphorin.config.ts', port: 8090 });
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Distribution templates
|
|
116
|
+
|
|
117
|
+
Phase 15 ships ready-to-copy templates for production deployments:
|
|
118
|
+
|
|
119
|
+
- `examples/systemd/graphorin.service` — hardened systemd unit (refuse-as-root, `UMask=0077`, `ProtectSystem=strict`, `NoNewPrivileges=true`).
|
|
120
|
+
- `examples/docker/Dockerfile` — multi-stage Node 22-slim image with a non-root user (UID 10001), read-only rootfs friendly, `--cap-drop=ALL` ready.
|
|
121
|
+
- `examples/k8s/deployment.yaml` — Pod-Security-Standards "restricted" profile with `runAsNonRoot`, `seccompProfile: RuntimeDefault`, projected secret mounts.
|
|
122
|
+
- `examples/github-actions/{security.yml,release.yml,renovate.json,audit-ignore.json}` — supply-chain workflows (`pnpm audit`, Sigstore provenance verification, Changesets-driven releases).
|
|
123
|
+
|
|
124
|
+
## Status
|
|
125
|
+
|
|
126
|
+
`@graphorin/cli` is part of the Graphorin framework's `v0.5.0` pre-release. Once published, the package follows the lockstep release cadence shared by every `@graphorin/*` package on the `0.x` line.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
**Project Graphorin** · v0.5.0 · MIT License · © 2026 Oleksiy Stepurenko · <https://github.com/o-stepper/graphorin>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|