The power of curl, the ease of use of httpie.

Overview

Curlie

If you like the interface of HTTPie but miss the features of curl, curlie is what you are searching for. Curlie is a frontend to curl that adds the ease of use of httpie, without compromising on features and performance. All curl options are exposed with syntax sugar and output formatting inspired from httpie.

Install

Using homebrew:

brew install rs/tap/curlie

Using pkg:

pkg install curlie

Or download a binary package.

Usage

Synopsis:

$ curlie [CURL_OPTIONS...] [METHOD] URL [ITEM [ITEM]]

Simple GET:

Custom method, headers and JSON data:

Build

Build with goreleaser to test that all platforms compile properly.

goreleaser --snapshot --skip-publish --rm-dist

Or with go build for your current platform only.

go build .

Differences with httpie

  • Like curl but unlike httpie, headers are written on stderr instead of stdout.
  • Output is not buffered, all the formatting is done on the fly so you can easily debug streamed data.
  • Use the --curl option to print executed curl command.

License

All source code is licensed under the MIT License.

Issues
  • Allow plain curl input?

    Allow plain curl input?

    I like the output formatting or Curlie and also its HTTPie-like syntax sugar but sometimes, I have a curl command in my clipboard and would love to paste it to Curlie, something like this:

    curlie --raw -H 'Some-Header: ABC' https://example.com
    

    Do you think this would be possible? I can imagine some challenges around various curl flags but generally, it would be very useful if Curlie understood some of the basic curl switches.

    opened by borekb 5
  • Cut a new release for v1.4.1

    Cut a new release for v1.4.1

    Would you mind cutting a new release for v1.4.1?

    Tokens directly available at https://github.com/settings/tokens

    export GITHUB_TOKEN=xxxx
    
    git clone [email protected]:rs/curlie.git
    pushd curlie
        git tag -a v1.4.1 -m "Windows, color, and version updates"
        git push --tags
    
        goreleaser
    

    I realize that you've done this several times already, but I thought giving the copy/paste might make it more convenient.

    opened by coolaj86 4
  • Re: #22 add version output

    Re: #22 add version output

    • Add version from git tags (must be built with go generate ./...).
      curlie version
      
      curlie v1.4.1-pre0+dirty (2020-09-12T02:46:46-06:00)
      
    • Do not generate Linux-specific args.go on darwin.
    • Ignore xversion.go (so that clean tags will produce clean output)
    opened by coolaj86 4
  • How to tell installed version?

    How to tell installed version?

    I'm working on publishing curlie to https://webinstall.dev/curlie (and I'll PR as an additional install method once I'm done), but I need to know what version of curlie is presently installed to know whether or not to re-install a new version.

    How can I tell which version is the installed version?

    This gives me the curl version only:

    curlie --version
    
    opened by coolaj86 4
  • Allow disabling reading from `stdin`

    Allow disabling reading from `stdin`

    When using curlie in a script, I have an issue due those lines where it unconditionally tries to read from stdin, even if I try to close the standard input in my script before calling curlie.

    Due to the way the endpoint I'm trying to call works, this leads to a 404 because of it.

    A flag to disable that automatic behavior sounds like a good fix to me.

    opened by ambroisie 3
  • When using form params, transform values to form fields

    When using form params, transform values to form fields

    Httpie is smart enough to transform requests with the --form flag into actual form requests. Instead of parsing their arguments as JSON, they parse them as form fields. This commit enables the same thing for curlie

    Note: This is my first time using Go in any capacity and my mastery of curl is pretty lacking, so feel free to cancel this in favor of some other approach. I'm also open to any feedback

    opened by DonnieWest 3
  • Incorrect version info in `--version`

    Incorrect version info in `--version`

    curlie --version shows

    curl 7.82.0 (x86_64-pc-linux-gnu) libcurl/7.82.0 OpenSSL/1.1.1m zlib/1.2.11 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.2 libpsl/0.21.1 (+libidn2/2.3.0) libssh2/1.10.0 nghttp2/1.47.0
    Release-Date: 2022-03-05
    

    instead of

    curlie 1.6.7 (x86_64-pc-linux-gnu) libcurl/7.82.0 OpenSSL/1.1.1m zlib/1.2.11 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.2 libpsl/0.21.1 (+libidn2/2.3.0) libssh2/1.10.0 nghttp2/1.47.0
    Release-Date: 2022-03-05
    
    opened by ahmubashshir 2
  • curl option --aws-sigv4 values get interpreted as headers

    curl option --aws-sigv4 values get interpreted as headers

    When I am using the newer curl option aws-sigv4, curlie interprets it as headers:

    curlie https://REDACTED.execute-api.eu-west-1.amazonaws.com/REDACTED --curl --aws-sigv4 "aws:amz:eu-west-1" --user "$(aws configure get aws_access_key_id):$(aws configure get aws_secret_access_key)"
    
    curl --aws-sigv4 --user REDACTED:REDACTED -H aws:amz:eu-west-1 https://REDACTED.execute-api.eu-west-1.amazonaws.com/REDACTED -s -S -v -H "Accept: application/json, */*"
    
    opened by terlar 1
  • Fixed junk output in windows console. (#29)

    Fixed junk output in windows console. (#29)

    Fixed issue #29

    For windows runtime, added originalMode or ENABLE_VIRTUAL_TERMINAL_PROCESSING in SetConsoleMode, and if case of any error, disabled color print.

    opened by frzam 1
  • Command PATH security when calling curl program

    Command PATH security when calling curl program

    The current version of the code forwards all operations to curl using exec.Command which has been found to be vulnerable to an issue involving PATH lookups in untrusted directories that can lead to remote execution. The vulnerability is well described in the following blog post written by Russ Cox on Jan 19th, 2021 → Command PATH security in Go.

    opened by cixtor 1
  • workaround for Windows Stdin bug #12

    workaround for Windows Stdin bug #12

    Re: #12

    The very act of checking the status of os.Stdin (terminal.IsTerminal(0)) seems to cause it to open, and thus cause curlie to hang on Windows.

    Furthermore, neither cmd.exe nor Windows Terminal 1.0 are detected as Terminals.

    This patch will cause the IsTerminal(0) check to always return true on Windows, assuming that the reason the user has chosen curlie is to get the benefit of color and such (otherwise the check will always return false and it will behave as curl).

    There may be a better solution, but this is a definite improvement over the current non-working behavior.

    Manually tested on MacOS and Windows 10 to be reasonably sure that no bugs were introduced.

    Tested on MacOS:

    curlie https://example.com              # colored output, as expected
    curlie https://example.com | less       # colored output, as expected
    curlie https://example.com > foo.html   # plain output, as expected
    

    Tested on Windows 10:

    curlie https://example.com             # colored output in Windows Terminal
    curlie https://example.com | more      # colored output, as expected
    curlie https://example.com > foo.html  # plain output, as expected
    

    Note: cmd.exe cannot handle colors and outputs junk instead.

    opened by coolaj86 1
  • fix headers/body order in console

    fix headers/body order in console

    Normally curlie returns output like that (as expected):

    [[email protected] curlie (fix)]$ curlie localhost:8080
    HTTP/1.1 200 OK
    Date: Fri, 20 May 2022 19:35:04 GMT
    Content-Length: 30
    Content-Type: text/plain; charset=utf-8
    
    Hello
    Hello
    Hello
    Hello
    Hello
    

    But sometimes it returns like so: (around 5% of responses)

    [[email protected] curlie (fix)]$ curlie localhost:8080
    Hello
    Hello
    Hello
    Hello
    Hello
    HTTP/1.1 200 OK
    Date: Fri, 20 May 2022 19:35:40 GMT
    Content-Length: 30
    Content-Type: text/plain; charset=utf-8
    

    For me it only happens when querying localhost (probably because of the low latency??). This PR fixes it.

    opened by mateusz834 0
  • Warning: Calling bottle :unneeded is deprecated! There is no replacement.

    Warning: Calling bottle :unneeded is deprecated! There is no replacement.

    Warning: Calling bottle :unneeded is deprecated! There is no replacement.
    Please report this issue to the rs/tap tap (not Homebrew/brew or Homebrew/core):
      /opt/homebrew/Library/Taps/rs/homebrew-tap/curlie.rb:6
    

    reference: https://apple.stackexchange.com/questions/429492/warning-calling-bottle-unneeded-is-deprecated-there-is-no-replacement

    opened by cocoonkid 0
  • Details on error filtered out

    Details on error filtered out

    curlie is fantastic, however sometimes it seems some errors are hidden. For example, curl shows:

    $ command curl -OL https://get-ghcup.haskell.org | sh
    curl: Remote file name has no length!
    curl: (23) Failed writing received data to disk/application
    

    But, curlie shows

    $ curlie -OL https://get-ghcup.haskell.org | sh
    curl: (23) Failed writing received data to disk/application
    

    As I forgot I aliased curlie to curl, I assumed the error was something to do with my computer running out of storage, rather than the no-length remote file name or using the -O option on a file that didn't have the required metadata. Maybe the errors on curlie should match?

    Regards Edwin

    opened by hyperupcall 0
  • Feature request: file embedding (@file and =@file and :=@file)

    Feature request: file embedding (@file and [email protected] and :[email protected])

    opened by r-bar 0
Releases(v1.6.9)
Owner
Olivier Poitrey
Director of Engineering at Netflix Co-Founder & ex-CTO of Dailymotion Co-Founder of NextDNS
Olivier Poitrey
convert curl commands to Python, JavaScript, Go, PHP, R, Dart, Java, MATLAB, Rust, Elixir and more

curlconverter curlconverter transpiles curl commands into programs in other programming languages. $ curlconverter --data "Hello, world!" example.com

null 5.6k Jun 19, 2022
A tiny Nano wallet, focused on ease of use through simplicity

atto is a tiny Nano wallet, which focuses on ease of use through simplicity. Disclaimer: I am no cryptographer and atto has not been audited. I cannot

Richard Ulmer 33 Jun 11, 2022
CLI client for docat, Manage your docat documentation with ease.

docatl, the docat cli Manage your docat documentation with ease. Getting Started Download the latest Release binary for your platform and start pushin

null 11 May 24, 2022
Start Go command line apps with ease

Start Start Go command line apps with ease Executive Summary The start package for Go provides two basic features for command line applications: Read

Christoph Berger 15 Oct 29, 2021
An easy to use menu structure for cli applications that prompts users to make choices.

WMenu Package wmenu creates menus for cli programs. It uses wlog for its interface with the command line. It uses os.Stdin, os.Stdout, and os.Stderr w

Will Dixon 163 Jun 18, 2022
A wrapper around cd and xdg-open to use aliases to directory paths in terminal

CDD - Change directories Dynamically I am a lazy linux user and turns out that basic tab completion wasn't enough for me to navigate through my direct

Navdeep Singh Rathore 15 Apr 21, 2022
Simple and easy to use command line application written in Go for cleaning unnecessary XCode files.

xcclear Say hello to a few extra gigabytes of space on your Mac with xcclear, a simple and easy to use command line application written in Go for clea

null 54 Jun 16, 2022
Vim made in Go that you shouldn't use.

novavim This is my attempt at making Vim from scratch in Go, meaning this project will utilize no libs outside of the Go standard library: no ncurses,

Benji Nguyen 19 Mar 3, 2022
An easy-to-use cli tool for downloading manga

mangodl Download and search manga right from the terminal! Report Bug || Request Feature Table of Contents About the Project Built With Getting Starte

null 131 Jun 19, 2022
A CLI tool that you can use create regular backups of your Notion.so Pages.

notion-offliner A CLI tool that you can use create regular backups of your Notion.so Pages. Perfect for disaster scenarios and offline usage. MacOS an

Ned McClain 10 Apr 18, 2022
sg is the CLI tool that Sourcegraph developers can use to develop Sourcegraph.

sg is the CLI tool that Sourcegraph developers can use to develop Sourcegraph.

Sourcegraph 26 Jan 10, 2022
A simple CLI tool to use the _simulate API of elasticsearch to quickly test pipelines

elasticsearch-pipeline-tester A simple CLI tool to use the _simulate API of elasticsearch to quickly test pipelines usage: pipelinetester [<flags>] <p

Mario Castro 1 Oct 19, 2021
This tool is a CLI-interactive tool for TA who use eeclass platform

NTHU eeclass TA helper. This tool is a CLI-interactive tool for TA who use eeclass platform. It helps TA to download all the submitted homework, and use CSV to record the score and comment, and upload CSV score directly to the eeclass platform with just 2 Enter key!

Bo-Wei Chen 1 Dec 11, 2021
A simple CLI use to cleanup old folder

cleanup folder A simple CLI use to cleanup old folder Building $ go build $ ./cleanup Cleanup is a CLI application to remove old folder by max number

Nguyễn Đắc Toàn 0 Oct 30, 2021
A very basic cli keyring tool to use accross various OS.

A very basic cli keyring tool to use accross various OS.

Vianney Bouchaud 2 Feb 27, 2022
Use Golang to achieve better console backend services

Use Golang to achieve better console backend services

null 1 Dec 7, 2021
Easy to use CLI for cryptography

EDH (Encryption, Decryption, Hashing) Utility that aims to improve efficiency of encryption, decryption and hashing by making a simple to use CLI Writ

null 2 Nov 4, 2021
Easy to use library and CLI utility to generate Go struct from CSV files.

csv2struct Easy to use library and CLI utility to generate Go struct from CSV files. As a benefit, it's fully compatible with csvutil. So, structs gen

Ivan Maliovaniy 10 Jun 13, 2022
Use the command to convert arbitrary formats to Go Struct (including json, toml, yaml, etc.)

go2struct-tool Use the command to convert arbitrary formats to Go Struct (including json, toml, yaml, etc.) Installation Run the following command und

Afeyer 1 Dec 16, 2021