A command-line interface tool for interacting with the Rev API. This tool allows you to fetch contract information, manage projects, and perform various contract-related operations directly from your terminal.
Clone this repository and ensure you have Ruby installed:
git clone https://github.com/loedn/rev-cli.git
cd rev-cli
chmod +x cli.rb
This tool requires the following Ruby gems:
- thor
- json
- net/http
Install dependencies with:
gem install thor
You also need Revelio API running locally. To do that follow the instructions here.
The CLI tool provides several commands to interact with the Contract API.
A simple greeting command to test the CLI:
./cli.rb hello NAME
Example:
./cli.rb hello World
# Output: Hello, World!
Fetch and install a specific contract by its ID:
./cli.rb install CONTRACT_ID
Example:
./cli.rb install 1123
Fetch contracts related to projects:
- Fetch contracts for a specific project:
./cli.rb project PROJECT_ID
- Fetch all projects:
./cli.rb project
The CLI tool interacts with the following API endpoints:
http://localhost:3000/api/v1/contracts/{contract_id}
- Get a specific contracthttp://localhost:3000/api/v1/contracts/project/{project_id}
- Get contracts for a specific projecthttp://localhost:3000/api/v1/projects
- Get all projects
Contributions are welcome! Here's how you can contribute to this project:
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature-name
) - Make your changes
- Run tests if available
- Commit your changes (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature/your-feature-name
) - Open a Pull Request
To add a new command, extend the CLI
class in cli.rb
:
desc "command_name [ARGS]", "description of the command"
def command_name(args)
# Command implementation
end
- Follow Ruby style guidelines
- Add appropriate documentation for new features
- Include error handling for robustness