CLI Reference
The Intrig CLI commands are organized by category for quick reference. Each section begins with a short description to help you understand when and why you might use these commands.
π Project Setupβ
Set up Intrig in your project so itβs ready to manage and generate SDKs. This is usually your first step when starting with Intrig.
Command | Description | Common Options / Notes |
---|---|---|
intrig init | Detects project type, creates intrig.config.json , updates .gitignore , adds build scripts, runs post-init steps. | Run on fresh setup or migrating to Intrig. |
π API Synchronization & SDK Generationβ
Keep your projectβs SDK in sync with backend API changes by updating sources and regenerating code.
Command | Description | Common Options / Notes |
---|---|---|
intrig sync --all | Fetch latest OpenAPI definitions for all sources. | --all β sync all configured sources. --id <sourceId> β sync only one source. |
intrig generate | Create type-safe SDK with types, schemas, and framework bindings. | Often run after sync . |
intrig sync --all && intrig generate | Update APIs and regenerate SDK in one step. | Run after backend changes or before CI build. |
CI mode (--ci
)β
Run sync and generate without relying on the Intrig daemon and without any interactive prompts. Ideal for CI pipelines.
- What it does:
- Runs operations in-process (no auto-start of the Intrig daemon)
- Avoids any interactive prompts
- For
intrig sync
, if neither--id
nor--all
is provided, it defaults to syncing all sources
- Recommended sequence in pipelines:
# After changing backend, restart the app before syncing (if applicable)
# Then, keep SDK up-to-date in CI:
intrig sync --ci --all && intrig generate --ci
Examples:
# Sync a specific source in CI
intrig sync --ci --id my-api
# Sync all sources and generate SDK in CI
intrig sync --ci --all && intrig generate --ci
π API Source Managementβ
Add, list, or remove API sources from your Intrig configuration.
Command | Description | Common Options / Notes |
---|---|---|
intrig sources add [spec-url] | Add a new OpenAPI/Swagger source. Prompts for ID and URL. | ID in camelCase; updates intrig.config.json . |
intrig sources ls | Display all configured API sources. | β |
intrig sources rm | Remove an API source interactively. | Confirms before deletion. |
βοΈ Daemon Controlβ
Manage the Intrig daemon process that runs background operations, required for certain features like Insight.
Command | Description | Common Options / Notes |
---|---|---|
intrig daemon up | Start background daemon. | Required for Insight. |
intrig daemon down | Stop the daemon. | β |
intrig daemon restart | Restart the daemon process. | β |
intrig daemon status | Show if daemon is running. | β |
π Resource Discoveryβ
Find and inspect API resources such as endpoints and schemas directly from the CLI.
Command | Description | Common Options / Notes |
---|---|---|
intrig search "query" | Find endpoints or schemas by keyword. | --no-interactive , --option . |
intrig view <id> | Display detailed info for a resource. | --type endpoint | schema , --tab-option . |
π Insight Interfaceβ
Launch the Intrig Insight web interface for interactive browsing and exploration of APIs and schemas.
Command | Description | Common Options / Notes |
---|---|---|
intrig insight | Start web UI for browsing APIs and schemas. | --silent , --port . Requires daemon + synced sources. |
Typical Dev Flow:
- Backend changes β restart app
intrig sync --all
intrig generate
- Work with generated SDK
- Use
intrig search
orintrig insight
for discovery