Crates.io | quartz-cli |
lib.rs | quartz-cli |
version | 1.3.1 |
source | src |
created_at | 2023-06-05 02:14:01.363104 |
updated_at | 2024-06-02 00:57:15.747967 |
description | The command-line tool to build and test HTTP requests. |
homepage | https://github.com/EduardoRodriguesF/quartz |
repository | https://github.com/EduardoRodriguesF/quartz |
max_upload_size | |
id | 882710 |
size | 240,714 |
The command-line tool to build and test HTTP requests.
quartz allows developers to create an API organization project that can be use to share, document and send requests through the terminal.
What quartz is:
What Quartz is not:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/EduardoRodriguesF/quartz/master/install.sh)"
brew tap eduardorodriguesf/quartz
brew install quartz
Warning: this method is not recommended because it lacks the man page. Prefer the other installation options above.
cargo install quartz-cli
To create a new project, run:
$ quartz init .
Now start creating your requests with the create
command:
$ quartz create users/find --url https://api.example.com/users/{{id}}
$ quartz create users/update -X PATCH --url https://api.example.com/users/{{id}} --json '{"name": "John Doe"}'
$ quartz create users/create -X POST --url https://api.example.com/users/{{id}} --json '{"email": "foo@bar.com", "name": "John Doe"}'
These commands create four handles. A handle is like a path to an endpoint. Similarly to file paths, they are segmented
by slash (/). We can see all handles with the ls
command:
$ quartz ls
--- users
GET users/:id
PATCH users/update
POST users/create
Notice that users
does not have any method. That's because it is an empty handle, while all others are definitive endpoints that we can
send requests to.
To send a request, make sure you are using it by running the use
command:
$ quartz use users/find
Now you can send the request with the send
command. Since we also defined a variable id
in the URL, we need to give this variable a value.
$ quartz send --var id=123
This outputs the response body, but we can also see more details with the last
command, which saves our latest request and response
for us to fetch the data locally.
$ quartz last res head
You can even output a cURL command to replicate the request:
$ quartz show snippet --var id=123 curl
curl -L 'https://api.example.com/users/123' -X GET
Now that you know the basics of quartz, you can start creating more requests and organizing them in your project. For more information and advanced usage of quartz, check the Documentation.
To get started with quartz, head to the install and access the manual page at man quartz
!
If you have any trouble, you can also read it in markdown here.
This project is under Apache License 2.0.