shipgate 1.0.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/LICENSE +21 -0
- package/README.md +184 -0
- package/dist/cli.cjs +94153 -0
- package/package.json +108 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 ISL Lang
|
|
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,184 @@
|
|
|
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 repl`
|
|
119
|
+
|
|
120
|
+
Start an interactive REPL for exploring ISL.
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
npx shipgate repl
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Configuration
|
|
127
|
+
|
|
128
|
+
The `init` command creates `isl.config.json` in your project root:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"defaultTarget": "typescript",
|
|
133
|
+
"strictMode": true,
|
|
134
|
+
"outputDir": "./generated",
|
|
135
|
+
"include": ["src/**/*.isl"],
|
|
136
|
+
"exclude": ["src/drafts/**"],
|
|
137
|
+
"output": {
|
|
138
|
+
"types": true,
|
|
139
|
+
"tests": true,
|
|
140
|
+
"docs": false
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Environment Variables
|
|
146
|
+
|
|
147
|
+
- `ISL_CONFIG` - Path to config file
|
|
148
|
+
- `ISL_DEBUG` - Enable debug output
|
|
149
|
+
- `ISL_NO_COLOR` - Disable colored output
|
|
150
|
+
- `ANTHROPIC_API_KEY` - API key for AI-enhanced features (optional)
|
|
151
|
+
|
|
152
|
+
## Examples
|
|
153
|
+
|
|
154
|
+
### Initialize a project
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
npx shipgate init
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
This creates:
|
|
161
|
+
- `src/my-project.isl` - Example ISL specification
|
|
162
|
+
- `isl.config.json` - Configuration file
|
|
163
|
+
- `package.json` - Node.js project file
|
|
164
|
+
|
|
165
|
+
### Check ISL files
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
npx shipgate check src/*.isl
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Generate TypeScript types
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
npx shipgate generate --target typescript src/
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Documentation
|
|
178
|
+
|
|
179
|
+
- Full documentation: https://shipgate.dev/docs
|
|
180
|
+
- GitHub: https://github.com/guardiavault-oss/ISL-LANG
|
|
181
|
+
|
|
182
|
+
## License
|
|
183
|
+
|
|
184
|
+
MIT
|