Apix is a modern HTTP client for the command line.
MIT License
๐จ WARNING: ๐ง Apix is still in alpha/proof of concept state! ๐ง
Apix brings ideas from tools like Git
,Kubernetes
, Helm
,Httpie
.
Indeed it's is not just a simple HTTP client, Apix is :
> apix get https://apix.io/json
{
"id": 0,
"test": "hello"
}
> apix get https://apix.io/test.mp4
Downloading File test.mp4
๐ [00:00:28] [โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 14.98MiB/298.06MiB (549.87KiB/s, 8m)
> apix exec -f request.yaml
โ todoId ยท 1
? email ("[email protected]") โบ bad\gmail.com
โ Invalid input:
cause 0: "bad\gmail.com" is not a "email"
Coming soon:
apix 0.3.0
USAGE:
apix [OPTIONS] <SUBCOMMAND>
OPTIONS:
-h, --help Print help information
-v, --verbose print full request and response
-V, --version Print version information
SUBCOMMANDS:
completions generate shell completions
config configuration settings
ctl apix control interface for handling multiple APIs
delete delete an http resource
exec execute a request from the current API context
get get an http resource
head get an http resource header
help Print this message or the help of the given subcommand(s)
history show history of requests sent (require project)
init initialise a new API context in the current directory by using git
patch patch an http resource
post post to an http resource
put put to an http resource
Even if Apix allows you to use advanced mode by coupling it to a git repository and interpret openapi declarations (swagger), you also can use Apix as a replacement for curl, wget, httpie ...
Apix will colorize the output according to http content-type header information.
By default Apix will assume you are doing an API request using json.
> apix get https://jsonplaceholder.typicode.com/todos?_limit=1
or
> apix get https://jsonplaceholder.typicode.com/todos --query _limit:1
[
{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false
}
]
you can also ask for verbose mode where apix will show you the full sended http request and response :
> apix get -v https://jsonplaceholder.typicode.com/todos -q_limit:1
GET /todos?_limit=3 HTTP/1.1
host: jsonplaceholder.typicode.com
user-agent: apix/0.1.0
accept: application/json
accept-encoding: gzip
content-type: application/json
HTTP/1.1 200 OK
date: Sun, 21 Nov 2021 17:29:22 GMT
content-type: application/json; charset=utf-8
transfer-encoding: chunked
connection: keep-alive
access-control-allow-credentials: true
cache-control: max-age=43200
pragma: no-cache
expires: -1
etag: W/"136-fTr038fftlG9yIOWHGimupdrQDg"
[
{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false
}
]
Apix handle contexts gracefully. Contexts are named resources to handle:
apix ctl init MyContext
apix ctl switch OtherContext
apix ctl get contexts
apix ctl delete MyContext
apix-get
get an http resource
USAGE:
apix get [OPTIONS] <url>
ARGS:
<url> url to request, can be a 'Tera' template
OPTIONS:
-b, --body <body> set body to send with request, can be a 'Tera' template
-c, --cookie <cookie> set cookie name:value to send with request
-e, --env <variable> set variable name:value for 'Tera' template rendering
-f, --file <file> set body from file to send with request, can be a 'Tera' template
-h, --help Print help information
-H, --header <header> set header name:value to send with request
-i, --insecure allow insecure connections when using https
-q, --query <query> set query name:value to send with request
-v, --verbose print full request and response
Apix uses system proxy by default. System proxy is taken from HTTP_PROXY
and HTTPS_PROXY
environment variables.
You can ovverride system proxy manually, either with request annotations on manifest files or on the command line.
Apix support HTTP
, HTTPS
and SOCKS5
proxies.
Here are the options available for configuring the proxy on the command line :
-x, --proxy <url> set proxy to use for request
--proxy-login <login> set proxy login to use for request
--proxy-password <password> set proxy password to use for request
Here are the options available for configuting the proxy on manifests
metadata:
annotations:
apix.io/proxy-url: <url>
apix.io/proxy-login: <login>
apix.io/proxy-password: <paswword>
example URL for proxies:
HTTP | HTTPS | SOCKS5 |
---|---|---|
http://localhost:3128 | https://localhost:3128 | socks5://localhost:1080 |
type | persist mode | gitignore | description |
---|---|---|---|
config | file | no | from cli config |
requests | file | no | |
params | file | yes | auto saved from dialoguer |
results | file | yes | auto saved after execution |
cookies | file | yes | auto saved after execution, auto reused |
storage | file | yes | saved from request response |
secrets | web | N/A | from hashi corp vault |