cli
Command Line Interface tool for developing, building and securing Elvia applications β‘
πΎ Installation
Supported platforms:
- Windows
- macOS (Intel and M-series)
- Linux (any distribution)
Windows
Download the MSI file from the releases page and run it.
Linux/WSL and macOS
Download the tarball file for your platform (and optionally the MD5 cheksum) from the releases page,
extract it and move the binary to a directory in your PATH.
Example
# Optional: verify checksum first
md5sum -c 3lv-linux-amd64.tar.gz.md5
tar -xzf 3lv-linux-amd64.tar.gz
sudo install -Dm755 -t /usr/bin 3lv
π Requirements
To use every part of the 3lv CLI, you need to have these dependencies installed:
- Docker: used for building
- Helm: used for deploying
- kubectl: used for deploying
- Trivy: used for scanning Docker images
- Azure CLI: used for pushing to Azure Container Registry and deploying to Azure Kubernetes Service
- Google Cloud SDK: used for deploying to Google Kubernetes Engine
- GitHub CLI: used for pushing to GitHub Container Registry
Any of these dependencies can be skipped if you dont't use the subcommands that require them.
β Usage
3lv --help
Pushing to registries
If you want to push to a registry, you need to be authenticated to that registry.
Azure Container Registry
This is Elvia's default registry.
The CLI will automatically log you in if you have the Azure CLI installed.
GitHub Container Registry
Use the following command (with your GitHub username) to login:
gh auth token | docker login ghcr.io --username your-github-username --password-stdin
π Breaking changes
Before version v1.0.0 is released, breaking changes will happen in minor versions (and possibly also patch versions).
π Examples
Build
Build a Docker image for a .NET project
3lv build --project-file src/MyProject.csproj --system-name core my-cool-application
# or use shorthand
3lv build -f src/MyProject.csproj -s core my-cool-application
Build a Docker image for a .NET project and push it to Elvias registry
3lv build --project-file src/MyProject.csproj --system-name core --push my-cool-application
# or use shorthand
3lv build -f src/MyProject.csproj -s core -p my-cool-application
Build a Docker image for a Go project and push it to GitHub Container Registry
3lv build --project-file src/MyProject.csproj --system-name core --push --registry ghcr my-cool-application
# or use shorthand
3lv build -f src/MyProject.csproj -s core -p -r ghcr my-cool-application
Scan
Scan a Docker image for vulnerabilities
3lv scan my-cool-image
Scan a Docker image for critical vulnerabilities only
3lv scan --severity CRITICAL my-cool-image
# or use shorthand
3lv scan -S CRITICAL my-cool-image
Scan a Docker image for vulnerabilities and output the results to JSON and Markdown
3lv scan --formats json,markdown my-cool-image
# or use shorthand
3lv scan -F json,markdown my-cool-image
π§βπ» Development
Installation from source
Requires Go and Make.
Windows
Install WSL and follow the Linux instructions.
Optionally, you can build a Windows binary using the following command:
make build-windows-amd64
You can then move the binary to a directory in your PATH.
Linux and macOS
Ensure you have Go and Make installed:
sudo apt install golang make
Clone the repository and install the CLI:
git clone git@github.com:3lvia/cli
cd cli
sudo make install
macOS: If GOOS and GOARCH are not properly set, you can use this command:
# for Intel macs
sudo make install-macos-amd64
# for M1 and newer macs
sudo make install-macos-arm64
Running tests
Unit tests are written in Go and can be run with the following command:
make test
Linter
We use the linter golangci-lint and can be run with the following command:
make lint
Releasing a new version
Bump the number in the VERSION file and make a pull request.
When merged, the new version will be released automatically by GitHub Actions.