2 |

3 |
curlz
4 |
5 | [](https://www.gnu.org/licenses/gpl-3.0)
6 | [](https://github.com/curlz-rs/curlz/actions?query=branch%3Amain+workflow%3ABuild+)
7 | [](https://crates.io/crates/curlz)
8 | [](https://deps.rs/repo/github/curlz-rs/curlz)
9 |
10 |
11 |
12 | > a curl wrapper with placeholder, bookmark and environment powers just like postman but for the terminal
13 |
14 | ## Features
15 |
16 | - variables from `.env` and `.yaml` environment files
17 | - ️placeholder evaluation using the [minijinja](https://docs.rs/minijinja/latest/minijinja/) template engine, which can
18 | be used in URLs, HTTP headers, the HTTP body, and other passed curl parameters
19 | - ability to save requests as bookmarks and execute them by a shortname
20 | - support any curl argument after a `--`, that makes a drop-in-replacement for curl
21 | - special placeholders to interact on the terminal
22 | - prompt for a password
23 | as `{{ prompt_password() }}` [read more..](https://curlz-rs.github.io/curlz/template-functions.html#prompt-user-input---prompt_forname-string)
24 | - prompt for interactive input with a label
25 | as `{{ prompt_for("Username") }}` [read more..](https://curlz-rs.github.io/curlz/template-functions.html#prompt-user-for-password---prompt_password)
26 | - ️special placeholder for developers,
27 | like [Json Web Tokens (JWT)](https://curlz-rs.github.io/curlz/template-functions.html#json-web-token---jwtclaims-map-signing_key-string)
28 | or [Basic-Auth](https://curlz-rs.github.io/curlz/template-functions.html#basic-auth-token---basicusername-string-password-string)
29 | - send a http body via `-d | --data` or send json payload (with headers) via `--json`
30 |
31 | ## WIP
32 |
33 | - [⏳] support rest client template language [see #5](https://github.com/curlz-rs/curlz/issues/5)
34 | [check out the examples folder for more infos](./examples/http-file)
35 |
36 | ## Example #1
37 |
38 | In this example we're going to download a pre-configured `.gitignore` for a given language from GitHub via curl
39 |
40 | - `curl https://api.github.com/gitignore/templates/Rust`
41 | - the same with curlz: `curlz r https://api.github.com/gitignore/templates/Rust`
42 | - Add a placeholder that is interactively requested
43 | `curlz r 'https://api.github.com/gitignore/templates/{{ prompt_for("Language") | title }}'`
44 | - Now let's bookmark this request:
45 | ```sh
46 | curlz r --bookmark 'https://api.github.com/gitignore/templates/{{ prompt_for("Language") | title }}'
47 | Language: rust
48 | Please enter a bookmark name: gitignore
49 | ```
50 | - Finally, we can keep using the bookmark from now on: `curlz r gitignore`
51 |
52 | ## Template function documentation
53 |
54 | Please
55 | read [the book to learn more about the template functions](https://curlz-rs.github.io/curlz/template-functions.html#template-function-documentation)
56 |
--------------------------------------------------------------------------------
/curlz/.gitignore:
--------------------------------------------------------------------------------
1 | # Generated by Cargo
2 | # will have compiled files and executables
3 | /target/
4 |
5 | # These are backup files generated by rustfmt
6 | **/*.rs.bk
7 |
8 | /.curlz/
9 |
--------------------------------------------------------------------------------
/curlz/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 | All notable changes to this project will be documented in this file.
3 |
4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6 |
7 | ## [Unreleased]
8 |
9 | ## [0.1.0-alpha.12](https://github.com/curlz-rs/curlz/compare/v0.1.0-alpha.11...v0.1.0-alpha.12) - 2023-03-24
10 |
11 | ### Added
12 | - robuster jwt token generation (#87)
13 | - *(cli)* implement `-u | --user` request cli argument (#7) (#46)
14 | - *(template)* implement the basic auth template function (#7) (#33)
15 | - *(template)* support environment variables from process / shell (#30) (#31)
16 |
17 | ### Fixed
18 | - *(http-lang)* make grammar bit more robust (#82)
19 | - *(deps)* update rust crate jsonwebtoken to 8.3 (#73)
20 | - *(deps)* update rust crate jsonwebtoken to 8.2 (#66)
21 | - *(deps)* update rust crate pest_derive to 2.5 (#68)
22 | - *(http-lang)* make grammar bit more robust for trailing whitespaces (#63)
23 |
24 | ### Other
25 | - *(deps)* update rust crate rstest to 0.17 (#84)
26 | - release v0.1.0-alpha.11 (#71)
27 | - *(deps)* update rust crate predicates to v3 (#72)
28 | - *(deps)* update rust crate tempfile to 3.4 (#65)
29 | - release v0.1.0-alpha.10 (#53)
30 | - migrate to clap v4 (#54)
31 | - *(deps)* bump pest from 2.5.5 to 2.5.6 (#51)
32 | - release 0.1.0-alpha.9 (#45)
33 | - release (#43)
34 | - release (#39)
35 | - release 0.1.0-alpha.6 (#34)
36 | - release `0.1.0-alpha.5` (#29)
37 |
38 | ## [0.1.0-alpha.11](https://github.com/curlz-rs/curlz/compare/v0.1.0-alpha.10...v0.1.0-alpha.11) - 2023-03-15
39 |
40 | ### Fixed
41 | - *(deps)* update rust crate jsonwebtoken to 8.3 (#73)
42 | - *(deps)* update rust crate jsonwebtoken to 8.2 (#66)
43 | - *(deps)* update rust crate pest_derive to 2.5 (#68)
44 |
45 | ### Other
46 | - *(deps)* update rust crate predicates to v3 (#72)
47 | - *(deps)* update rust crate tempfile to 3.4 (#65)
48 | - release v0.1.0-alpha.10 (#53)
49 |
50 | ## [0.1.0-alpha.10](https://github.com/curlz-rs/curlz/compare/v0.1.0-alpha.9...v0.1.0-alpha.10) - 2023-03-14
51 |
52 | ### Added
53 | - *(cli)* implement `-u | --user` request cli argument (#7) (#46)
54 | - *(template)* implement the basic auth template function (#7) (#33)
55 | - *(template)* support environment variables from process / shell (#30) (#31)
56 |
57 | ### Fixed
58 | - *(http-lang)* make grammar bit more robust for trailing whitespaces (#63)
59 |
60 | ### Other
61 | - migrate to clap v4 (#54)
62 | - *(deps)* bump pest from 2.5.5 to 2.5.6 (#51)
63 | - release 0.1.0-alpha.9 (#45)
64 | - release (#43)
65 | - release (#39)
66 | - release 0.1.0-alpha.6 (#34)
67 | - release `0.1.0-alpha.5` (#29)
68 |
69 | ## [0.1.0-alpha.9](https://github.com/curlz-rs/curlz/compare/v0.1.0-alpha.8...v0.1.0-alpha.9) - 2023-03-05
70 |
71 | ### Added
72 | - *(cli)* implement `-u | --user` request cli argument (#7) (#46)
73 | - *(template)* implement the basic auth template function (#7) (#33)
74 | - *(template)* support environment variables from process / shell (#30) (#31)
75 |
76 | ### Other
77 | - release (#43)
78 | - release (#39)
79 | - release 0.1.0-alpha.6 (#34)
80 | - release `0.1.0-alpha.5` (#29)
81 |
82 | ## [0.1.0-alpha.8](https://github.com/curlz-rs/curlz/compare/v0.1.0-alpha.7...v0.1.0-alpha.8) - 2023-03-05
83 |
84 | ### Added
85 | - *(template)* implement the basic auth template function (#7) (#33)
86 | - *(template)* support environment variables from process / shell (#30) (#31)
87 |
88 | ### Other
89 | - release (#39)
90 | - release 0.1.0-alpha.6 (#34)
91 | - release `0.1.0-alpha.5` (#29)
92 |
93 | ## [0.1.0-alpha.7](https://github.com/curlz-rs/curlz/compare/v0.1.0-alpha.6...v0.1.0-alpha.7) - 2023-03-03
94 |
95 | ### Added
96 | - *(template)* implement the basic auth template function (#7) (#33)
97 | - *(template)* support environment variables from process / shell (#30) (#31)
98 |
99 | ### Other
100 | - release 0.1.0-alpha.6 (#34)
101 | - release `0.1.0-alpha.5` (#29)
102 |
103 | ## [0.1.0-alpha.6](https://github.com/curlz-rs/curlz/compare/v0.1.0-alpha.5...v0.1.0-alpha.6) - 2023-03-02
104 |
105 | ### Added
106 | - *(template)* implement the basic auth template function (#7) (#33)
107 | - *(template)* support environment variables from process / shell (#30) (#31)
108 |
109 | ### Other
110 | - release `0.1.0-alpha.5` (#29)
111 |
112 | ## [0.1.0-alpha.5](https://github.com/curlz-rs/curlz/compare/v0.1.0-alpha.4...v0.1.0-alpha.5) - 2023-02-28
113 |
114 | ### Added
115 | - *(template)* support environment variables from process / shell (#30) (#31)
116 |
--------------------------------------------------------------------------------
/curlz/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "curlz"
3 | authors = ["Sven Kanoldt