Insomnia

From G1Joshi/Agent-Skills · View interactive version

Insomnia is an AI agent skill from the GitHub repository G1Joshi/Agent-Skills. Expert Insomnia REST/GraphQL/gRPC client assistance covering environment variables, request chaining, plugins, and test automation. Use when designing, testing, and debugging APIs.

How to use this skill

Skill file

Insomnia

Insomnia is the lightweight alternative to Postman. v9.0+ focuses on Local-First philosophy (Local Vault) and Git Sync.

When to Use

Quick Start

// Insomnia Base Environment Configuration
{
  "base_url": "https://api.staging.example.com/v1",
  "auth_token": "Bearer eyJhbGciOi...",
  "tenant_id": "tenant_1234"
}

Core Concepts

Environment Variables & Chained Request Responses

Extracting bearer token from authentication response:

// In Sub-Environment configuration
{
  "base_url": "https://api.staging.example.com",
  "client_id": "app_client_prod",
  "auth_token": "{% response 'body', 'req_login_01', 'b64::JC5hY2Nlc3NfdG9rZW4=::46b', 'no-history', 60 %}"
}

Subsequent requests reference {{ base_url }}/v1/users with header Authorization: Bearer {{ auth_token }}.

Inso CLI Test Execution in CI Pipelines

Running automated API test collections headlessly:

# Lint OpenAPI specification file
inso lint spec "Company API Spec"

# Run automated functional test suite against staging environment
inso run test "User Lifecycle Test Suite" --env "Staging" --ci

gRPC Service Invocation

Calling gRPC methods with server reflection:

  1. Create new request -> Select gRPC.
  2. Enter server URL: grpc.infra.internal:50051.
  3. Enable Server Reflection to auto-load Protobuf method definitions.
  4. Input JSON payload and click Send to stream responses.

Common Patterns

Automated CI Collection Testing with Inso CLI

Problem: Run Insomnia API tests automatically inside CI/CD pipelines.

Solution: Execute tests via inso CLI.

# Install inso CLI
npm install -g insomnia-inso

# Run test suite headlessly in CI
inso run test "User API Test Suite" --env "Staging" --ci

Best Practices

Do:

Don't:

Troubleshooting

| Error | Cause | Solution |

| :---------------------------------------------- | :------------------------------------------------ | :--------------------------------------------------------------------- |

| SSL Certificate validation failed in Insomnia | Self-signed SSL certificate in local development. | Uncheck "Validate SSL certificates" in Insomnia Preferences > General. |

| Template tag failed: Request has no response | Chained request hasn't been executed yet. | Execute the referenced upstream request (req_login) once. |

| CORS Error in Insomnia Web Client | Web version subject to browser CORS policies. | Use desktop native Insomnia client or configure CORS proxy. |

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.