zero-to-prod / curl-helper-cli
A Cli for Curl Helpers
Fund package maintenance!
Github
Requires
- php: >=8.1
- ext-curl: *
- ext-json: *
- symfony/console: ^7.2
- zero-to-prod/curl-helper: ^1.0
- zero-to-prod/data-model: ^81.9
- zero-to-prod/package-helper: ^1.1.3
Requires (Dev)
- phpunit/phpunit: <12.0
This package is auto-updated.
Last update: 2025-09-02 01:21:48 UTC
README
Contents
- Introduction
- Requirements
- Installation
- Documentation Publishing
- Usage
- Docker Image
- Local Development
- Image Development
- Contributing
Introduction
A Cli for Curl Helpers
Requirements
- PHP 8.1 or higher.
Installation
Install Zerotoprod\CurlHelperCli
via Composer:
composer require zero-to-prod/curl-helper-cli
This will add the package to your project's dependencies and create an autoloader entry for it.
Documentation Publishing
You can publish this README to your local documentation directory.
This can be useful for providing documentation for AI agents.
This can be done using the included script:
# Publish to default location (./docs/zero-to-prod/curl-helper-cli) vendor/bin/zero-to-prod-curl-helper-cli # Publish to custom directory vendor/bin/zero-to-prod-curl-helper-cli /path/to/your/docs
Automatic Documentation Publishing
You can automatically publish documentation by adding the following to your composer.json
:
{ "scripts": { "post-install-cmd": [ "zero-to-prod-curl-helper-cli" ], "post-update-cmd": [ "zero-to-prod-curl-helper-cli" ] } }
Usage
Run this command to see the available commands:
vendor/bin/curl-helper-cli list
Available Commands
curl-helper-cli:parse-header
Returns the headers of a curl request as a JSON response.
Description: This command makes a HTTP request to the specified URL and parses the response headers into a structured JSON format.
Usage:
vendor/bin/curl-helper-cli curl-helper-cli:parse-header <url>
Arguments:
url
(required): The request URI to fetch headers from
Examples:
# Get headers from a website vendor/bin/curl-helper-cli curl-helper-cli:parse-header https://httpbin.org/get # Get headers from an API endpoint vendor/bin/curl-helper-cli curl-helper-cli:parse-header https://api.github.com/users/octocat # Get headers from a local development server vendor/bin/curl-helper-cli curl-helper-cli:parse-header http://localhost:8000/api/status
Sample Output:
{ "Content-Type": "application/json", "Content-Length": "234", "Server": "nginx/1.18.0", "Date": "Mon, 01 Jan 2024 12:00:00 GMT", "Cache-Control": "no-cache, private" }
curl-helper-cli:src
Displays the project source link.
Description: A simple command that outputs the GitHub repository URL for this project.
Usage:
vendor/bin/curl-helper-cli curl-helper-cli:src
Arguments: None
Example:
vendor/bin/curl-helper-cli curl-helper-cli:src
Output:
https://github.com/zero-to-prod/curl-helper-cli
Docker Image
You can also run the cli using the docker image:
docker run --rm davidsmith3/curl-helper-cli
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.