Copy a request as cURL in three steps
- In the Insomnia sidebar, right-click the request (or click the ⋯ / dropdown arrow next to its name).
- Select Copy as cURL. Some versions ask you to click once more to confirm.
- Paste the command into your terminal, a bug report, or a chat.
The command includes the method, URL, headers, auth, and body as Insomnia would send them, with environment variables already filled in. Check it for tokens before you share it.
If "Copy as cURL" is missing or fails
Use the code generator instead: open the request and press Ctrl+Shift+G (⇧⌘G on macOS), or choose Generate Client Code from the same request menu. Pick Shell → cURL and click Copy to Clipboard.
The generator is also the fix when "Copy as cURL" shows a Could not generate cURL error, which some Insomnia releases throw for requests that have scripts attached.
What to do with the cURL command
- Keep it as a file. Paste it into the cURL → .http converter to get a plain-text request that runs in VS Code REST Client, JetBrains HTTP Client, or Karve, and that you can commit next to your code.
- Turn it into code. cURL → C#, cURL → JavaScript fetch, and cURL → PowerShell produce ready-to-paste snippets.
- On Windows PowerShell 5.1, type
curl.exerather thancurl, because therecurlis an alias forInvoke-WebRequestand rejects curl flags.
All the converters run in your browser. The command you paste is not uploaded.
Many requests? Don't copy them one by one
Copying is fine for a handful of requests. For a whole collection, export it instead. HAR export keeps each request's method, URL, headers, and body, and the HAR → cURL converter turns the whole file into one command per request. The export options are covered in how to export an Insomnia collection, and the full move to text files in how to migrate from Insomnia to .http files.