| Crates.io | coman-cli |
| lib.rs | coman-cli |
| version | 1.3.0 |
| created_at | 2026-01-18 18:48:42.495903+00 |
| updated_at | 2026-01-24 22:10:13.605888+00 |
| description | Coman is a simple API manager designed to streamline API management and request sending. Can be used as a library or CLI. |
| homepage | |
| repository | https://github.com/bugyboo/coman |
| max_upload_size | |
| id | 2052848 |
| size | 150,120 |
____ / ___|___ _ __ ___ __ _ _ __ | | / _ \| '_ ` _ \ / _` | '_ \ | |__| (_) | | | | | | (_| | | | | \____\___/|_| |_| |_|\__,_|_| |_|
Coman is a simple API manager designed to streamline API management and request sending. It can be used as a CLI tool or as a Rust library in your own projects.
:?.Install from crates.io:
cargo install coman-cli
Clone the repository:
git clone https://github.com/bugyboo/coman
cd coman
Build the project:
cargo build --release
The binary will be available at target/release/coman.
Alternatively, you can run it directly with:
cargo run --release -- <args>
See the Wiki for examples. https://github.com/bugyboo/coman
coman [OPTIONS] <COMMAND>
Core Types:
CollectionManager - Manage collections and endpointsHttpClient - Make HTTP requestsHttpRequest - Build custom requestsHttpResponse - Response with status, headers, bodyCollection, Request, Method - Data modelsCollectionManager Methods:
new(file_path) - Create manager with optional custom fileadd_collection(name, url, headers) - Add/update collectionadd_endpoint(collection, name, path, method, headers, body) - Add/update endpointdelete_collection(name) - Delete a collectiondelete_endpoint(collection, endpoint) - Delete an endpointget_collection(name) - Get collection detailsget_endpoint(collection, endpoint) - Get endpoint detailslist_collections() - List all collectionsHttpClient Methods:
get(url), post(url), put(url), delete(url), patch(url) - Create requestsexecute_endpoint(manager, collection, endpoint) - Execute saved endpoint-h, --help: Print help-V, --version: Print versionlist)List all collections and endpoints.
Usage:
coman list [OPTIONS]
Options:
-c, --col <COL>: Specify a collection (default: all)-e, --endpoint <ENDPOINT>: Specify an endpoint (default: all)-q, --quiet: Quiet mode-v, --verbose: Verbose output-h, --help: Print helpman)Manage API collections and endpoints.
Usage:
coman man <COMMAND>
Commands:
Options:
-h, --help: Print helpreq)Send HTTP requests.
Usage:
coman req [OPTIONS] <COMMAND>
Commands:
Options:
-v, --verbose: Verbose output-s, --stream: Stream the request/response (read bytes from stdin and send as the request body or multipart data to the endpoint)-h, --help: Print helprun)Run endpoints from collections.
Usage:
coman run [OPTIONS] <COLLECTION> <ENDPOINT>
Options:
-v, --verbose: Verbose output-s, --stream: Stream the request/response (output response as bytes)-h, --help: Print helpurl)Print the request URL with headers and body.
Usage:
coman url <COLLECTION> <ENDPOINT>
Options:
-h, --help: Print helpAdd a new collection:
coman man col myapi http://api.example.com
coman man col myapi "http://api.example.com" -H "Content-Type: application/json" -H "x-api-key: xxx"
Add an endpoint to a collection:
coman man endpoint myapi users /users
coman man endpoint myapi users "/users" -H "Content-Type: application/json" -m POST -b "Hello!"
List all collections:
coman list
coman list -q
List endpoints in a specific collection:
coman list -c myapi
coman list -vc myapi
Send a GET request:
coman req get http://api.example.com/users
Send a POST request with a body:
coman req post http://api.example.com/users -b '{"name": "John"}'
Send a request with headers:
coman req get http://api.example.com/users -H "Authorization: Bearer token"
coman run myapi users
Coman supports interactive prompts for missing data using the :? placeholder. When a header value or request body contains :?, Coman will prompt you to enter the value at runtime. This is useful for sensitive data like tokens or dynamic values that change between requests.
If a header value contains :?, Coman will prompt for the correct value:
Create an endpoint with a placeholder in the header:
coman man endpoint myapi secure "/protected" -H "Authorization: Bearer :?"
When you run the endpoint, Coman will prompt:
coman run myapi secure
# Output: Header value for key 'Authorization' is missing data. Please provide the correct value:
# Enter your token and press Enter
If the request body contains :?, Coman will prompt for each placeholder:
Create an endpoint with placeholders in the body:
coman man endpoint myapi create-user "/users" -m POST -b '{"username": ":?", "email": ":?"}'
When you run the endpoint, Coman will prompt for each :?:
coman run myapi create-user
# Output: Missing data at position 14 - {"username": ":?", "email": ":?"}. Please provide the correct value:
# Enter "john_doe" and press Enter
# Output: Missing data at position 31 - {"username": "john_doe", "email": ":?"}. Please provide the correct value:
# Enter "john@example.com" and press Enter
You can also use placeholders in direct requests:
URL with placeholder:
coman req get "http://api.example.com/users/:?"
# Prompts for the user ID
Headers and body with placeholders:
coman req post "http://api.example.com/login" -H "X-API-Key: :?" -b '{"password": ":?"}'
# Prompts for API key, then password
Note: Prompting is disabled when using the
-s(stream) option to allow for non-interactive piped operations.
Coman supports reading request body from standard input when piping data. This is useful for sending JSON payloads or other data directly from files or other commands.
Send JSON data from a file as the request body:
cat data.json | coman run myapi send
Pipe output from another command as the request body:
echo '{"key": "value"}' | coman run myapi create
coman run myapi stream -s < file.bin
coman run myapi stream < file.bin // 'sent as multi-part'
coman run myapi post-data < file.json // 'send as body'
When data is piped to coman, it will override any body defined in the endpoint configuration.
To remove a header or clear the body from a collection or endpoint, use the update command with an empty value:
Remove a header from an endpoint:
coman man update myapi users -H "Authorization:"
Clear the body from an endpoint:
coman man update myapi users -b ""
For more help, use the help command with any of the subcommands:
coman help
coman man --help
coman req --help