A command line HTTP client that is easy to use
Project description
Talkie
A convenient command-line HTTP client for interacting with APIs and web services. Talkie makes working with HTTP in the terminal simple and human-friendly thanks to intuitive syntax and beautiful formatted output.
Quick Start
# Install
pip install talkie
# Make your first request
talkie get https://jsonplaceholder.typicode.com/posts/1
๐บ See demo output
$ talkie get https://jsonplaceholder.typicode.com/posts/1
HTTP/1.1 200 OK
Content-Type: application/json
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occasi...",
"body": "quia et suscipit\nsuscipit recusandae consequuntur..."
}
Contents
- Quick Start
- Features
- Why Talkie?
- Comparison with Alternatives
- Installation
- Usage
- Configuration Management
- Development
- FAQ
- Troubleshooting
- License
- Contributing
Features
- ๐ Intuitive syntax for working with HTTP requests
- ๐ Beautiful colored output with syntax highlighting
- ๐ก Automatic content type detection (JSON, XML, HTML)
- ๐ OpenAPI specification inspection for convenient API work
- ๐ Curl command generation for compatibility
- ๐ Automatic data formatting (JSON, XML, HTML, Markdown)
- ๐ Environment support for working with different APIs
- ๐ Save and reuse headers and tokens
- ๐พ Save responses to files
- ๐งฐ Full support for all HTTP methods
- ๐ WebSocket connections for bidirectional communication
- ๐ GraphQL requests for working with GraphQL APIs
- ๐ Request history for reuse and analysis
- โก Parallel request execution for improved performance
Why Talkie?
Talkie combines the best of both worlds: the simplicity of HTTPie and the power of curl, while adding features that neither offers out of the box.
When to choose Talkie over HTTPie:
- You need GraphQL โ Talkie has a dedicated
graphqlcommand with query files and variables - You work with WebSocket โ built-in
wscommand, no extra tools - You explore OpenAPI specs โ inspect endpoints, schemas, and generate examples
- You run parallel requests โ batch API calls with configurable concurrency
- You want searchable history โ find, repeat, and export past requests
When to choose Talkie over curl:
- You prefer human-friendly syntax โ
talkie post /users name=Johnor-F name=Johninstead of raw-d - You want colored, formatted output โ JSON/XML/HTML with syntax highlighting
- You need environments โ switch between dev/staging/prod with one config
- You don't want to remember curl flags โ intuitive
-H,-q,-ooptions
Unique Features
| Feature | Description |
|---|---|
| GraphQL | Native talkie graphql with query files, variables, and introspection |
| WebSocket | talkie ws for real-time connections, no separate client needed |
| OpenAPI | Inspect specs, list endpoints, generate request examples |
| Parallel requests | talkie parallel for batch execution with concurrency control |
| Request history | Search, repeat, export/import โ full audit trail of your API work |
Comparison with Alternatives
| Feature | Talkie | HTTPie | curl | wget |
|---|---|---|---|---|
| Intuitive syntax | โ | โ | โ | โ ๏ธ |
| Colored output | โ | โ | โ | โ |
| JSON/XML formatting | โ | โ | โ | โ |
| GraphQL | โ | โ | โ ๏ธ | โ |
| WebSocket | โ | โ | โ | โ |
| OpenAPI inspection | โ | โ | โ | โ |
| Parallel requests | โ | โ | โ | โ ๏ธ |
| Request history | โ | โ ๏ธ | โ | โ |
| Environment config | โ | โ ๏ธ | โ | โ |
| Curl command generation | โ | โ ๏ธ | โ | โ |
| Pre-installed | โ | โ | โ | โ |
| Python API | โ | โ | โ | โ |
Legend: โ Yes | โ ๏ธ Partial/Manual | โ No | โ N/A
Installation
From PyPI
pip install talkie
This also installs the http console script: http GET https://example.com is translated to talkie get โฆ (HTTPie-style verb first).
From source code
git clone https://github.com/craxti/talkie.git
cd talkie
pip install -e .
Usage
Basic Requests
# GET request
talkie get https://api.example.com/users
# POST request with JSON body (httpie-style: after URL use key=value / key:=json, or -F)
talkie post https://api.example.com/users name=John age:=30 is_admin:=true
# same with explicit -F:
talkie post https://api.example.com/users -F name=John -F age:=30 -F is_admin:=true
# PUT request
talkie put https://api.example.com/users/1 -F name=Peter
talkie put https://api.example.com/users/1 name=Peter
# DELETE request
talkie delete https://api.example.com/users/1
Headers and Parameters
# Adding headers
talkie get https://api.example.com/users \
-H "Authorization: Bearer token123" \
-H "Accept: application/json"
# Query parameters
talkie get https://api.example.com/users -q "page=1" -q "limit=10"
# Save response to file
talkie get https://api.example.com/users -o users.json
Output and Formatting
# Verbose output
talkie get https://api.example.com/users -v
# JSON only
talkie get https://api.example.com/users --json
# Headers only
talkie get https://api.example.com/users --headers
# Response formatting
talkie get https://api.example.com/users --format json
talkie get https://api.example.com/users -f xml
Curl Command Generation
# Generate curl command for request
talkie curl https://api.example.com/users -H "Authorization: Bearer token123"
# Add curl command to regular request
talkie get https://api.example.com/users --curl
# Build curl with method, headers, and query (no network)
talkie curl https://api.example.com/users -X POST -H "Content-Type: application/json" -q page=1
# Run a pasted curl one-liner
talkie from-curl 'curl -s https://httpbin.org/get'
# Guided tour (GET + pretty output + history)
talkie demo
OpenAPI Inspection
# Inspect OpenAPI specification from URL
talkie openapi https://api.example.com/openapi.json
# Inspect local specification file
talkie openapi ./openapi.yaml
# Show only endpoints
talkie openapi https://api.example.com/openapi.json --endpoints
# Generate request examples
talkie openapi https://api.example.com/openapi.json --examples
File Formatting
# Format JSON file
talkie format data.json
# Format and save to file
talkie format data.json -o formatted.json
# Format with specific type
talkie format data.txt -t json
WebSocket
# Connect to WebSocket server
talkie ws wss://echo.websocket.org
# Send message
talkie ws wss://echo.websocket.org --send "Hello"
# Connect with headers
talkie ws wss://api.example.com/ws \
-H "Authorization: Bearer token123"
GraphQL Requests
# Simple query
talkie graphql https://api.example.com/graphql \
-q "query { users { id name } }"
# Query from file
talkie graphql https://api.example.com/graphql -f query.graphql
# Query with variables
talkie graphql https://api.example.com/graphql \
-f query.graphql -v id=123 -v limit=10
Request History
# Show history
talkie history list
# Show last 10 requests
talkie history list --limit 10
# Search history
talkie history search --method GET --url users
# Repeat request from history
talkie history repeat 1a2b3c4d
# Search in history
talkie history search --method GET --url users
# Export history to file
talkie history export history.json
# Import history from file
talkie history import history.json
# Clear all history
talkie history clear --yes
# Advanced search (time range, status band, host)
talkie history search --domain api.example.com --status-min 400 --status-max 599 --sort desc
# Optional SQLite store (better for very large history)
# export TALKIE_HISTORY_BACKEND=sqlite
# export TALKIE_HISTORY_FILE=~/.talkie/history.sqlite
Parallel Request Execution
# Execute requests from file
talkie parallel -f requests.txt
# File with requests (requests.txt) has format:
# GET https://api.example.com/users/1
# GET https://api.example.com/users/2
# POST https://api.example.com/users -F name=John
# POST https://api.example.com/users name=John age:=30
# Execute multiple requests with parallelism limit
talkie parallel -f requests.txt --concurrency 5
# Use delay between requests
talkie parallel -f requests.txt --delay 0.5
# Save results to separate files
talkie parallel -f requests.txt --output-dir ./results
# Execute multiple requests to one URL
talkie parallel -X GET -u "/users/1" -u "/users/2" -u "/posts/1" -b "https://api.example.com"
Configuration Management
Configuration File
Talkie uses ~/.talkie/config.json file for storing settings. The file is created automatically on first run.
You can create the file manually:
mkdir -p ~/.talkie
cat > ~/.talkie/config.json << EOF
{
"default_headers": {
"User-Agent": "Talkie/0.2.1",
"Accept": "application/json"
},
"environments": {
"dev": {
"name": "dev",
"base_url": "https://dev-api.example.com",
"default_headers": {
"Authorization": "Bearer dev-token"
}
},
"prod": {
"name": "prod",
"base_url": "https://prod-api.example.com",
"default_headers": {
"Authorization": "Bearer prod-token"
}
}
},
"active_environment": "dev"
}
EOF
Configuration file location can be changed using TALKIE_CONFIG_DIR environment variable.
Environment Management
Environments allow storing settings for different APIs and quickly switching between them.
Example of using environment:
# Using base URL from active environment
talkie get /users
# Equivalent to (if active environment is dev)
talkie get https://dev-api.example.com/users
Configuration Examples
Multiple Headers for All Requests
{
"default_headers": {
"User-Agent": "Talkie/0.2.1",
"Accept": "application/json",
"X-API-Key": "your-api-key"
}
}
Multiple Environment Setup
{
"environments": {
"github": {
"name": "github",
"base_url": "https://api.github.com",
"default_headers": {
"Authorization": "token ghp_xxxxxxxxxxxx"
}
},
"gitlab": {
"name": "gitlab",
"base_url": "https://gitlab.com/api/v4",
"default_headers": {
"PRIVATE-TOKEN": "glpat-xxxxxxxxxxxx"
}
}
},
"active_environment": "github"
}
Development
Requirements
- Python 3.8+
- httpx
- typer
- rich
- pydantic
- pyyaml
- openapi-spec-validator
- pygments
- xmltodict
- html2text
- websockets
Project Structure
talkie/
โโโ __init__.py # Package
โโโ __main__.py # Entry point
โโโ cli/ # Command line interface
โ โโโ __init__.py
โ โโโ main.py # Command definitions
โโโ core/ # Application core
โ โโโ __init__.py
โ โโโ client.py # HTTP client
โ โโโ request_builder.py
โ โโโ response_formatter.py
โ โโโ websocket_client.py # WebSocket client
โโโ utils/ # Helper modules
โโโ __init__.py
โโโ config.py # Configuration management
โโโ formatter.py # Data formatting
โโโ curl_generator.py
โโโ openapi.py
โโโ graphql.py # GraphQL support
โโโ history.py # Request history
โโโ colors.py
โโโ logger.py
Running Tests
# Install development dependencies
pip install -e ".[dev]"
# Run all tests
pytest
# Run tests for specific module
pytest tests/test_formatter.py
# Run with coverage
pytest --cov=talkie
Pre-commit Hooks
pip install pre-commit
pre-commit install
# Hooks run automatically on git commit (black, isort, mypy)
Documentation Site
pip install -e ".[dev]"
mkdocs serve
# Open http://127.0.0.1:8000
API Documentation
Documentation is available in the docs/ folder and via mkdocs serve:
- CLI Reference โ Complete command-line options
- API Reference โ Python API
- Architecture โ System design
- Development Setup โ Dev environment
- Development Tools โ Pre-commit, pytest, etc.
It contains detailed description of all Talkie API components:
- HTTP client and request builder
- WebSocket client
- Utilities for formatting and working with various formats
- GraphQL request interface
- Components for storing and managing request history
FAQ
How to save response to file?
Use -o or --output option:
talkie get https://api.example.com/data -o response.json
How to use OAuth token?
Add Authorization header:
talkie get https://api.example.com/profile -H "Authorization: Bearer YOUR_TOKEN"
Or save it in configuration:
{
"environments": {
"myapi": {
"base_url": "https://api.example.com",
"default_headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
},
"active_environment": "myapi"
}
How to work with WebSocket in async scenarios?
Talkie provides Python API for working with WebSocket:
import asyncio
from talkie.core.websocket_client import WebSocketClient
async def main():
client = WebSocketClient("wss://echo.websocket.org")
await client.connect()
await client.send("Hello")
response = await client.receive()
print(f"Received: {response.data}")
await client.disconnect()
asyncio.run(main())
How to execute complex GraphQL query?
Save query to file and pass it to command:
talkie graphql https://api.example.com/graphql -f complex_query.graphql -v id=123 -v limit=10
Troubleshooting
SSL certificate verification failed
If you get SSLError or certificate errors when connecting to HTTPS:
# For development only โ disable SSL verification (not recommended for production)
talkie get https://api.example.com --insecure
Command not found: talkie
Ensure Talkie is installed and in your PATH:
pip install talkie
# Or with user install:
pip install --user talkie
# Verify:
which talkie
Colors not displaying in terminal
Some terminals don't support colors. Try:
# Force colored output
export FORCE_COLOR=1
talkie get https://api.example.com/users
# Or disable colors
talkie get https://api.example.com/users --no-color
Config file not found
Talkie uses ~/.talkie/config.json by default. Override with:
export TALKIE_CONFIG_DIR=/path/to/your/config
talkie get /users
Timeout errors
Increase timeout for slow APIs:
talkie get https://api.example.com/slow-endpoint --timeout 60
License
MIT
Contributing
Contributions are welcome! Please create issues and pull requests on GitHub.
- Fork the repository
- Create a branch with your changes
- Submit a pull request
Code guidelines:
- Use black for code formatting
- Add type hints
- Write tests for new functionality
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file talkie-0.2.1.tar.gz.
File metadata
- Download URL: talkie-0.2.1.tar.gz
- Upload date:
- Size: 5.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f018db1d438ae247104f89697f2778f99cf0af29ce6c7e084389037af1839cde
|
|
| MD5 |
224abbdfdcb5c2364eda25316fe94cf9
|
|
| BLAKE2b-256 |
0ce24e41c29f0e7e52dde04d07f27f10d8c1aa7f7c4e3625cf3bf91abd934239
|
File details
Details for the file talkie-0.2.1-py3-none-any.whl.
File metadata
- Download URL: talkie-0.2.1-py3-none-any.whl
- Upload date:
- Size: 68.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84f711e17f6f2934a1d462b2057883bac7bd0faf01a12b9ca4f80bd6fe6065c0
|
|
| MD5 |
a22aa4dd099a82511ba3897df7480fbb
|
|
| BLAKE2b-256 |
2d52e9adb727ed17b6c7e8f18548d5af197fac4c7dacc167a951aa6d734e61ba
|