Skip to content
/ rev-cli Public

Reference implementation for Revelio's web api

License

Notifications You must be signed in to change notification settings

Loedn/rev-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Apr 4, 2025
6cbd5d0 · Apr 4, 2025

History

6 Commits
Apr 4, 2025
Apr 4, 2025
Apr 4, 2025

Repository files navigation

Rev CLI Tool

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.

Installation

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

Dependencies

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.

Usage

The CLI tool provides several commands to interact with the Contract API.

Hello Command

A simple greeting command to test the CLI:

./cli.rb hello NAME

Example:

./cli.rb hello World
# Output: Hello, World!

Install Command

Fetch and install a specific contract by its ID:

./cli.rb install CONTRACT_ID

Example:

./cli.rb install 1123

Project Command

Fetch contracts related to projects:

  1. Fetch contracts for a specific project:
./cli.rb project PROJECT_ID
  1. Fetch all projects:
./cli.rb project

API Endpoints

The CLI tool interacts with the following API endpoints:

  • http://localhost:3000/api/v1/contracts/{contract_id} - Get a specific contract
  • http://localhost:3000/api/v1/contracts/project/{project_id} - Get contracts for a specific project
  • http://localhost:3000/api/v1/projects - Get all projects

Contributing

Contributions are welcome! Here's how you can contribute to this project:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/your-feature-name)
  3. Make your changes
  4. Run tests if available
  5. Commit your changes (git commit -m 'Add some feature')
  6. Push to the branch (git push origin feature/your-feature-name)
  7. Open a Pull Request

Adding New Commands

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

Coding Standards

  • Follow Ruby style guidelines
  • Add appropriate documentation for new features
  • Include error handling for robustness

About

Reference implementation for Revelio's web api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages