// @bun
import{CodeBlock as c,InstallCommand as n}from"@contractspec/lib.design-system";import o from"@contractspec/lib.ui-link";import{ChevronRight as i}from"lucide-react";import{jsx as e,jsxs as a}from"react/jsx-runtime";function p(){return a("div",{className:"space-y-8",children:[a("div",{className:"space-y-2",children:[e("h1",{className:"font-bold text-4xl",children:"ContractSpec CLI"}),e("p",{className:"text-lg text-muted-foreground",children:"Command-line interface for creating, building, and validating contract specifications with AI-powered code generation."})]}),a("div",{className:"space-y-6",children:[a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Installation"}),e(n,{package:"contractspec",dev:!0})]}),a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Quick Start"}),e(c,{language:"bash",code:`# Initialize project
contractspec onboard
bunx contractspec init

# Create a spec
contractspec create --type operation

# Generate code
contractspec generate

# Validate
contractspec validate`})]}),a("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Commands"}),e("div",{className:"grid gap-4",children:[{name:"onboard",description:"Primary OSS onboarding flow that recommends tracks, examples, and repo-local guides",usage:"contractspec onboard [track...] [--example <key>] [--dry-run] [--json]"},{name:"create",description:"Interactive wizard to create contract specifications",usage:"contractspec create [--type operation] [--ai]"},{name:"build",description:"Generate implementation code from contract specs using AI agents",usage:"contractspec build <spec-file> [--agent-mode claude-code]"},{name:"validate",description:"Validate contract specifications and implementations",usage:"contractspec validate <spec-file> [--check-implementation]"},{name:"list",description:"List all contract specifications in the project",usage:"contractspec list [--type operation] [--json]"},{name:"watch",description:"Watch specs and auto-regenerate on changes",usage:"contractspec watch [--build] [--validate]"},{name:"sync",description:"Sync contracts by building all discovered specs",usage:"contractspec sync [--dry-run]"},{name:"ci",description:"Run all validation checks for CI/CD pipelines",usage:"contractspec ci [--format sarif] [--output results.sarif]"},{name:"deps",description:"Analyze contract dependencies and relationships",usage:"contractspec deps [--circular] [--format dot]"},{name:"diff",description:"Compare contract specifications and show differences",usage:"contractspec diff <spec1> <spec2> [--breaking]"}].map((t)=>a("div",{className:"card-subtle space-y-2 p-4",children:[e("h3",{className:"font-bold font-mono text-violet-400",children:t.name}),e("p",{className:"text-muted-foreground text-sm",children:t.description}),e(c,{language:"bash",code:t.usage,showCopyButton:!1})]},t.name))})]}),a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"AI Agent Modes"}),e("p",{className:"text-muted-foreground",children:"The CLI supports multiple AI agent modes for different use cases:"}),a("div",{className:"grid gap-3 md:grid-cols-2",children:[a("div",{className:"card-subtle p-4",children:[e("h4",{className:"font-bold",children:"simple"}),e("p",{className:"text-muted-foreground text-sm",children:"Direct LLM API calls, fast and straightforward. Best for rapid prototyping."})]}),a("div",{className:"card-subtle p-4",children:[e("h4",{className:"font-bold",children:"claude-code"}),e("p",{className:"text-muted-foreground text-sm",children:"Extended thinking with Claude. Best for production-quality code."})]}),a("div",{className:"card-subtle p-4",children:[e("h4",{className:"font-bold",children:"openai-codex"}),e("p",{className:"text-muted-foreground text-sm",children:"GPT-4o/o1 models. Excellent for algorithms and optimization."})]}),a("div",{className:"card-subtle p-4",children:[e("h4",{className:"font-bold",children:"cursor"}),e("p",{className:"text-muted-foreground text-sm",children:"Leverages Cursor agentic capabilities. Requires Cursor environment."})]})]})]}),a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"CI/CD Integration"}),e("p",{className:"text-muted-foreground",children:"Run all validation checks in CI/CD with machine-readable output:"}),e(c,{language:"yaml",filename:".github/workflows/validate.yml",code:`- name: Validate Contracts
  run: contractspec ci --format sarif --output results.sarif

- name: Upload SARIF
  uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: results.sarif`})]}),a("div",{className:"card-subtle space-y-4 p-6",children:[e("h3",{className:"font-bold",children:"Configuration"}),a("p",{className:"text-muted-foreground text-sm",children:["Create a ",e("code",{children:".contractsrc.json"})," file in your project root:"]}),e(c,{language:"json",filename:".contractsrc.json",code:`{
  "aiProvider": "claude",
  "agentMode": "claude-code",
  "outputDir": "./src",
  "conventions": {
    "operations": "interactions/commands|queries",
    "events": "events"
  }
}`})]})]}),a("div",{className:"flex items-center gap-4 pt-4",children:[a(o,{href:"/docs/getting-started/tools/vscode",className:"btn-primary",children:["Next: VS Code Extension ",e(i,{size:16})]}),e(o,{href:"/docs/getting-started/tools",className:"btn-ghost",children:"Back to Tools"})]})]})}export{p as CLIPage};
