Ritchie CLI is an open-source tool that allows to create, store and share any kind of automation, executing them through command lines, to run operations or start workflows ⚙️ 🖥 💡

codecov License

Ritchie logo with the phrase: Keep it simple

Table of contents

1. About

2. Getting Started

i. Installation

ii. Initialize rit locally

iii. Add your first formulas repository

iv. Run the Hello World formula

v. Usage

3. Cheat Sheet

4. Documentation

5. Code of Conduct

6. Contributing

7. License

8. Community

About

All your automations in one place

Ritchie CLI is an open source project that allows to create, store and share automations, executing them through command lines.

A customizable CLI automation tool

This repository contains the CLI core, which can execute formulas stored inside other repositories such as ritchie-formulas or ritchie-formulas-demo.

In Ritchie's context, a formula is a script that can be executed automatically or interactively through a command line.

Adapting an existing script to Ritchie structure allows you to run it locally or through Docker, and to share it on a Git repository.

Formulas explanation

🚀 Getting started

Installation

1️⃣ Install rit latest version

Linux

curl -fsSL https://commons-repo.ritchiecli.io/install.sh | bash

MacOS

curl -fsSL https://commons-repo.ritchiecli.io/install.sh | bash

Windows

winget install Ritchie-CLI

You can also download rit packages or specific versions according to the OS on the documentation

2️⃣ Initialize rit locally

rit init

Note: You need to import the commons repository to be able to create formulas.

3️⃣ Add your first formulas repository

To access the "hello-world" formula, you need to add the ritchie-formulas-demo repository locally.

To do so, you can use the rit add repo command manually on your terminal, or execute the command line below with input flags:

rit add repo --provider="Github" --name="demo" --repoUrl="https://github.com/ZupIT/ritchie-formulas-demo" --priority=1

4️⃣ Run the Hello World formula

Execute the "hello-world" formula through the command line below:

rit demo hello-world

Note: This formula has been implemented using Golang, so to use it locally you'll need Golang to be installed on your machine. If you don't have or don't want to install Golang, you can use the same command with Docker:

rit demo hello-world --docker

Usage

gif containing the command demonstration

Cheat Sheet

Ritchie CLI Cheat Sheet

📚 Documentation

You can find Ritchie's documentation on our website.

🤝 Contributing

Feel free to use, recommend improvements, or contribute to new implementations.

Check out our contributing guide to learn about our development process, how to suggest bug fixes and improvements.

Check out other guides:

Developer Certificate of Origin - DCO

This is a security layer for the project and for the developers. It is mandatory.

Follow one of these two methods to add DCO to your commits:

1. Command line Follow the steps: Step 1: Configure your local git environment adding the same name and e-mail configured at your GitHub account. It helps to sign commits manually during reviews and suggestions.

git config --global user.name “Name”
git config --global user.email “[email protected]

Step 2: Add the Signed-off-by line with the '-s -S' flag in the git commit command:

$ git commit -s -S -m "This is my commit message"

2. GitHub website You can also manually sign your commits during GitHub reviews and suggestions, follow the steps below:

Step 1: When the commit changes box opens, manually type or paste your signature in the comment box, see the example:

$ git commit -m “My signed commit” Signed-off-by: username <email address>

For this method, your name and e-mail must be the same registered to your GitHub account.

Code of Conduct

Please follow the Code of Conduct in all your interactions with our project.

License

Apache License 2.0.

Community

Feel free to reach out to us at:

If you have any questions or ideas, let's chat in our Zup Open Source Forum.

