5 Reasons You Should Be Using JFrog CLI
JFrog CLI is a useful compact client, which was developed in order to enhance and simplify command line interactions with JFrog products. In this blog post, I will present 5 reasons why you should be using JFrog CLI, and the most common use cases where it comes in handy with your Artifactory repository manager.
Reason 1: You need to back-up your file-systems
As most of your systems share a lot of the same binaries, generic repositories and checksum-based storage enable you to store your file-system backups in a smart and efficient way. Artifactory can be a centralized location to store file-system backups across your different servers or even personal computers.
- JFrog CLI can upload and download symlinks into your Artifactory repository, ensuring your linux file-system backups also includes the configured symlinks, and that your entire system can be restored.
Reason 2: You use Git LFS Repositories
When using a Git LFS repository, the common workflow of artifacts continuously being pushed to the repository can potentially max out your storage, as unreferenced files will remain in your repository forever.
- JFrog CLI can delete all of these unreferenced and unnecessary files that cannot be cleaned up using the Git client git-lfs-clean command.
See how you can easily clean up your Git LFS repositories with JFrog CLI.
Reason 3: You need a customized repository cleanup
While Artifactory provides some out-of-the-box cleanup methods, such as deleting complete versions, limiting the number of snapshots and deleting unused cached artifacts, we often need additional housekeeping methods that are specific to our use cases.
- JFrog CLI can delete artifacts that match certain File Spec patterns, as well as query delete candidates using AQL (Artifactory Query Language).
Read more about how you can utilize AQL with CLI for your cleanup strategies.
Reason 4: You don’t use Artifactory’s Build Integration feature
When integrated with your CI/CD pipeline, Artifactory serves as “the source of truth” for your complete build lifecycle. This is supported for all major CI servers, including Jenkins CI, TeamCity, Bamboo and Azure DevOps/TFS via external JFrog plugins.
- JFrog CLI extends this build integration capability to any tool by integrating with any development ecosystem, allowing you to build from any tool, collect all relevant information, and deploy the build information along with the artifacts to Artifactory.
Learn how to integrate JFrog CLI with a cloud-based CI server with these step-by step examples:
Reason 5: You script and automate REST APIs
Artifactory’s rich API covers all functionalities via REST endpoints.
While you can use REST API to deploy, resolve, delete, etc., sometimes you need additional automation capabilities to easily address your goals.
- JFrog CLI allows you to automate all of the above and more, by using the upload, download, delete, move and copy commands, all of which can be enhanced using wildcards or regular expressions with placeholders. This gives you a wide space to maneuver when looking for a specific solution.
In case all of the above is not enough, this can be enriched even more using File Specs, and other advanced functionalities such as: multi-threading, retries, and dry-runs.
There’s more than meets the eye
The specific use-cases described above are only 5 of the many additional functionalities you can achieve using JFrog CLI. Here are some additional references:
- AQL (Artifactory Query Language) – this powerful language can help you with custom made queries to use with JFrog CLI.
- Build Integration – allows you to natively build and publish build information to Artifactory, with integrations for Maven, Gradle, Docker, NPM, Nuget, GO, and generically.
JFrog CLI is an Open-Source project. We are always open for any ideas and contributions to our public GitHub: jfrog-cli-go.