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-cligit 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 -iExamples 🧪
# 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-interfaceCreate 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 testsrc/
├── 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