Insomnia logo
  • Documentation
  • Get Started for Free
    • Introduction to Insomnia
    • Install Insomnia
    • Send Your First Request
    • Import and Export Data
    • Environment Variables
    • Global Environments
    • Insomnia Accounts
    • Forgotten Passphrase
    • Managing E2EE (End-to-End Encryption)
    • Organizations
    • Enable Enterprise membership
    • Configuring EE SSO
    • Integrating Insomnia Enterprise with Okta SAML 2.0
    • Integrating Insomnia Enterprise with Okta OpenID Connect
    • Integrating Insomnia Enterprise with Microsoft Azure/Entra ID SAML 2.0
    • Insomnia Whitelisting Guide for Enterprise Users
    • Transfer enterprise organizations and license
    • Configuring SCIM
    • Multiple Owners
    • Manage Domains
    • Invite Controls
    • Storage Controls
    • Insomnia Subscriptions
    • Insomnia Subscription Management
    • Scratch Pad Tutorial
    • Requests
    • Responses
    • Request Collections
    • Request Timeouts
    • Chaining Requests
    • Post CSV Data
    • SOAP Requests
    • gRPC
    • WebSocket Support
    • Get Started with Documents
    • Design Documents
    • Linting
    • GraphQL for OpenAPI
    • Migrate from Designer
    • Unit Testing
    • Stress Testing
    • Insomnia Storage Options Guide
    • Sync with Insomnia Cloud
    • Sync with Git
    • Key Security Features
    • Security Standards
    • Signup and Authentication
    • Analytics Collected
    • End to End Data Encryption
    • Software Bill of Materials
    • Verifying Build Provenance for Signed Insomnia Binaries
    • Authentication
    • Client Certificates
    • Collection Runner
    • Generate Code Snippet
    • Cookie Management
    • Encoding
    • GraphQL Queries
    • Run in Insomnia Button
    • Key Maps
    • Proxy
    • Folder-level settings
    • Introduction to Plugins
    • Context Object Reference
    • Template Tags
    • Hooks and Actions
    • Custom Themes
    • AI Runner
    • FAQ
    • Application Data
    • SSL Validation
    • Password Recovery
    • Introduction to Inso CLI
    • Install Inso CLI
    • CLI Command Reference
      • inso run test
      • inso run collection
      • inso lint spec
      • inso export spec
      • inso script
      • Using Custom Linting with Inso CLI
    • Configuration
    • Inso CLI on Docker
    • Software Bill of Materials
    • Verifying Signatures for Signed Inso CLI Images
    • Verifying Inso CLI Build Provenance
      • Verifying Build Provenance for Signed Inso CLI Images
      • Verifying Build Provenance for Signed Inso CLI Binaries
    • Continuous Integration
    • Insomnia Pre-request Script Overview
    • Insomnia After-Response Script Overview
    • Secret Environment Variables
    • External Vault Integration (Enterprise feature)
    • Insomnia API Mocking Overview

Introduction to Inso CLI

Inso CLI (Command Line Interface) for Insomnia is built on Node.js and the Insomnia core libraries. It allows you to use Insomnia application functionality in your terminal and CI/CD environments for automation.

Inso CLI is open source on GitHub.

Note: At this time, Inso CLI only works with Design Documents, and not Request Collections.

Usage

Install Inso CLI to get started.

In your terminal, work in a directory that contains an .insomnia directory. Alternatively, ensure you have Insomnia installed with at least one Design Document.

All of the Inso CLI commands will prompt for more information, if needed. For example, if the unit test suite to run is not provided, Inso will prompt according to the data source. Prompts for more information can be disabled using the --ci global option.

Global Options

Global options are valid with any Inso command, in conjunction with command-specific options.

Global option Alias Description
--version -v output the version number
--workingDir <dir> -w set working directory, for both input (Git) and output (export a spec)
--config <path>   path to the configuration file
--verbose   show additional logs while running a command
--printOptions   print the loaded options
--ci   run in CI, disables all prompts
--help -h display help for a command

Note: We have deprecated the options --appDataDir <dir> and --src <file or dir>. Please use -w or --workingDir instead to define the location of the Insomnia v4 export file or the Insomnia app data directory.

Data Sources

Inso CLI can work with three data sources.

  • Insomnia app data directory. Inso CLI will attempt to locate the directory based on your operating system. To overwrite the default location, search for app data using -w and the Application Data location of your operating system.
  • Git data directory if Git Sync is set up and no -w is set. For example, when running in CI, InsoCLI will find the .insomnia directory at the root of the repository automatically, but you can override the location using --workingDir.
  • Insomnia export file. Search for an export file using -w.

Note: The .insomnia directory is generated automatically in your git repository when using Git Sync.

Data Search Flow

Inso CLI will first try to find a .insomnia directory in its working directory. This directory is generated in a git repository when using Git Sync. When Inso is used in a CI environment, it will automatically run against the .insomnia directory at the root of the repository, unless you specify a --workingDir option.

If Inso CLI cannot find the .insomnia directory, it will try to run against the Insomnia app data directory. You can override both the working directory, and the app data directory, using the --workingDir global options.

The identifier Argument

Insomnia database ids are quite long, for example: wrk_012d4860c7da418a85ffea7406e1292a. When specifying an identifier for Inso CLI, similar to Git hashes, you may choose to truncate it and use the first x characters (for example, wrk_012d486), which is likely to be unique. If in the rare chance the short id is not unique against the data, Inso CLI will indicate that.

The identifier can also be the entity name. For example, if a unit test suite ID is “uts_012d4860c7da418a85ffea7406e1292a” and the unit test suite name is “foobar”, both of the following will work:

inso run test uts_012d48 inso run test foobar

Additionally, if the identifier argument is omitted from the command, Inso CLI will search in the database for the information it needs, and prompt the user. Prompts can be disabled with the --ci global option.

OpenAPI to Kong Gateway configuration

You can combine Insomnia’s CLI with Kong Gateway’s decK CLI to automatically generate Kong Gateway configurations from your OpenAPI specifications, while ensuring that they are tested and linted with Insomnia in the meantime.

To learn more read the official documentation for decK’s configuration generation.

Edit this page
Report an issue
    COMPANY
  • Insomnia
  • Blog
  • Changelog
  • Pricing
  • Careers
    PRODUCTS
  • Insomnia
  • Inso (CLI)
    RESOURCES
  • Sign In
  • Documentation
  • Support
    LEGAL
  • Privacy Policy
  • Terms & Conditions
© Kong Inc. 2021