shipgate 2.0.0 → 2.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.
Files changed (3) hide show
  1. package/README.md +302 -245
  2. package/dist/cli.cjs +100828 -63149
  3. package/package.json +68 -58
package/README.md CHANGED
@@ -1,245 +1,302 @@
1
- # Shipgate CLI
2
-
3
- **ShipGate — Stop AI from shipping fake features. Define what your code should do. We enforce it.**
4
-
5
- Command-line interface for ISL (Intent Specification Language).
6
-
7
- ## Installation
8
-
9
- ```bash
10
- # Install globally (recommended)
11
- npm install -g shipgate
12
-
13
- # Or use npx (no installation required)
14
- npx shipgate <command>
15
- ```
16
-
17
- ## Quick Start
18
-
19
- ```bash
20
- # Initialize a new project in the current directory
21
- npx shipgate init
22
-
23
- # Or create a new project directory
24
- npx shipgate init my-project
25
-
26
- # Parse and validate ISL files
27
- npx shipgate check specs/*.isl
28
-
29
- # Generate code from ISL specs
30
- npx shipgate generate --target typescript specs/
31
-
32
- # Verify implementation against spec
33
- npx shipgate verify specs/example.isl --impl ./src
34
-
35
- # Get help
36
- npx shipgate --help
37
- ```
38
-
39
- ## Commands
40
-
41
- ### `shipgate init [name]`
42
-
43
- Initialize a new ISL project with recommended structure.
44
-
45
- ```bash
46
- # Create project in current directory
47
- npx shipgate init
48
-
49
- # Create a new project directory
50
- npx shipgate init my-api
51
- cd my-api
52
- ```
53
-
54
- Creates:
55
- - `isl.config.json` - Project configuration
56
- - `src/` - Directory for ISL specifications (with example `.isl` file)
57
- - `generated/` - Output directory for generated code
58
- - `package.json` - Node.js project file with scripts
59
-
60
- ### `shipgate check <files...>`
61
-
62
- Parse and type-check ISL files.
63
-
64
- ```bash
65
- npx shipgate check specs/*.isl
66
- npx shipgate check --strict specs/
67
- ```
68
-
69
- Options:
70
- - `--strict` - Enable strict mode (all warnings become errors)
71
- - `--format <format>` - Output format (pretty, json, quiet)
72
-
73
- ### `shipgate generate <files...>`
74
-
75
- Generate code from ISL specifications.
76
-
77
- ```bash
78
- # Generate TypeScript
79
- npx shipgate generate --target typescript specs/
80
-
81
- # Generate Python
82
- npx shipgate generate --target python --output src/generated specs/
83
-
84
- # Generate OpenAPI
85
- npx shipgate generate --target openapi specs/api.isl
86
- ```
87
-
88
- Options:
89
- - `--target, -t` - Target language (typescript, python, rust, go, openapi, graphql)
90
- - `--output, -o` - Output directory
91
- - `--config, -c` - Config file path
92
-
93
- ### `shipgate verify <files...>`
94
-
95
- Verify implementation against ISL specifications.
96
-
97
- ```bash
98
- npx shipgate verify specs/critical-flow.isl --impl ./src
99
- ```
100
-
101
- ### `shipgate parse <file>`
102
-
103
- Parse an ISL file and display the AST.
104
-
105
- ```bash
106
- npx shipgate parse specs/example.isl
107
- ```
108
-
109
- ### `shipgate gate <files...>`
110
-
111
- Run the ShipGate (SHIP/NO-SHIP gate) on ISL files.
112
-
113
- ```bash
114
- npx shipgate gate specs/
115
- npx shipgate gate --ci --output json
116
- ```
117
-
118
- ### `shipgate proof badge <bundle-path>`
119
-
120
- Generate a badge (SVG or URL) from a proof bundle for display in README or CI.
121
-
122
- ```bash
123
- # Generate SVG badge
124
- npx shipgate proof badge ./proof-bundle -o badge.svg
125
-
126
- # Generate badge URL
127
- npx shipgate proof badge ./proof-bundle --format url --bundle-url https://example.com/bundle
128
-
129
- # With custom badge service
130
- npx shipgate proof badge ./proof-bundle --format url --badge-url-base https://badges.example.com
131
- ```
132
-
133
- The badge displays the proof verdict (PROVEN, INCOMPLETE, VIOLATED, UNPROVEN) with color coding:
134
- - 🟢 **PROVEN** - Green badge
135
- - 🟡 **INCOMPLETE_PROOF** - Yellow badge
136
- - 🔴 **VIOLATED** - Red badge
137
- - **UNPROVEN** - Grey badge
138
-
139
- ### `shipgate proof attest <bundle-path>`
140
-
141
- Generate SLSA-style attestation JSON from a proof bundle for supply chain security.
142
-
143
- ```bash
144
- # Output to stdout
145
- npx shipgate proof attest ./proof-bundle
146
-
147
- # Save to file
148
- npx shipgate proof attest ./proof-bundle -o attestation.json
149
-
150
- # Include full manifest
151
- npx shipgate proof attest ./proof-bundle --include-manifest -o attestation.json
152
- ```
153
-
154
- The attestation includes:
155
- - Verdict and reason
156
- - Spec information (domain, version, hash)
157
- - Gate, build, and test results
158
- - Toolchain versions
159
- - Bundle fingerprint
160
-
161
- ### `shipgate proof comment <bundle-path>`
162
-
163
- Generate GitHub PR comment from a proof bundle.
164
-
165
- ```bash
166
- # Output to stdout (for GitHub Actions)
167
- npx shipgate proof comment ./proof-bundle
168
-
169
- # Save to file
170
- npx shipgate proof comment ./proof-bundle -o pr-comment.md
171
- ```
172
-
173
- The comment includes:
174
- - Verdict summary with emoji indicators
175
- - Phase-by-phase breakdown (Gate, Build, Tests, Verify)
176
- - Spec and toolchain information
177
- - Bundle ID and generation timestamp
178
-
179
- ### `shipgate repl`
180
-
181
- Start an interactive REPL for exploring ISL.
182
-
183
- ```bash
184
- npx shipgate repl
185
- ```
186
-
187
- ## Configuration
188
-
189
- The `init` command creates `isl.config.json` in your project root:
190
-
191
- ```json
192
- {
193
- "defaultTarget": "typescript",
194
- "strictMode": true,
195
- "outputDir": "./generated",
196
- "include": ["src/**/*.isl"],
197
- "exclude": ["src/drafts/**"],
198
- "output": {
199
- "types": true,
200
- "tests": true,
201
- "docs": false
202
- }
203
- }
204
- ```
205
-
206
- ## Environment Variables
207
-
208
- - `ISL_CONFIG` - Path to config file
209
- - `ISL_DEBUG` - Enable debug output
210
- - `ISL_NO_COLOR` - Disable colored output
211
- - `ANTHROPIC_API_KEY` - API key for AI-enhanced features (optional)
212
-
213
- ## Examples
214
-
215
- ### Initialize a project
216
-
217
- ```bash
218
- npx shipgate init
219
- ```
220
-
221
- This creates:
222
- - `src/my-project.isl` - Example ISL specification
223
- - `isl.config.json` - Configuration file
224
- - `package.json` - Node.js project file
225
-
226
- ### Check ISL files
227
-
228
- ```bash
229
- npx shipgate check src/*.isl
230
- ```
231
-
232
- ### Generate TypeScript types
233
-
234
- ```bash
235
- npx shipgate generate --target typescript src/
236
- ```
237
-
238
- ## Documentation
239
-
240
- - Full documentation: https://shipgate.dev/docs
241
- - GitHub: https://github.com/guardiavault-oss/ISL-LANG
242
-
243
- ## License
244
-
245
- MIT
1
+ # Shipgate CLI v2.1.0
2
+
3
+ [![npm version](https://badge.fury.io/js/shipgate.svg)](https://badge.fury.io/js/shipgate)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+ [![Downloads](https://img.shields.io/npm/dm/shipgate)](https://www.npmjs.com/package/shipgate)
6
+
7
+ > **ShipGate — Stop AI from shipping fake features. Define what your code should do. We enforce it.**
8
+
9
+ The Shipgate CLI is your command-line gateway to **Intent Specification Language (ISL)** — a formal language for specifying what your code *must* do. With ISL, you can define behavioral contracts, generate code, and verify that AI-generated implementations match your intentions.
10
+
11
+ ## 🚀 Quick Start
12
+
13
+ ### Installation
14
+
15
+ ```bash
16
+ # Install globally (recommended)
17
+ npm install -g shipgate
18
+
19
+ # Or use npx (no installation required)
20
+ npx shipgate <command>
21
+
22
+ # Verify installation
23
+ shipgate --version
24
+ ```
25
+
26
+ ### Your First Project
27
+
28
+ ```bash
29
+ # Initialize a new project
30
+ npx shipgate init my-api
31
+ cd my-api
32
+
33
+ # Check the generated spec
34
+ npx shipgate check src/*.isl
35
+
36
+ # Generate TypeScript code
37
+ npx shipgate generate --target typescript src/
38
+
39
+ # Verify implementation
40
+ npx shipgate verify src/my-api.isl --impl ./src
41
+ ```
42
+
43
+ ## 📋 Commands Overview
44
+
45
+ | Command | Purpose | Key Features |
46
+ |---------|---------|--------------|
47
+ | `init` | Create new ISL project | Auto-configuration, templates |
48
+ | `check` | Parse & validate ISL files | Type checking, syntax validation |
49
+ | `generate` | Code from ISL specs | TypeScript, Python, Rust, Go, OpenAPI |
50
+ | `verify` | Verify implementation | Behavioral verification, evidence |
51
+ | `gate` | SHIP/NO-SHIP decision | CI integration, trust scoring |
52
+ | `parse` | Inspect ISL AST | Debug specifications |
53
+ | `repl` | Interactive ISL shell | Explore ISL interactively |
54
+
55
+ ## 🛠️ Detailed Command Reference
56
+
57
+ ### `shipgate init [name]`
58
+
59
+ Initialize a new ISL project with recommended structure and configuration.
60
+
61
+ ```bash
62
+ # Initialize in current directory
63
+ npx shipgate init
64
+
65
+ # Create new project directory
66
+ npx shipgate init my-project
67
+ cd my-project
68
+
69
+ # Skip prompts (use defaults)
70
+ npx shipgate init -y
71
+
72
+ # Overwrite existing config
73
+ npx shipgate init --force
74
+ ```
75
+
76
+ **Creates:**
77
+ ```
78
+ my-project/
79
+ ├── src/
80
+ │ └── my-project.isl # Example specification
81
+ ├── generated/ # Code output directory
82
+ ├── isl.config.json # Project configuration
83
+ ├── package.json # Node.js project setup
84
+ └── README.md # Project documentation
85
+ ```
86
+
87
+ ### `shipgate check <files...>`
88
+
89
+ Parse and type-check ISL files with comprehensive error reporting.
90
+
91
+ ```bash
92
+ # Check all ISL files
93
+ npx shipgate check src/**/*.isl
94
+
95
+ # Strict mode (warnings become errors)
96
+ npx shipgate check --strict src/
97
+
98
+ # JSON output for CI
99
+ npx shipgate check --format json src/ > results.json
100
+
101
+ # Quiet mode (minimal output)
102
+ npx shipgate check --quiet src/
103
+ ```
104
+
105
+ **Options:**
106
+ - `--strict` - Enable strict mode (all warnings become errors)
107
+ - `--format <format>` - Output format: `pretty`, `json`, `quiet`
108
+ - `--config <path>` - Custom config file path
109
+
110
+ **Exit Codes:**
111
+ - `0` - All checks passed
112
+ - `1` - Errors found
113
+
114
+ ### `shipgate generate <files...>`
115
+
116
+ Generate production-ready code from ISL specifications.
117
+
118
+ ```bash
119
+ # Generate TypeScript
120
+ npx shipgate generate --target typescript src/
121
+
122
+ # Generate Python with custom output
123
+ npx shipgate generate --target python --output src/generated src/
124
+
125
+ # Generate OpenAPI spec
126
+ npx shipgate generate --target openapi src/api.isl
127
+
128
+ # Generate Rust types
129
+ npx shipgate generate --target rust --output src/types src/
130
+ ```
131
+
132
+ **Supported Targets:**
133
+ - `typescript` - TypeScript types and interfaces
134
+ - `python` - Python dataclasses and type hints
135
+ - `rust` - Rust structs and enums
136
+ - `go` - Go structs and interfaces
137
+ - `openapi` - OpenAPI 3.0 specifications
138
+ - `graphql` - GraphQL schemas
139
+
140
+ **Options:**
141
+ - `--target, -t` - Target language (required)
142
+ - `--output, -o` - Output directory (default: `generated/`)
143
+ - `--config, -c` - Config file path
144
+ - `--watch` - Watch for changes and regenerate
145
+
146
+ ### `shipgate verify <files...>`
147
+
148
+ Verify implementation against ISL specifications.
149
+
150
+ ```bash
151
+ npx shipgate verify specs/critical-flow.isl --impl ./src
152
+ ```
153
+
154
+ ### `shipgate parse <file>`
155
+
156
+ Parse an ISL file and display the AST.
157
+
158
+ ```bash
159
+ npx shipgate parse specs/example.isl
160
+ ```
161
+
162
+ ### `shipgate gate <files...>`
163
+
164
+ Run the ShipGate (SHIP/NO-SHIP gate) on ISL files.
165
+
166
+ ```bash
167
+ npx shipgate gate specs/
168
+ npx shipgate gate --ci --output json
169
+ ```
170
+
171
+ ### `shipgate proof badge <bundle-path>`
172
+
173
+ Generate a badge (SVG or URL) from a proof bundle for display in README or CI.
174
+
175
+ ```bash
176
+ # Generate SVG badge
177
+ npx shipgate proof badge ./proof-bundle -o badge.svg
178
+
179
+ # Generate badge URL
180
+ npx shipgate proof badge ./proof-bundle --format url --bundle-url https://example.com/bundle
181
+
182
+ # With custom badge service
183
+ npx shipgate proof badge ./proof-bundle --format url --badge-url-base https://badges.example.com
184
+ ```
185
+
186
+ The badge displays the proof verdict (PROVEN, INCOMPLETE, VIOLATED, UNPROVEN) with color coding:
187
+ - 🟢 **PROVEN** - Green badge
188
+ - 🟡 **INCOMPLETE_PROOF** - Yellow badge
189
+ - 🔴 **VIOLATED** - Red badge
190
+ - ⚪ **UNPROVEN** - Grey badge
191
+
192
+ ### `shipgate proof attest <bundle-path>`
193
+
194
+ Generate SLSA-style attestation JSON from a proof bundle for supply chain security.
195
+
196
+ ```bash
197
+ # Output to stdout
198
+ npx shipgate proof attest ./proof-bundle
199
+
200
+ # Save to file
201
+ npx shipgate proof attest ./proof-bundle -o attestation.json
202
+
203
+ # Include full manifest
204
+ npx shipgate proof attest ./proof-bundle --include-manifest -o attestation.json
205
+ ```
206
+
207
+ The attestation includes:
208
+ - Verdict and reason
209
+ - Spec information (domain, version, hash)
210
+ - Gate, build, and test results
211
+ - Toolchain versions
212
+ - Bundle fingerprint
213
+
214
+ ### `shipgate proof comment <bundle-path>`
215
+
216
+ Generate GitHub PR comment from a proof bundle.
217
+
218
+ ```bash
219
+ # Output to stdout (for GitHub Actions)
220
+ npx shipgate proof comment ./proof-bundle
221
+
222
+ # Save to file
223
+ npx shipgate proof comment ./proof-bundle -o pr-comment.md
224
+ ```
225
+
226
+ The comment includes:
227
+ - Verdict summary with emoji indicators
228
+ - Phase-by-phase breakdown (Gate, Build, Tests, Verify)
229
+ - Spec and toolchain information
230
+ - Bundle ID and generation timestamp
231
+
232
+ ### `shipgate repl`
233
+
234
+ Start an interactive REPL for exploring ISL.
235
+
236
+ ```bash
237
+ npx shipgate repl
238
+ ```
239
+
240
+ ## Configuration
241
+
242
+ The `init` command creates `isl.config.json` in your project root:
243
+
244
+ ```json
245
+ {
246
+ "defaultTarget": "typescript",
247
+ "strictMode": true,
248
+ "outputDir": "./generated",
249
+ "include": ["src/**/*.isl"],
250
+ "exclude": ["src/drafts/**"],
251
+ "output": {
252
+ "types": true,
253
+ "tests": true,
254
+ "docs": false
255
+ }
256
+ }
257
+ ```
258
+
259
+ ## Environment Variables
260
+
261
+ - `ISL_CONFIG` - Path to config file
262
+ - `ISL_DEBUG` - Enable debug output
263
+ - `ISL_NO_COLOR` - Disable colored output
264
+ - `ANTHROPIC_API_KEY` - API key for AI-enhanced features (optional)
265
+
266
+ ## Examples
267
+
268
+ ### Initialize a project
269
+
270
+ ```bash
271
+ # In current directory
272
+ npx shipgate init
273
+
274
+ # Or create a new folder
275
+ npx shipgate init my-project
276
+ ```
277
+
278
+ This creates:
279
+ - `src/my-project.isl` - Example ISL specification
280
+ - `isl.config.json` - Configuration file
281
+ - `package.json` - Node.js project file
282
+
283
+ ### Check ISL files
284
+
285
+ ```bash
286
+ npx shipgate check src/*.isl
287
+ ```
288
+
289
+ ### Generate TypeScript types
290
+
291
+ ```bash
292
+ npx shipgate generate --target typescript src/
293
+ ```
294
+
295
+ ## Documentation
296
+
297
+ - Full documentation: https://shipgate.dev/docs
298
+ - GitHub: https://github.com/guardiavault-oss/ISL-LANG
299
+
300
+ ## License
301
+
302
+ MIT