Skip to content

Latest commit

 

History

History
55 lines (43 loc) · 2.99 KB

README.md

File metadata and controls

55 lines (43 loc) · 2.99 KB

curlz

License: GPL v3 Build Status crates.io dependency status

a curl wrapper with placeholder, bookmark and environment powers just like postman but for the terminal

Features

  • variables from .env and .yaml environment files
  • ️placeholder evaluation using the minijinja template engine, which can be used in URLs, HTTP headers, the HTTP body, and other passed curl parameters
  • ability to save requests as bookmarks and execute them by a shortname
  • support any curl argument after a --, that makes a drop-in-replacement for curl
  • special placeholders to interact on the terminal
    • prompt for a password as {{ prompt_password() }} read more..
    • prompt for interactive input with a label as {{ prompt_for("Username") }} read more..
  • ️special placeholder for developers, like Json Web Tokens (JWT) or Basic-Auth
  • send a http body via -d | --data or send json payload (with headers) via --json

WIP

Example #1

In this example we're going to download a pre-configured .gitignore for a given language from GitHub via curl

  • curl https://api.github.com/gitignore/templates/Rust
  • the same with curlz: curlz r https://api.github.com/gitignore/templates/Rust
  • Add a placeholder that is interactively requested curlz r 'https://api.github.com/gitignore/templates/{{ prompt_for("Language") | title }}'
  • Now let's bookmark this request:
    curlz r --bookmark 'https://api.github.com/gitignore/templates/{{ prompt_for("Language") | title }}'
    Language: rust
    Please enter a bookmark name: gitignore
  • Finally, we can keep using the bookmark from now on: curlz r gitignore

Template function documentation

Please read the book to learn more about the template functions