fcli
fcli copied to clipboard
Provide a quickstart command to install fcli
Enhancement Request
The TL/DR explanation:
Provide a "quickstart" command that makes it easy to install fcli. We could provide something like:
curl <URL_TO_INSTALL_SCRIPT> | bash
Detailed explanation:
FCLI is currently a standalone binary and we allow for users to determine where they want to "install" the fcli binary. I believe that there is a large population of users who simply don't want to think about something like that and would like a simpler way to just get the latest version of FCLI.
Even with other popular projects, they provide an installation script that will:
- download the latest version
- add it to directory at a known (documented) location
- possibly add that directory to the PATH environment variable
- possibly update the current user's bashrc file to persist the PATH variable update
- perform additional sanity checks if needed
Adding on to this idea, if we make the installation script available from the git repo, then we can provide a one-liner in the README to make it super simple for users and devops people to download/install the latest version.
For example:
- Publish the installation script to the github repo, or create a gist.
- Update the README with a new Quickstart section that provides the following command
curl <URL_TO_INSTALL_SCRIPT> | bash
Inside the installation script, I've found that the following command works well to retrieve the latest version of fcli (for Linux). Please note that this does not make any use of non-standard tools like jq to maintain portability:
curl -s https://api.github.com/repos/fortify/fcli/releases/latest | grep "browser_download_url" | cut -d : -f 2,3 | tr -d \" | grep -Po "https://github.com/fortify/fcli/releases/download/v?[\d\.]+/fcli-linux.tgz$" | xargs curl -OL
For completeness, here's the one-liner for downloading a specific version of fcli:
export FCLI_VERSION="v2.6.0"; curl -OL "https://github.com/fortify/fcli/releases/download/${FCLI_VERSION}/fcli-linux.tgz"
The potential benifits of this would be:
- Easier, quicker, and reproducable installations of fcli.
- Easier for customers to install the latest version of fcli from CI/CD pipelines.
- Ability for us to add in additional installation logic just in case there are additional "migration steps" that need to be done when upgrading from one fcli version to another.
Potential pitfalls:
- An equivilent command for Powershell (Windows) might also need to be created, but we can probably worry about that later.
Examples of other projects offering this method of installation:
- Helm: https://helm.sh/docs/intro/install/#from-script
- K3D: https://k3d.io/v5.7.3/#install-current-latest-release