Skip to content

Simple REST API Command Line Interface Utility

License

Notifications You must be signed in to change notification settings

dhaifley/apictl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

apictl

A simple REST API command line interface utility.

Usage

Usage: apictl [<option>] <command> <resource> [<query>]

Options:
  --help = Display this usage message
  --version = Display the command version
  --config.endpoint = Base endpoint URL of the API request
  --config.format = (json|yaml) Format of the command input and output
  --config.headers = Optional, HTTP headers to include with the API request
  --config.tls = Optional, TLS options to use for the API request
  
Commands:
  get
  post, create
  put, update
  patch
  delete
  option, head

Resources:
  Any resource or ID provided by the API. Multiple parameters will be combined
as path segments in the API request.

Query Parameters:
  Any parameters beginning with -- will be sent as query parameters with the API
request. For example, --param=value will be sent as ?param=value.

Examples

$ apictl --config.format='yaml' \
--config.endpoint='https://example.com/v1/api' \
--config.tls='{"InsecureSkipVerify":true}' \
--config.headers='{"Authorization":["token"]}' \
get users --search='and(email:dev*)' --size=1
created_at: 1721923211
created_by: null
data: null
email: [email protected]
first_name: null
last_name: null
status: active
updated_at: 1721923211
updated_by: null
user_id: [email protected]
$ apictl --config.format='yaml' \
--config.endpoint='https://example.com/v1/api' \
--config.tls='{"InsecureSkipVerify":true}' \
--config.headers='{"Authorization":["token"]}' \
get user [email protected]
created_at: 1721923211
created_by: null
data: null
email: [email protected]
first_name: null
last_name: null
status: active
updated_at: 1721923211
updated_by: null
user_id: [email protected]

Building

$ go build -o apictl main.go

About

Simple REST API Command Line Interface Utility

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages