A powerful CLI tool built with Rust for exploring, testing, and understanding APIs. APIGrok CLI helps developers quickly interact with any APIs and comprehend their structure.
- Interactive API exploration with TUI interface
- HTTP methods support: GET, POST, PUT, DELETE, PATCH
- Authentication helpers for OAuth, JWT, Basic Auth
- Response visualization with syntax highlighting
- Request history and collections
- Environment variables support
- Code generation for multiple languages
- OpenAPI/Swagger integration
cargo install apigrok-cli
git clone https://github.com/apigrok/apigrok-cli.git cd apigrok-cli cargo install --path .
Quick Start π
# Make a GET request
apigrok fetch https://api.example.com/usersapigrok [METHOD] URL [OPTIONS] METHOD: get, post, put, delete, patch (default: get)
| Option | Description |
|---|---|
| -d, --data | Request body data |
| -H, --header | Add custom header |
| -q, --query | Add query parameters |
| -e, --env | Use environment file |
| -o, --output | Output format (json, yaml, table) |
| --save | Save request to collection |
| --docs | Generate API documentation |
Launch the terminal user interface:
apigrok -i
Examples π§ͺ
# GET request with query parameters apigrok fetch "https://api.example.com/search?q=rust" # POST with JSON body and headers apigrok post https://api.example.com/auth \ -d '{"username": "user", "password": "pass"}' \ -H "Content-Type: application/json" # Generate TypeScript interface from response apigrok get https://api.example.com/users/1 --output ts-interface
Create a ~/.apigrok/config.toml file for persistent settings:
toml Copy [default] output = "json" theme = "dark" [auth.prod] type = "bearer" token = "your_token_here" [env.prod] base_url = "https://api.example.com/v1"
We welcome contributions! Please read our Contributing Guidelines for details.
-
Fork the repository
-
Create your feature branch (
git checkout -b feature/AmazingFeature) -
Commit your changes (
git commit -m 'Add some AmazingFeature') -
Push to the branch (
git push origin feature/AmazingFeature) -
Open a Pull Request
git clone https://github.com/apigrok/apigrok-cli.git cd apigrok-cli cargo build cargo test
src/ βββ main.rs # CLI entry point βββ commands/ # Command implementations βββ protocols/ # Protocol implementations βββ utils/ # Helper functions βββ config/ # Configuration handling
- Basic HTTP client functionality
- Interactive TUI mode
- WebSocket support
- GraphQL query builder
- Plugin system for extensions
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by tools like Postman, httpie, and curl
- Built with amazing Rust crates: reqwest, clap, serde, tui-rs