A blazing-fast, Postman-like API testing experience right in your terminal
Stop switching between terminal and GUI tools. API Tool brings the full power of API testing directly to your command line with:
- β‘ Lightning Speed: Test APIs in seconds, not minutes
- π― Zero Dependencies: Pure Bash with only
curlrequired - πΎ Smart Persistence: Save and reuse requests instantly
- π Beautiful Output: Color-coded responses with JSON formatting
- β¨οΈ Developer-First: Built by developers, for developers
- Features
- Quick Start
- Installation
- Usage Examples
- Commands
- Advanced Features
- Configuration
- Troubleshooting
- Contributing
- β All HTTP Methods: GET, POST, PUT, PATCH, DELETE
- β Smart Headers: Easy key:value input with validation
- β Request Bodies: JSON, plain text, with auto-validation
- β Auto-Timeouts: Lightning-fast workflow with smart defaults
- β Response Formatting: Pretty JSON with syntax highlighting
- π Request Collections: Save, list, run, and delete requests
- β‘ Speed Mode: Auto-defaults for common scenarios
- π¨ Color Output: Green success, red errors, blue info
- π± Cross-Platform: Linux, macOS, Windows (Git Bash/MINGW64)
- π‘οΈ Error Handling: Graceful failures with helpful messages
- π One-Command Testing:
./apitool.shand go - π‘ Intelligent Prompts: Context-aware input suggestions
- π Request Summary: See exactly what you're sending
- π JSON Validation: Real-time JSON syntax checking
# 1. Download
curl -O https://raw.githubusercontent.com/aine1100/ApiTester/main/apitool.sh
# 2. Make executable
chmod +x apitool.sh
# 3. Run immediately
./apitool.shThat's it! π You're ready to test APIs at terminal speed.
- bash (4.0+) - Standard on all modern systems
- curl - For HTTP requests
- jq (optional) - For JSON pretty-printing
π¦ Ubuntu/Debian
sudo apt update && sudo apt install -y curl jqπ macOS
# Using Homebrew
brew install curl jq
# Using MacPorts
sudo port install curl jqπͺ Windows
# Git Bash/MINGW64 (recommended)
# curl is usually pre-installed
# Install jq from: https://jqlang.github.io/jq/download/
# Or use Chocolatey
choco install jq# Option 1: Direct download
curl -L https://github.com/aine1100/ApiTester/raw/main/apitool.sh -o apitool.sh
chmod +x apitool.sh
# Option 2: Clone repository
git clone https://github.com/aine1100/ApiTester.git
cd apiTester
chmod +x apitool.sh
# Option 3: Add to PATH (recommended)
sudo cp apitool.sh /usr/local/bin/apitool$ ./apitool.sh
π Welcome to API Tool (Shell Edition)
Choose HTTP method: > 1
β
Method: GET
URL: https://api.github.com/users/octocat
β
Target: https://api.github.com/users/octocat
Add headers? (y/N): [auto: n]
Send now? (Y/n): [auto: y]
β
Sending...
Response:
β
Status: 200 OK
{
"login": "octocat",
"id": 1,
"name": "The Octocat",
"public_repos": 8
}
Save as? test-user
β
Saved as "test-user"Choose HTTP method: > 2
β
Method: POST
URL: https://jsonplaceholder.typicode.com/posts
Add headers? (y/N): y
Header 1: Content-Type: application/json
Header 2: [enter]
Add body? (y/N): y
Body: {"title": "My Post", "body": "Hello API!", "userId": 1}
β
Body: 54 chars
β
Valid JSON
Response:
β
Status: 201 Created
{
"id": 101,
"title": "My Post",
"body": "Hello API!",
"userId": 1
}# List all saved requests
$ ./apitool.sh list
π Saved Requests:
test-user: GET https://api.github.com/users/octocat
create-post: POST https://jsonplaceholder.typicode.com/posts
# Run a saved request
$ ./apitool.sh run test-user
βΉοΈ Running saved request: test-user
β
Sending...
# ... response output| Command | Description | Example |
|---|---|---|
./apitool.sh |
Interactive mode - Full guided experience | ./apitool.sh |
./apitool.sh run <name> |
Run saved request by name | ./apitool.sh run api-test |
./apitool.sh list |
List all saved requests | ./apitool.sh list |
./apitool.sh delete <name> |
Delete a saved request | ./apitool.sh delete old-test |
./apitool.sh help |
Show help and usage info | ./apitool.sh help |
# Quick API testing workflow
./apitool.sh # Test your API
./apitool.sh run my-endpoint # Repeat tests
./apitool.sh list # Manage saved requests
# Integration with other tools
./apitool.sh run auth-test && ./apitool.sh run data-fetchAPI Tool uses intelligent timeouts for lightning-fast workflows:
- Headers prompt: 5s timeout β defaults to "no headers"
- Body prompt: 5s timeout β defaults to "no body"
- Send confirmation: 3s timeout β defaults to "yes, send"
- Save prompt: 5s timeout β defaults to "don't save"
- π’ Green: Success messages, 2xx status codes
- π΄ Red: Errors, 4xx/5xx status codes
- π‘ Yellow: Warnings, input validation
- π΅ Blue: Information, headers, metadata
- π£ Cyan: Headers, section titles
Requests are stored in ~/.apitool/requests.json:
{
"my-api-test": {
"method": "GET",
"url": "https://api.example.com/data",
"headers": "Authorization: Bearer token",
"body": "",
"created": "2025-08-18T10:30:15Z"
}
}Without jq, API Tool gracefully falls back to:
- Plain text JSON output
- Simple file-based request storage
- Basic validation
# Customize config directory
export APITOOL_CONFIG_DIR="$HOME/.config/apitool"
# Adjust timeouts (seconds)
export APITOOL_HEADER_TIMEOUT=10
export APITOOL_BODY_TIMEOUT=30
export APITOOL_SEND_TIMEOUT=5~/.apitool/
βββ requests.json # Saved requests (with jq)
βββ requests_simple.txt # Fallback storage
βββ temp/ # Temporary files
Edit the script to customize:
- Colors and emojis
- Timeout values
- Default behaviors
- Output formats
π Common Issues & Solutions
# Debug mode
bash -x ./apitool.sh
# Check bash version
bash --version # Needs 4.0+
# Try with different read timeout
export APITOOL_TIMEOUT=10# Install jq
sudo apt install jq # Ubuntu/Debian
brew install jq # macOS
# Verify jq works
echo '{"test":true}' | jq .# Test curl directly
curl -I https://httpbin.org/get
# Check network connectivity
ping google.com
# Verify curl supports HTTPS
curl --version | grep -i ssl# Make executable
chmod +x apitool.sh
# Check script location
ls -la apitool.sh# Use Git Bash instead of CMD
# Ensure line endings are correct
dos2unix apitool.sh
# Test in PowerShell
powershell -c "./apitool.sh"π¨ Error Codes
| Exit Code | Description | Solution |
|---|---|---|
0 |
Success | π All good! |
1 |
Invalid input/arguments | Check command syntax |
2 |
Network/curl error | Verify URL and connectivity |
3 |
File/permission error | Check file permissions |
4 |
Missing dependency | Install curl/jq |
We love contributions! Here's how to get involved:
- Check existing issues
- Create a new issue with:
- Your OS and bash version
- Steps to reproduce
- Expected vs actual behavior
- Fork the repository
- Create a feature branch:
git checkout -b amazing-feature - Make your changes
- Test thoroughly
- Submit a pull request
git clone https://github.com/aine1100/apiTester.git
cd apitool
# Make changes
vim apitool.sh
# Test your changes
./apitool.sh
# Run tests (if available)
./test.sh- Keep it simple and fast
- Maintain cross-platform compatibility
- Add comments for complex logic
- Follow existing code style
- Test on multiple platforms
MIT License - see LICENSE file for details.
This means you can:
- β Use commercially
- β Modify and distribute
- β Use privately
- β Include in other projects
Built with β€οΈ for terminal enthusiasts everywhere
- Inspired by: Postman - The API testing gold standard
- Powered by: curl - The universal HTTP client
- Enhanced by: jq - The JSON processor
- Thanks to: The open-source community for endless inspiration
If API Tool saved you time, please β star this repo and share it with your team!
Happy API Testing! π
Report Bug β’ Request Feature β’ Contribute β’ Star β