Skip to content
/ gato Public

Go-based HTTP Client CLI using Cobra/Viper/Lipgloss

License

Notifications You must be signed in to change notification settings

Axl-91/gato

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gato CLI

HTTP Client on terminal, only for requests and responses in JSON

Roadmap

  • Set values
  • Store values in yaml
  • GET request
  • Better format for response
  • Show values (check command)
  • Clear values
  • Read file for json body
  • POST request
  • Add command to get values directly from yaml file
  • Add Authentication
  • Refactor commands
  • Add tests for every command

Commands

Set:

Set the values needed for the HTTP request

Flags:

  • Host (-H) The host, default: localhost

  • Path (-D) The path to use on host, default: None

  • Port (-P) The port for request, default: 4000

  • Method (-M) The method for request, default: GET

  • Body (-B) File to use as json body, default None

Set yaml:

With the command set yaml <yaml_file> you can add all the request values using a yaml file with the request values setted

Example

host: http://localhost
path: api/storage
port: 8080
method: GET
body: body.json

Check:

Displays the current values of the HTTP request.

If used without arguments, it lists all set values, if a specific parameter name is provided as an argument, it returns only the value for that parameter.

Clear:

Restore the values of the HTTP request to the values of the default.yaml provided.

If used without arguments, it restore all set values, if a specific parameter name is provided as an argument, it restore only the value for that parameter.

Send:

Send the HTTP request with the values that were set.

Files

gato.yaml

We'll use gato.yaml to save the values that were set for the HTTP requests.

host: http://127.0.0.1
path: ""
port: 8000
method: GET
body: ""

default.yaml

We'll use default.json to have the default parameters set in case we need to clear data.

{
  "host":"http://127.0.0.1",
  "path":"",
  "port":8000,
  "method":"GET",
  "body":""
}

Example:

gato set -H localhost.com -D api/todos -P 4000 -M GET -B body.json
gato send

Response

About

Go-based HTTP Client CLI using Cobra/Viper/Lipgloss

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages