- Introduction
- Requirements
- Installation
- Documentation Publishing
- Usage
- Docker Image
- Local Development
- Image Development
- Contributing
A Cli for Curl Helpers
- PHP 8.1 or higher.
Install Zerotoprod\CurlHelperCli via Composer:
composer require zero-to-prod/curl-helper-cliThis will add the package to your project's dependencies and create an autoloader entry for it.
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/docsYou 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"
]
}
}Run this command to see the available commands:
vendor/bin/curl-helper-cli listReturns 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/statusSample 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"
}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:srcArguments: None
Example:
vendor/bin/curl-helper-cli curl-helper-cli:srcOutput:
https://github.com/zero-to-prod/curl-helper-cli
You can also run the cli using the docker image:
docker run --rm davidsmith3/curl-helper-cliContributions, 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.
