CLI: Import and export
The nouto import command converts a file from another API tool into a Nouto collection file that nouto run can execute. The nouto export command converts a Nouto collection file to HAR or rewrites it in Nouto format.
Import a file
Section titled “Import a file”nouto import <file> [options]nouto import accepts these options:
| Option | Description | Default |
|---|---|---|
--from <format> |
Source format. See the table below. | Detected from the file |
-o, --output <file> |
Output file | <collection-name>.nouto.json in the current directory |
The default file name is the collection name in lowercase, with every character other than letters, digits, -, and _ replaced by _. For example, a collection named My API becomes my_api.nouto.json.
Supported formats
Section titled “Supported formats”Pass one of these values to --from, or let the CLI detect the format:
| Format | --from value |
Detected when |
|---|---|---|
| Postman | postman |
The JSON has info.schema containing postman, or info._postman_id |
| Insomnia | insomnia |
The JSON has _type: "export" or __export_format |
| Hoppscotch | hoppscotch |
The JSON is an array whose first item has v and name |
| Thunder Client | thunder-client |
The JSON is an array whose first item has containerId |
| HAR | har |
The JSON has log.version and log.entries |
| OpenAPI or Swagger | openapi |
The JSON has an openapi or swagger field, or the file extension is .yaml or .yml |
| Bruno | bruno |
The file extension is .bru |
| cURL | curl |
The file content starts with curl |
A Bruno import reads a single .bru file and creates a collection named Bruno Import with one request. A cURL import creates a collection named Imported from cURL with one request.
Insomnia, Hoppscotch, and Thunder Client exports can contain several collections. The CLI writes each one to its own <collection-name>.nouto.json file. If you pass --output, each collection overwrites the same file and only the last one remains, so leave --output out for these files.
Import examples
Section titled “Import examples”Detect the format:
nouto import postman-collection.jsonSet the format explicitly:
nouto import spec.yaml --from openapiChoose the output file:
nouto import postman-collection.json --output my-api.nouto.jsonExport a collection
Section titled “Export a collection”nouto export <collection-file> [options]nouto export accepts these options:
| Option | Description | Default |
|---|---|---|
--to <format> |
Target format: nouto or har |
nouto |
-o, --output <file> |
Output file | <collection-name>.nouto.json or <collection-name>.har in the current directory |
A HAR export contains one entry per request, with folders flattened. A Nouto export rewrites the collection in the single-collection export format, which is useful for extracting the first collection from a multi-collection export file.
Export examples
Section titled “Export examples”Export as HAR:
nouto export my-api.nouto.json --to har --output traffic.harRewrite a collection file in Nouto format:
nouto export my-api.nouto.json --output my-api-clean.nouto.jsonConvert a Postman collection and run it
Section titled “Convert a Postman collection and run it”Import the Postman file, then run the result:
nouto import postman-collection.json --output my-api.nouto.jsonnouto run my-api.nouto.json --reporter junit --output results.xmlExit codes
Section titled “Exit codes”nouto import exits with 2 when the input file is missing and with 6 when it can’t detect the format. Both commands exit with 7 for an unsupported --from or --to value. Exit codes lists the other codes.
