Hacking the CLI

The CLI (command-line interface) was introduced at Dreamforce ’13 during the Developer Keynote to thunderous applause, for good reason.  The CLI is very useful for executing quick commands without the overhead of pulling up a tool like the IDE or the Developer Console or logging into Salesforce directly.  Additionally, it can be used in conjunction with other non CLI commands in the shell with piping or redirection (e.g., pipe to grep).

All of that is certainly great, but the icing on the cake is that it is open-sourced.  Anyone can fork the repo, make their own changes, compile their own version, and even submit a pull request to possibly get their changes incorporated into a future release.  The rest of this post describes how to get started with hacking the CLI.

Environment Set Up

There are a few prerequisites to fulfill before you can fork your own repo.

Make sure that git, hg (mercurial), and go are on your PATH.

Tool Installations


Once you have all of the development tools installed and your GitHub account set up, you can fork the repo.  After forking it you will have your own repo.  At that point, you can follow the Hacking Instructions to download the source and all of its dependencies, but instead of using you’ll use the repo that was created from the fork (i.e.,

Once you compile you will have a force executable that you can use.  You can make changes to your source code and recompile. Eventually you may even feel like you have something that you can contribute (follow these steps).

You can also hack on your own without forking.  You just wouldn’t be able to commit back any changes. To do that, simply follow the Hacking Instructions and use the value as it is in the instructions.

Leave a Reply

Your email address will not be published. Required fields are marked *