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.
- package/README.md +302 -245
- package/dist/cli.cjs +100828 -63149
- package/package.json +68 -58
package/README.md
CHANGED
|
@@ -1,245 +1,302 @@
|
|
|
1
|
-
# Shipgate CLI
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
#
|
|
30
|
-
npx shipgate
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
npx shipgate
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
#
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
#
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
npx shipgate
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
npx shipgate
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
-
|
|
209
|
-
-
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
###
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
1
|
+
# Shipgate CLI v2.1.0
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/shipgate)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](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
|