The Emerge CLI
If you've read our previous blog post about Bring Your Own Snapshots, you might have noticed that we now have an official CLI for Emerge! This is long overdue and we have many exciting features planned to make Emerge easier to use.
Our CLI is distributed as a Ruby Gem. To get started, you can install the CLI using the following command:
gem install emerge
And once installed, you can run the help command to see what's available:
emerge --help
Our vision
Much of our existing tooling is geared towards CI integration, whether through our Fastlane and Gradle plugins or manually calling the API. A typical CI flow involves building your app and then uploading it to Emerge. Then, we analyze the app and report results back to the originating pull request.
Part of the CLI's functionality will be geared towards making the Emerge integration easier. But the CLI also addresses a current limitation of Emerge: we can only see what's included in your upload.
Emerge analyzes the compiled result of an app, meaning we have limited knowledge of the source code. We can suggest insights to fix for the app, but we rely on the developer to implement the fixes. And we can't suggest fixes tailored to the codebase itself, only generalized suggestions that won't work for every project.
Now, with a CLI, we can finally get the best of both worlds and do much more. Our vision is to make using Emerge as easy as possible, and also provide commands that an everyday mobile developer can find useful.
Current functionality
Snapshot Testing: BYO Snapshots
Our Snapshots product is used everyday by companies like OpenAI and we wanted to expand it to support more use-cases and libraries. With the CLI, you can upload snapshot tests from popular libraries like Paparazzi, Roborazzi, or swift-snapshot-testing snapshots to take advantage of Emerge's infrastructure and UI.
For example, in our Hacker News app, supporting swift-snapshot-testing is as easy as:
emerge upload snapshots \
--name "HackerNews Swift-Snapshot-Testing" \
--id "com.emerge.hn.Hacker-News.swiftsnapshottesting" \
--repo-name "EmergeTools/hackernews" \
--client-library swift-snapshot-testing \
--project-root .
Check out the full docs and announcement post to give it a try!
Deleting Unused Code: Reaper
Reaper allows teams like Duolingo to detect unused code in their apps using runtime analysis. Once you detect unused code you often want to delete it, but our users consistently report that this process involves a lot of back and forth between looking at our report and finding the files in your project.

This is a perfect use-case where our CLI can help make this easier. Now you can load the Reaper report locally:
emerge reaper --id 57f13c92-30ae-4b93-98cf-3bb4bba3b
And then interactively delete code from your project. It's easier than ever to write code so it should be easier than ever to intelligently delete it.
Build Distribution
Our newest product, Build Distribution, lets you download test builds for your app. Naturally, downloading the build is only one part of the equation, you still need to install it on the target device. Our CLI can take care of both:
emerge install build --id 9c1dec32-e5a0-4c11-a2e1-fc9a4007fb32
And more
This is just a sneak peak of what we have. Our full list of commands can be seen by running emerge --help
:
Commands:
emerge autofix [SUBCOMMAND]
emerge build-distribution [SUBCOMMAND]
emerge configure [SUBCOMMAND]
emerge integrate [SUBCOMMAND]
emerge order-files [SUBCOMMAND]
emerge reaper
emerge snapshots [SUBCOMMAND]
emerge upload [SUBCOMMAND]
Contributing
Our CLI is open-source and available on GitHub. We welcome any contributions and feedback to the project. This is just the beginning for the Emerge CLI and we have many exciting plans ahead.