Skip to content

RhydianJenkins/apix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

APIX (API eXecuter)

apix is a CLI HTTP client that manages requests across multiple API environments.

It handles authentication, domain switching, and OpenAPI Specification (OAS) integration with a simple YAML config file.

✨ Features

  • Manage API domains
  • Store credentials in yaml
  • OAS support
  • Endpoint <tab> completions

📦 Getting Started

go install github.com/rhydianjenkins/apix@latest
Want to build from source instead?
# fetch the project
git clone https://github.com/rhydianjenkins/apix && cd apix

# then build from source
go build -o apix && ./apix

# or run with nix
nix run

🚀 Usage

API eXecuter (APIX) is a CLI tool to manage API domains and make requests

Usage:
  apix [command] [flags]
  apix [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  delete      Send a DELETE request to the active domain
  edit        Open config in your $EDITOR
  get         Send a GET request to the active domain
  help        Help about any command
  list        List all domain names saved in config
  new         Create a new API domain
  patch       Send a PATCH request to the active domain
  post        Send a POST request to the active domain
  put         Send a PUT request to the active domain
  remove      Remove a domain from the config
  switch      Sets the active domain to the specified name

Flags:
  -h, --help   help for apix

Use "apix [command] --help" for more information about a command.

❓ FAQ

How do I send a request body?

apix aims to make use of pipelines as much as possible and takes the request body from stdin.

# Make a POST request to {base}/users with `my_req_body.json` as a body
cat my_req_body.json | apix post /users
How do I enable shell completion?

If you haven't already, add your completion directory to fpath:

# in .zshrc, or wherever
fpath=($HOME/.local/zsh-completions $fpath)
compinit

Then generate the completion script:

# if you're using zsh...
apix completion zsh > ~/.local/zsh-completions/_apix
How do I get it working with OAS?

APIX can do:

  • json and yaml spec formats
  • openapi versions 3.0.0 and 3.1.0
  • remote and local specs

You can specify which spec belongs to which domain in config:

apix new myapi https://api.example.com --oas "https://api.example.domain/myOAS.json"
# ... or
apix new myapi https://api.example.com --oas "/local/path/to/myOAS.yaml"

Assuming you've set up shell completions, you should be able to <tab> complete your endpoints!

About

API eXecuter is a CLI HTTP client that manages requests across multiple API environments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published