Skip to content

Latest commit

 

History

History
162 lines (120 loc) · 3.71 KB

README.md

File metadata and controls

162 lines (120 loc) · 3.71 KB

README.md for FCLI

FCLI

forthebadge

FCLI is a powerful, extensible, and thread-safe command-line interface (CLI) tool for interacting with APIs, particularly those following the Farcaster hub protocol. It allows users to query data, execute commands, and dynamically configure hub addresses with ease. Designed with modern C++ standards (C++23), it ensures high performance and stability.


Features

  • Dynamic Hub Configuration: Supports setting custom hub addresses via commands.
  • Thread-Safe Operations: Ensures reliable and safe execution in multi-threaded environments.
  • JSON Pretty-Printing: Parses and formats JSON responses for better readability.
  • Verbose Mode: Enables detailed debugging information for API requests.
  • Extensibility: Built with modular design principles, allowing easy addition of new features.

Getting Started

Prerequisites

  • C++23-compatible compiler (e.g., GCC 12+, Clang 16+)
  • libcurl for HTTP requests
  • jsoncpp for JSON parsing
  • CMake 3.25+ for building the project

Build Instructions

  1. Clone the Repository:

    git clone https://github.com/genyleap/FCLI.git
    cd FCLI
  2. Configure and Build:

    mkdir build && cd build
    cmake ..
    cmake --build .
  3. Run the Executable:

    ./fcli help

Usage

Basic Commands

  1. Fetch Hub Information:

    ./fcli /v1/info dbstats=1

    Example Output:

    [INFO] Executing command with URL: https://hub.pinata.cloud/v1/info?dbstats=1
    [INFO] Response:
    {
        "version": "1.0.0",
        "dbStats": {
            "collections": 12,
            "documents": 456789
        }
    }
    
  2. Set Custom Hub Address:

    ./fcli set-hub https://mycustomhub.com

    Example Output:

    [INFO] Hub URL updated to: https://mycustomhub.com
    
  3. Help:

    ./fcli help

    Example Output:

    [INFO] Available Commands:
      /v1/info  - Fetch hub information.
      /v1/reactions - Fetch reactions for a cast or user.
      set-hub <hub_url> - Set a custom hub address.
    
    Example:
      ./fcli /v1/info dbstats=1
      ./fcli set-hub https://mycustomhub.com
    

Project Structure

FCLI/
├── sources/
│   ├── logger.cpp          # Implementation of Logger class
│   ├── network.cpp         # Implementation of Network class
│   ├── fcli.cpp            # Implementation of FCLI class
│   ├── logger.hpp          # Thread-safe logging utilities
│   ├── network.hpp         # Network request handler
│   ├── fcli.hpp            # CLI logic
├── CMakeLists.txt          # Build configuration
├── README.md               # Project documentation

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature-name
  3. Commit your changes:
    git commit -m "Add new feature"
  4. Push to the branch:
    git push origin feature-name
  5. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Author

Developed by C O M P Ξ Z (compez.eth) as part of the Genyleap initiative. 🎉


Acknowledgments

  • libcurl for HTTP requests
  • jsoncpp for JSON parsing
  • The Farcaster ecosystem for their open API standards

---