Skip to main content

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.

CommandDescriptionCommon Options / Notes
intrig initDetects 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.

CommandDescriptionCommon Options / Notes
intrig sync --allFetch latest OpenAPI definitions for all sources.--all – sync all configured sources. --id <sourceId> – sync only one source.
intrig generateCreate type-safe SDK with types, schemas, and framework bindings.Often run after sync.
intrig sync --all && intrig generateUpdate 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.

CommandDescriptionCommon 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 lsDisplay all configured API sources.β€”
intrig sources rmRemove an API source interactively.Confirms before deletion.

βš™οΈ Daemon Control​

Manage the Intrig daemon process that runs background operations, required for certain features like Insight.

CommandDescriptionCommon Options / Notes
intrig daemon upStart background daemon.Required for Insight.
intrig daemon downStop the daemon.β€”
intrig daemon restartRestart the daemon process.β€”
intrig daemon statusShow if daemon is running.β€”

πŸ” Resource Discovery​

Find and inspect API resources such as endpoints and schemas directly from the CLI.

CommandDescriptionCommon 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.

CommandDescriptionCommon Options / Notes
intrig insightStart web UI for browsing APIs and schemas.--silent, --port . Requires daemon + synced sources.

Typical Dev Flow:

  1. Backend changes β†’ restart app
  2. intrig sync --all
  3. intrig generate
  4. Work with generated SDK
  5. Use intrig search or intrig insight for discovery