zero-to-prod/curl-helper-cli

A Cli for Curl Helpers

v1.2.0 2025-02-04 00:00 UTC

This package is auto-updated.

Last update: 2025-09-02 01:21:48 UTC


README

Repo GitHub Actions Workflow Status GitHub Actions Workflow Status GitHub Actions Workflow Status Packagist Downloads php Packagist Version License wakatime Hits-of-Code

Contents

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.

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a new Pull Request.