Comments
  • [FIX] Windows Installer no longer requires admin privilege

    [FIX] Windows Installer no longer requires admin privilege

    - What I did

    • Created a customized wix template with "perUser" installation (the default uses "perMachine") with limited privileges
    • Removed shortcut creation (Doesn't make sense to create a shortcut for a CLI tool without a embedded bash)
    • Removed the ico.ico (No shortcut, no icon needed)
    • Added regedit HKCU, enforcing no administrator required (HKEY_CURRENT_USER->Software->ZupIT->rit)
    • Added the necessary parameters to windows circleci script for template generation

    - How to verify it

    • Build a new version and install in a user without Admin privileges (Worked with local build, need to test with automated build)

    - Description for the changelog

    • Windows Installer no longer requires admin privilege
  • [FEATURE] Path for win bin download

    [FEATURE] Path for win bin download

    - What I did

    • Add path https://commons-repo.ritchiecli.io/latest/ritchiecli.msi

    - How to verify it

    • Generate release or run pipeline qa
    • in qa https://ritchie-cli-bucket234376412767550.s3-sa-east-1.amazonaws.com/latest/ritchiecli.msi
    • in release https://commons-repo.ritchiecli.io/latest/ritchiecli.msi

    - Description for the changelog

    • Add path https://commons-repo.ritchiecli.io/latest/ritchiecli.msi
  • Prompt to auto rebuild formula on source modifications

    Prompt to auto rebuild formula on source modifications

    - What I did Now, when there are changes in a formula, Ritchie will ask the user whether he wants to run it as is or recompile it automatically before running

    - How to verify it

    • Run any formula to have its first build generated
    • Modify its source files
    • Run it again, you'll be asked to rebuild it rit2

    - Description for the changelog Prompt to auto rebuild formula on source modifications

    Closes #559

  • [fix] Signature bin windows

    [fix] Signature bin windows

    - What I did

    • Resolve fix signature bin windows

    - How to verify it

    • run pipeline and generate bin windows

    - Description for the changelog

    • Resolve fix signature bin windows
  • [fix] del in uninstaller hook win

    [fix] del in uninstaller hook win

    - What I did

    • Fix del in hook uninstaller win

    - How to verify it

    • uninstall bin ritchie

    - Description for the changelog

    • Fix del in hook uninstaller win
  • Remove formula tmp dir

    Remove formula tmp dir

    Description

    The need to copy the formula to a temporary folder has been removed, thus reducing the necessary IO when executing a formula.

    How to verify it

    This improvement should not change the functionality of the rit.

    Changelog

    Performance - remove tmp dir to formulas

  • [FEATURE] Build formula with Ritchie-cli

    [FEATURE] Build formula with Ritchie-cli

    - What I did I created a new command rit build formulas to build formulas locally. rit-build-formula

    - How to verify it

    • Run the command rit build formulas to build formulas, you can run the command with the --watch flag rit build formulas --watch and get real-time updates.
    • Run tests with the command make unit-test

    - Description for the changelog Created the build.go and watcher.go to build and watch your formulas locally.

  • Feature - input autocomplete

    Feature - input autocomplete

    Description

    Added input autocomplete(https://github.com/JoaoDanielRufino/go-input-autocomplete) to all workspaces input. Also, I added the option type path on config.json to include this input

    How to verify it

    Run any formula with type path on config.json or any command that requires the user to enter the path to their workspaces. Hit tab key to autocomplete the path. Example of config.json:

    "inputs": [
        {
          "label": "Type your path: ",
          "name": "rit_path",
          "type": "path",
          "required": true
        }
      ]
    

    Changelog

    Input Autocomplete

  • Added update All for repo

    Added update All for repo

    - What I did

    Added an option "ALL" for rit update repo, which allows users to update all the repositories in one go. Fixes issue #594

    - How to verify it

    By running it locally after changes. ritUpdate

    - Description for changelog

    Added update ALL for repo.

  • Implementing delete local repo

    Implementing delete local repo

    - What I did I've implemented a functionality for the command rit delete repo whitch show the local repository for deleting. The local repo option will only showed if the folder local exists on rit user's folder. I used de local folder as a param to show or not the option, since local repository is not really a repository, and is not listed on repositories.json file.

    - How to verify it You can run the rit delete repo command on your terminal, and if your local repository exists it will be listed to be deleted.

    - Description for the changelog Show the option to delete your local repo on rit delete repo command.

    - Important Considerations I noticed that after you delete your local repo, Ritcher will not build or run your local formula, even if already exists on your workspace. The user will need to execute the command rit build formula to this formula be available again. It would be greate to have some command that build all the formulas of a repository all at once.

  • Create a context validator for credential inputs

    Create a context validator for credential inputs

    What would you like to be added:

    Thinking about Ritchie CLI use for company solutions. It would be great to add a context validator inside the config.json file.

    The idea would be to add a optional field inside the current CREDENTIAL inputs structure to check the context in which this credential has to be set for the specific formula.

    Example:

    "inputs": [ 
        { 
            "name": "git_user", 
            "type": "CREDENTIAL_GITHUB_USERNAME",
            "context": "PROD"
        },
        { 
            "name": "git_email", 
            "type": "CREDENTIAL_GITHUB_EMAIL",
            "context": "PROD" 
        },
        { 
            "name": "git_token", 
            "type": "CREDENTIAL_GITHUB_TOKEN",
            "context": "PROD"
        } 
    ]
    

    If the "context" field is not defined, the value will be extract from the current user local context. But if it is set, it will be necessary to check if the specified context exists.

    Why is this needed:

    • To guaranty some formulas can only be executed on a specific context.
  • Autocomplete taking a long time to start terminal

    Autocomplete taking a long time to start terminal

    What happened: when ritchie autocomplete is present on my .zshrc file, my 'bash' session takes around 30 seconds to be ready to use.

    What you expected to happen: That there is no delay as big as this at the beginning of my Bash session.

    How to reproduce it (as minimally and precisely as possible): ritchie autocomplete needs to be in start script. ~/.zshrc

    [[ -r /usr/local/bin/rit ]] && rit completion zsh > ~/.rit_completion
    source ~/.rit_completion
    

    Anything else we need to know?:

    I have benchmarked my bash to find the source of problem, and It seems that the problem occurred in the rit conclusion zsh.

    With ritchie autocomplete, start in almost 30 seconds.

    ~ hyperfine --shell zsh 'source ~/.zshrc'
    Benchmark 1: source ~/.zshrc
      Time (mean ± σ):     24.987 s ± 11.152 s    [User: 0.200 s, System: 0.039 s]
      Range (min … max):    0.454 s … 30.219 s    10 runs
    

    Testing ritchie autocomplete command in my .zshrc

    ~ hyperfine 'rit completion zsh > ~/.rit_completion'
    Benchmark 1: rit completion zsh > ~/.rit_completion
      Time (mean ± σ):     24.987 s ± 11.152 s    [User: 0.200 s, System: 0.039 s]
      Range (min … max):    0.454 s … 30.219 s    10 runs
    

    Without ritchie autocomplete, start in 205ms.

    ~ hyperfine --shell zsh 'source ~/.zshrc'
    Benchmark 1: source ~/.zshrc
      Time (mean ± σ):     199.7 ms ±   2.0 ms    [User: 180.8 ms, System: 31.5 ms]
      Range (min … max):   197.6 ms … 205.4 ms    14 runs
    

    Environment:

    • Ritchie version (use rit --version): 2.11.3
    • Operating System: Linux (Ubuntu 22.04 LTS)
    • Network plugin / Tool and version (if this is a network-related / tool bug):
    • Others:
  • Install script does not take system architecture into account

    Install script does not take system architecture into account

    What happened: Installed ritchicli on armbian x64 and the install script didn't even notice that I'm on arm-based linux

    What you expected to happen: Either the install script should inform the user that this architecture is not supported or you can provide binaries for different architectures

    How to reproduce it (as minimally and precisely as possible): Try installing ritchicli on different linux architectures

    Environment:

    • Ritchie version (use rit --version): 2.11.3
    • Operating System: Armbian x64
    • Network plugin / Tool and version (if this is a network-related / tool bug):
    • Others:
  • updating horusec workflow to use release candidate

    updating horusec workflow to use release candidate

    Signed-off-by: Nathan Martins [email protected]

    Description

    The idea of ​​this PR is for Zup open source projects to collaborate with each other during test releases. For that, this pull request changes the Horusec installation to fetch the latest version between the candidate release and the latest version. That way, if the release candidate has a bug, we can identify it before it's released.

    How to verify it

    Changelog


    This pull request generated the following artifacts.

    To test the health and quality of this implementation, download the respective binary for your operating system, unzip and directly run the binary like the examples below.

    • Windows Download the file: rit-windows.zip Unzip to some folder like: C:\home\user\downloads\pr1064 Access the folder: cd C:\home\user\downloads\pr1064 Directly call the binary: .\rit.exe --version or .\rit.exe name of formula

    • Linux Download the file: rit-linux.zip Unzip to some folder like: /home/user/downloads/pr1064 Access the folder: cd /home/user/downloads/pr1064 Assign execute permission to binary: chmod +x ./rit Directly call the binary: ./rit --version or ./rit name of formula

    • MacOS Download the file: rit-macos.zip Unzip to some folder like: /home/user/downloads/pr1064 Access the folder: cd /home/user/downloads/pr1064 Assign execute permission to binary: chmod +x ./rit Directly call the binary: ./rit --version or ./rit name of formula

    Generated at Wed Jan 05 2022 18:43:40 GMT+0000 (Coordinated Universal Time)

  • Test/env error cases

    Test/env error cases

    Description

    This PR adds the error test cases to the env commands.

    Close #981

    How to verify it

    Checking the env command test workflow.

    Changelog

    Add error test cases to env commands


    This pull request generated the following artifacts.

    To test the health and quality of this implementation, download the respective binary for your operating system, unzip and directly run the binary like the examples below.

    • Windows Download the file: rit-windows.zip Unzip to some folder like: C:\home\user\downloads\pr1054 Access the folder: cd C:\home\user\downloads\pr1054 Directly call the binary: .\rit.exe --version or .\rit.exe name of formula

    • Linux Download the file: rit-linux.zip Unzip to some folder like: /home/user/downloads/pr1054 Access the folder: cd /home/user/downloads/pr1054 Assign execute permission to binary: chmod +x ./rit Directly call the binary: ./rit --version or ./rit name of formula

    • MacOS Download the file: rit-macos.zip Unzip to some folder like: /home/user/downloads/pr1054 Access the folder: cd /home/user/downloads/pr1054 Assign execute permission to binary: chmod +x ./rit Directly call the binary: ./rit --version or ./rit name of formula

    Generated at Thu Oct 28 2021 03:02:08 GMT+0000 (Coordinated Universal Time)

  • Test/credential error cases

    Test/credential error cases

    Description

    This PR adds the error test cases to the credential commands.

    Close #980

    How to verify it

    Checking the credential command test workflow.

    Changelog

    Add error test cases to credential commands


    This pull request generated the following artifacts.

    To test the health and quality of this implementation, download the respective binary for your operating system, unzip and directly run the binary like the examples below.

    • Windows Download the file: rit-windows.zip Unzip to some folder like: C:\home\user\downloads\pr1053 Access the folder: cd C:\home\user\downloads\pr1053 Directly call the binary: .\rit.exe --version or .\rit.exe name of formula

    • Linux Download the file: rit-linux.zip Unzip to some folder like: /home/user/downloads/pr1053 Access the folder: cd /home/user/downloads/pr1053 Assign execute permission to binary: chmod +x ./rit Directly call the binary: ./rit --version or ./rit name of formula

    • MacOS Download the file: rit-macos.zip Unzip to some folder like: /home/user/downloads/pr1053 Access the folder: cd /home/user/downloads/pr1053 Assign execute permission to binary: chmod +x ./rit Directly call the binary: ./rit --version or ./rit name of formula

    Generated at Thu Oct 28 2021 02:55:38 GMT+0000 (Coordinated Universal Time)

  • Make the ritchie available in the chocolatey

    Make the ritchie available in the chocolatey

    What would you like to be added: When migrating the deploy process from CircleCI to GitHub actions, it was verified that the package from Ritchie to chocolatey is not generated.

    Therefore, it is interesting to check why it is not generated and adjusts.

    Why is this needed: So that Ritchie is also available via the choco command.

Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows to specify a set query-per-second load and record latency histograms and other useful stats.
Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows to specify a set query-per-second load and record latency histograms and other useful stats.

Fortio Fortio (Φορτίο) started as, and is, Istio's load testing tool and now graduated to be its own project. Fortio is also used by, among others, Me

Jan 2, 2023
CLI tool to mock TCP connections. You can use it with Detox, Cypress or any other framework to automatically mock your backend or database.

Falso It is a CLI that allows you to mock requests/responses between you and any server without any configuration or previous knowledge about how it w

Sep 23, 2022
End to end functional test and automation framework
End to end functional test and automation framework

Declarative end to end functional testing (endly) This library is compatible with Go 1.12+ Please refer to CHANGELOG.md if you encounter breaking chan

Jan 6, 2023
Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.

?? Playwright for API reference | Example recipes Playwright is a Go library to automate Chromium, Firefox and WebKit with a single API. Playwright is

Jan 1, 2023
A Devtools driver for web automation and scraping

Overview Documentation | API reference Rod is a high-level driver directly based on DevTools Protocol. It's designed for web automation and scraping.

Dec 30, 2022
Test your code without writing mocks with ephemeral Docker containers 📦 Setup popular services with just a couple lines of code ⏱️ No bash, no yaml, only code 💻

Gnomock – tests without mocks ??️ Spin up entire dependency stack ?? Setup initial dependency state – easily! ?? Test against actual, close to product

Dec 29, 2022
This testing tool surrounds go-ethereum with cannon to catch the blocks of retesteth going into go-ethereum and test cannon with them

Siege This testing tool surrounds go-ethereum with cannon to catch the blocks of retesteth going into go-ethereum and test cannon with them. Usage Sta

Mar 15, 2022
Flugel Test Documentation for steps to run and test the automatio
Flugel Test Documentation for steps to run and test the automatio

Flugel Test Documentation Documentation for steps to run and test the automation #Test-01 1 - Local Test Using Terratest (End To End) 1- By runing " t

Nov 13, 2022
How we can run unit tests in parallel mode with failpoint injection taking effect and without injection race

This is a simple demo to show how we can run unit tests in parallel mode with failpoint injection taking effect and without injection race. The basic

Oct 31, 2021
ESME is a go library that allows you to mock a RESTful service by defining the configuration in json format

ESME is a go library that allows you to mock a RESTful service by defining the configuration in json format. This service can then simply be consumed by any client to get the expected response.

Mar 2, 2021
Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary.
Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary.

Selenoid Selenoid is a powerful implementation of Selenium hub using Docker containers to launch browsers. Features One-command Installation Start bro

Jan 5, 2023
Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test
Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test

embedded-postgres Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test. When testing this provides

Dec 27, 2022
manage your mocks / run mockgen more quickly / mocks up-to-date checking
manage your mocks / run mockgen more quickly / mocks up-to-date checking

gomockhandler If you find any bugs or have feature requests, please feel free to create an issue. gomockhandler is handler of golang/mock, as the name

Dec 30, 2022
A lightweight load balancer used to create big Selenium clusters
A lightweight load balancer used to create big Selenium clusters

Go Grid Router Go Grid Router (aka Ggr) is a lightweight active load balancer used to create scalable and highly-available Selenium clusters. Articles

Dec 28, 2022
Create your own mock server with just a JSON file!

Gmocker Run a blazing fast mock server in just seconds! ?? All you need is to make a json file that contains path and response mapping. See an example

Dec 21, 2022
Create your own blazing fast mock server with just a JSON file!

Gmocker Run a blazing fast mock server in just seconds! ?? All you need is to make a json file that contains path and response mapping. See an example

Dec 21, 2022
Create all possible binaries from go files

gopher-build-all Create all possible binaries of a project in go ChangeLog 0.0.2 Flags bin-folder-name ─ With this flag you can rename the output dire

Dec 8, 2022
Test your command line interfaces on windows, linux and osx and nodes viá ssh and docker

Commander Define language independent tests for your command line scripts and programs in simple yaml files. It runs on windows, osx and linux It can

Dec 17, 2022
Ditto is a CLI testing tool that helps you verify if multiple HTTP endpoints have the same outputs.

Ditto is a CLI testing tool that helps you verify if multiple HTTP endpoints have the same outputs.

Nov 24, 2021