A command-line alternative to Postman.
Project description
cURL/s
The command-line alternative to Postman
curls is a drop in replacement for curl, with state added on (the "s" is for "save"). Create and share API collections, give your curls memorable nicknames to call them up by, and more.
Installation
$ brew install ptbrodie/curls/curls
Usage
$ curls -XPOST https://api.example.com/api/v1/example -H 'content-type: application/json' -d '{"some": {"data": "here"}}'
$ curls history
+History---------------------------+------+---------------------+------------------------------------------------------------------------+
| id | name | date | command |
+----------------------------------+------+---------------------+------------------------------------------------------------------------+
| 350f41c5a89a485187649931dbb4c6b5 | - | 2024-02-21 19:35:30 | $ curls -XPOST https://api.example.com/api/v1/example -H 'content-type:|
| | | | application/json' -d '{"some": {"data": "here"}}' |
+----------------------------------+------+---------------------+------------------------------------------------------------------------+
Naming and using curls
Every curl you run with curls is saved and given a unique id by default. You can reference the curl by its id or give it a human-readable name.
# Rerun an old curl
$ curls 350f41c5a89a485187649931dbb4c6b5
# Give a curl a name
$ curls name 350f41c5a89a485187649931dbb4c6b5 'my-curl'
$ curls history
+History---------------------------+---------+---------------------+------------------------------------------------------------------------+
| id | name | date | command |
+----------------------------------+---------+---------------------+------------------------------------------------------------------------+
| 350f41c5a89a485187649931dbb4c6b5 | my-curl | 2024-02-21 19:35:30 | $ curls -XPOST https://api.example.com/api/v1/example -H 'content-type:|
| | | | application/json' -d '{"some": {"data": "here"}}' |
+----------------------------------+---------+---------------------+------------------------------------------------------------------------+
# Give a curl a description
$ curls describe my-curl "This is a description of my curl."
$ curls info my-curl
ID: 350f41c5a89a485187649931dbb4c6b5
Date: 2024-02-21 19:35:30
Name: my-curl
Description: This is a description of my curl.
Command: curls -XPOST https://api.example.com/api/v1/example -H 'content-type: application/json' -d '{"some": {"data": "here"}}'
Creating and Managing APIs
An API is a curated collection of curls. Use APIs for storing a collection of tests, or complex curls you don't want to re-type, or curating a collection of curls to share with a colleague.
# View APIs
$ curls api
default
* existing-api
# Create new API
$ curls api create 'new-api'
$ curls api
default
* existing-api
new-api
# Switch to the new API
$ curls use new-api
$ curls api
default
existing-api
* new-api
# Add a cURL to an API
$ curls add 350f41c5a89a485187649931dbb4c6b5
$ curls
+new-api---------------------------+------+---------------------+------------------------------------------------------------------------+
| id | name | date | command |
+----------------------------------+------+---------------------+------------------------------------------------------------------------+
| 350f41c5a89a485187649931dbb4c6b5 | - | 2024-02-21 19:35:30 | $ curls -XPOST https://api.example.com/api/v1/example -H 'content-type:|
| | | | application/json' -d '{"some": {"data": "here"}}' |
+----------------------------------+------+---------------------+------------------------------------------------------------------------+
# Remove a cURL from an API
$ curls remove 350f41c5a89a485187649931dbb4c6b5
$ curls
+new-api-+-------+---------+-----------+
| id | name | date | command |
+--------+-------+---------+-----------+
Sharing Your APIs
# Export an API to a json file.
[mine] $ curls export shared-api
API exported to shared-api.json.
# Import an API from a json file.
[yours] $ curls import shared-api.json
[yours] $ curls api
* default
shared-api
[yours] $ curls use shared-api
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file curls-cli-0.0.2.tar.gz.
File metadata
- Download URL: curls-cli-0.0.2.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b465459b540601588ca89b27b124dd99e4f0ac5546c53dc18a3440965967fc0
|
|
| MD5 |
e400cf9328c143ed0714337ce001c3e1
|
|
| BLAKE2b-256 |
917acf2a73c0c3a26e88566a6aa20468943d33a99431f6a9b9a7b637c9a56b98
|
File details
Details for the file curls_cli-0.0.2-py3-none-any.whl.
File metadata
- Download URL: curls_cli-0.0.2-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
896cef415b6cdae3d72f466117d8a7a88fd7a524415c2265d12d4cebb368872a
|
|
| MD5 |
4cacb48667744fb991bcb0b59f2ab85b
|
|
| BLAKE2b-256 |
f263369fbe9d9e23c7447bb794fe03816c8bb4551f8319f9861f9c8fda12b411
|