CLI: init
The init command sets up ShipGate for your project. It creates configuration files, directory structure, and optionally generates ISL specs from existing code.
Usage
shipgate init [name] [options]Options
| Flag | Description |
|---|---|
-t, --template <type> | Project template: minimal, full, api |
-d, --directory <dir> | Target directory |
--force | Overwrite existing files |
--no-git | Skip git initialization |
-e, --examples | Include example ISL files |
--from-code <path> | Generate ISL specs from existing source code |
--from-prompt <text> | Generate ISL spec from natural language |
--ai | Use AI for spec generation |
--api-key <key> | API key for AI provider |
Templates
Minimal (default)
Creates the minimum files needed:
shipgate init --template minimalOutput:
.shipgate.yml # Project configurationspecs/ # Directory for ISL files example.isl # Example spec (if --examples)Full
Full setup with CI, team config, and examples:
shipgate init --template fullOutput:
.shipgate.yml # Project configuration.shipgate-team.yml # Team policiesspecs/ # ISL specs directory example.isl # Example spec.github/workflows/shipgate.yml # GitHub Actions workflowAPI
Optimized for REST API projects:
shipgate init --template apiOutput:
.shipgate.yml # Project configurationspecs/ # ISL specs directory api-example.isl # Example API spec.github/workflows/shipgate.yml # CI workflowGenerate from existing code
If you already have source code, generate ISL specs from it:
# Analyze source code and generate specsshipgate init --from-code ./src
# With AI enhancement for better spec qualityshipgate init --from-code ./src --ai
# From natural language descriptionshipgate init --from-prompt "User registration with email verification"AI-powered initialization
With the --ai flag, ShipGate uses LLM analysis to produce higher-quality specifications:
# Ensure ANTHROPIC_API_KEY is set in your environment (do not put real keys in docs or commits).# Generate AI-enhanced specsshipgate init --from-code ./src --aiInteractive setup
The shipgate init command runs interactively. Without the --from-code flag, it asks:
- What type of project (API, web app, library)?
- Which template to use?
- Include example files?
- Set up CI workflow?
Examples
# New project with examplesshipgate init my-project --examples
# Add to existing projectshipgate init --force
# API project with CIshipgate init --template api
# Generate specs from codeshipgate init --from-code ./src --output specs/
# AI-powered setupshipgate init --from-code ./src --aiWhat init creates
.shipgate.yml
# ShipGate configurationversion: "1.0"specs: "specs/"impl: "src/"gate: threshold: 80 fail-on: errorverification: pbt: true chaos: trueGitHub Actions workflow
name: ShipGate Verifyon: pull_request: branches: [main]jobs: verify: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "20" - run: npm ci - uses: guardiavault-oss/isl-gate-action@v1 with: mode: auto threshold: 80Exit codes
| Code | Meaning |
|---|---|
0 | Initialization successful |
1 | Initialization error |