@runcontext/cli 0.4.0 → 0.4.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 +38 -74
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,102 +1,66 @@
|
|
|
1
1
|
# @runcontext/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**ContextKit — tell your AI agent to build your semantic layer.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Tell your AI agent: *"Install @runcontext/cli and build a semantic layer for my database."*
|
|
6
|
+
|
|
7
|
+
The agent introspects your database, scaffolds metadata, and goes back and forth with you — asking about metrics, ownership, and business rules — while it builds the semantic layer using CLI commands. When it reaches Gold tier, it exports an **AI Blueprint** and serves the metadata to other AI agents via MCP.
|
|
6
8
|
|
|
7
9
|
## Installation
|
|
8
10
|
|
|
9
11
|
```bash
|
|
10
|
-
|
|
11
|
-
npm install -g @runcontext/cli
|
|
12
|
-
|
|
13
|
-
# Or per-project
|
|
14
|
-
npm install -D @runcontext/cli
|
|
12
|
+
npm install @runcontext/cli
|
|
15
13
|
```
|
|
16
14
|
|
|
17
15
|
## Quick Start
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
# Point at any database — interactive wizard does the rest
|
|
21
|
-
context setup
|
|
22
|
-
|
|
23
|
-
# Or step by step
|
|
24
|
-
context introspect --db duckdb://warehouse.duckdb
|
|
25
|
-
context enrich --target silver --apply
|
|
26
|
-
context tier
|
|
27
|
-
```
|
|
17
|
+
In Claude Code, Cursor, Windsurf, or any agentic coding platform:
|
|
28
18
|
|
|
29
|
-
|
|
19
|
+
> *"Install @runcontext/cli and build a semantic layer for my database."*
|
|
30
20
|
|
|
31
|
-
|
|
21
|
+
Or run it yourself:
|
|
32
22
|
|
|
33
23
|
```bash
|
|
34
|
-
context setup
|
|
35
|
-
context
|
|
36
|
-
context
|
|
37
|
-
context
|
|
38
|
-
context fix --write # Auto-fix lint issues where possible
|
|
39
|
-
context build # Compile context files → emit manifest JSON
|
|
40
|
-
context tier [model] # Show Bronze/Silver/Gold scorecard
|
|
24
|
+
context setup # Interactive wizard — database to metadata in one flow
|
|
25
|
+
context tier # Check Bronze/Silver/Gold score
|
|
26
|
+
context blueprint # Export AI Blueprint (portable Gold-tier spec)
|
|
27
|
+
context serve --stdio # Serve to AI agents via MCP
|
|
41
28
|
```
|
|
42
29
|
|
|
43
|
-
|
|
30
|
+
## Commands
|
|
44
31
|
|
|
45
32
|
```bash
|
|
46
|
-
|
|
47
|
-
context
|
|
48
|
-
context
|
|
49
|
-
context
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
33
|
+
# Build the semantic layer
|
|
34
|
+
context setup # Interactive wizard — full pipeline in one flow
|
|
35
|
+
context new <name> # Scaffold a new data product
|
|
36
|
+
context introspect # Scan a database -> scaffold Bronze metadata
|
|
37
|
+
context enrich --target silver # Auto-enrich toward a target tier
|
|
38
|
+
context lint # Run 40 lint rules
|
|
39
|
+
context fix --write # Auto-fix lint issues
|
|
40
|
+
context build # Compile -> emit manifest JSON
|
|
41
|
+
context tier [model] # Show Bronze/Silver/Gold scorecard
|
|
53
42
|
|
|
54
|
-
|
|
55
|
-
context
|
|
56
|
-
context
|
|
57
|
-
context
|
|
58
|
-
context
|
|
59
|
-
|
|
43
|
+
# Explore and verify
|
|
44
|
+
context explain <name> # Look up any model, term, or owner
|
|
45
|
+
context rules # List all lint rules
|
|
46
|
+
context validate-osi <file> # Validate against OSI spec
|
|
47
|
+
context verify # Check accuracy against a live database
|
|
48
|
+
|
|
49
|
+
# Export and serve
|
|
50
|
+
context blueprint [model] # Export AI Blueprints (portable OSI YAML)
|
|
51
|
+
context serve --stdio # MCP server over stdio
|
|
52
|
+
context serve --http --port 3000 # MCP server over HTTP
|
|
53
|
+
context site # Static documentation site
|
|
54
|
+
context dev --studio # Visual editor in the browser
|
|
55
|
+
context init # Scaffold a new project
|
|
60
56
|
```
|
|
61
57
|
|
|
62
|
-
## The Tier System
|
|
63
|
-
|
|
64
|
-
| Tier | What it means | How to get there |
|
|
65
|
-
|---|---|---|
|
|
66
|
-
| **Bronze** | Discoverable — described, owned, classified | `context introspect` |
|
|
67
|
-
| **Silver** | Trusted — lineage, glossary, sample values, trust status | `context enrich --target silver` |
|
|
68
|
-
| **Gold** | AI-Ready — semantic roles, golden queries, guardrails, business rules | Human curation + `context enrich --target gold` |
|
|
69
|
-
|
|
70
58
|
## Database Support
|
|
71
59
|
|
|
72
|
-
|
|
73
|
-
|---|---|
|
|
74
|
-
| DuckDB | `--db duckdb://path.duckdb` |
|
|
75
|
-
| PostgreSQL | `--db postgres://user:pass@host:5432/db` |
|
|
76
|
-
| MySQL | `--db mysql://user:pass@host:3306/db` |
|
|
77
|
-
| SQL Server | `--db mssql://user:pass@host:1433/db` |
|
|
78
|
-
| SQLite | `--db path/to/file.sqlite` |
|
|
79
|
-
| Snowflake | `--db snowflake://account/database/schema` |
|
|
80
|
-
| BigQuery | `--db bigquery://project/dataset` |
|
|
81
|
-
| ClickHouse | `--db clickhouse://host:8123` |
|
|
82
|
-
| Databricks | Config file only |
|
|
83
|
-
|
|
84
|
-
Each adapter requires its own driver as an optional peer dependency. See [Database Support docs](https://contextkit.dev/reference/databases/) for installation details.
|
|
60
|
+
DuckDB, PostgreSQL, MySQL, SQL Server, SQLite, Snowflake, BigQuery, ClickHouse, Databricks.
|
|
85
61
|
|
|
86
62
|
## MCP Server
|
|
87
63
|
|
|
88
|
-
Expose your metadata to AI agents:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
# For Claude Code / Cursor
|
|
92
|
-
context serve --stdio
|
|
93
|
-
|
|
94
|
-
# For multi-agent setups
|
|
95
|
-
context serve --http --port 3000
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Add to `.claude/mcp.json`:
|
|
99
|
-
|
|
100
64
|
```json
|
|
101
65
|
{
|
|
102
66
|
"mcpServers": {
|
|
@@ -108,9 +72,9 @@ Add to `.claude/mcp.json`:
|
|
|
108
72
|
}
|
|
109
73
|
```
|
|
110
74
|
|
|
111
|
-
##
|
|
75
|
+
## Documentation
|
|
112
76
|
|
|
113
|
-
|
|
77
|
+
[contextkit.dev](https://contextkit.dev) | [GitHub](https://github.com/erickittelson/ContextKit)
|
|
114
78
|
|
|
115
79
|
## License
|
|
116
80
|
|
package/dist/index.js
CHANGED
|
@@ -141,7 +141,7 @@ function formatSarif(diagnostics) {
|
|
|
141
141
|
tool: {
|
|
142
142
|
driver: {
|
|
143
143
|
name: "ContextKit",
|
|
144
|
-
version: "0.4.
|
|
144
|
+
version: "0.4.1",
|
|
145
145
|
informationUri: "https://github.com/erickittelson/ContextKit",
|
|
146
146
|
rules: Array.from(ruleMap.values())
|
|
147
147
|
}
|
|
@@ -579,9 +579,9 @@ function parseDbUrl(db) {
|
|
|
579
579
|
`Cannot determine adapter from "${db}". Use a URL prefix (duckdb://, postgres://, mysql://, mssql://, clickhouse://, snowflake://, bigquery://) or a recognized file extension (.duckdb, .db, .sqlite, .sqlite3).`
|
|
580
580
|
);
|
|
581
581
|
}
|
|
582
|
-
var introspectCommand = new Command5("introspect").description("Introspect a database and scaffold Bronze-level OSI metadata").option(
|
|
582
|
+
var introspectCommand = new Command5("introspect").description("Introspect a database and scaffold Bronze-level OSI metadata. Supports: duckdb://, postgres://, mysql://, mssql://, snowflake://, bigquery://, clickhouse://, .sqlite, .duckdb files, and Databricks (via config).").option(
|
|
583
583
|
"--db <url>",
|
|
584
|
-
"Database URL (
|
|
584
|
+
"Database URL (duckdb://path.duckdb, postgres://user:pass@host/db, mysql://..., mssql://..., snowflake://account/db/schema, bigquery://project/dataset, clickhouse://host, or file.sqlite)"
|
|
585
585
|
).option(
|
|
586
586
|
"--source <name>",
|
|
587
587
|
"Use a named data_source from contextkit.config.yaml"
|
|
@@ -3638,7 +3638,7 @@ async function runAgentInstructionsStep(ctx) {
|
|
|
3638
3638
|
}
|
|
3639
3639
|
|
|
3640
3640
|
// src/commands/setup.ts
|
|
3641
|
-
var setupCommand = new Command15("setup").description("Interactive wizard
|
|
3641
|
+
var setupCommand = new Command15("setup").description("Interactive wizard \u2014 detects databases, introspects schema, scaffolds metadata, enriches to Silver, generates agent instructions. Supports DuckDB, PostgreSQL, MySQL, SQL Server, SQLite, Snowflake, BigQuery, ClickHouse, and Databricks.").action(async () => {
|
|
3642
3642
|
p10.intro(chalk16.bgCyan(chalk16.black(" ContextKit Setup ")));
|
|
3643
3643
|
const ctx = await runConnectStep();
|
|
3644
3644
|
if (!ctx) return;
|
|
@@ -4131,7 +4131,7 @@ var newCommand = new Command17("new").description("Scaffold a new data product i
|
|
|
4131
4131
|
|
|
4132
4132
|
// src/index.ts
|
|
4133
4133
|
var program = new Command18();
|
|
4134
|
-
program.name("context").description("ContextKit \u2014 AI-ready metadata governance over OSI").version("0.4.
|
|
4134
|
+
program.name("context").description("ContextKit \u2014 AI-ready metadata governance over OSI").version("0.4.1");
|
|
4135
4135
|
program.addCommand(lintCommand);
|
|
4136
4136
|
program.addCommand(buildCommand);
|
|
4137
4137
|
program.addCommand(tierCommand);
|