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.
- 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.
- C++23-compatible compiler (e.g., GCC 12+, Clang 16+)
libcurl
for HTTP requestsjsoncpp
for JSON parsing- CMake 3.25+ for building the project
-
Clone the Repository:
git clone https://github.com/genyleap/FCLI.git cd FCLI
-
Configure and Build:
mkdir build && cd build cmake .. cmake --build .
-
Run the Executable:
./fcli help
-
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 } }
-
Set Custom Hub Address:
./fcli set-hub https://mycustomhub.com
Example Output:
[INFO] Hub URL updated to: https://mycustomhub.com
-
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
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
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add new feature"
- Push to the branch:
git push origin feature-name
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Developed by C O M P Ξ Z (compez.eth) as part of the Genyleap initiative. 🎉
- libcurl for HTTP requests
- jsoncpp for JSON parsing
- The Farcaster ecosystem for their open API standards
---