Skip to content
/ fcli Public
generated from genyleap/Project-Template

FCLI is a versatile command-line tool for interacting with APIs, especially Farcaster hubs. Built with modern C++23, it supports querying data, executing commands, and dynamic hub configuration. Thread-safe and extensible, FCLI ensures high performance, stability, and ease of use for developers and power users.

License

Notifications You must be signed in to change notification settings

genyleap/fcli

Repository files navigation

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

---

About

FCLI is a versatile command-line tool for interacting with APIs, especially Farcaster hubs. Built with modern C++23, it supports querying data, executing commands, and dynamic hub configuration. Thread-safe and extensible, FCLI ensures high performance, stability, and ease of use for developers and power users.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published