Search
Close this search box.
GitKon

GitKraken CLI Preview

One of the advanced features offered by the legendary cross-platform GitKraken Client for Windows, Mac, & Linux, is the GitKraken CLI, a terminal first experience enhanced out of the box with features like auto-complete and auto-suggestions for Git commands, and visualizations of your repository.

Some GitKraken Client History

Before diving into the GitKraken CLI itself, let’s first look at a little history of how GitKraken Client has evolved as a Git productivity tool.  Before the team started working on GitKraken Client, there were a lot of inefficiencies working with Git across the team. Not many people were experts at using Git on the command line, and most people had to memorize or keep a handwritten list of the most common Git commands. Back then, most people simply looped through those commands until they ran into a problem, and then had to go ask a Git expert, either on their team or online. Advanced Git users were constantly interrupted to help with setup for new developers, resolve difficult merge conflicts, or guide someone through a complex Git rebase

Ease the pain of onboarding to Git with GitKraken’s learn Git resources, including tutorials and guides for beginner, intermediate, and advanced concepts.

Learn Git with GitKraken

The GitKraken team noticed there was a lot of time being wasted just getting Git to work on certain operating systems. While there were some tools on the market that helped to some degree, there weren’t any high-quality, truly cross-platform Git clients that worked properly and consistently on Windows, Mac, & Linux. Most of the existing interfaces were unintuitive, so the GitKraken developers did what any sensible development team would do: we decided to build our own Git client. 

GitKraken developers in the early stages of GitKraken Client

The guiding principle in the early days of building GitKraken Client was simple: “to build a Git client that didn’t suck.” This was a pretty low bar to clear, but we wanted to make a Git tool that was easy to set up, intuitive for people new to Git, and powerful enough for Git experts, all while looking really good.  The GitKraken team relied heavily on attractive design and an amazing user experience to draw users to GitKraken Client while working on feature parity with competitors. It’s that continuous focus on clearly visualizing Git and making it more accessible with an intuitive UI that has helped GitKraken Client become the most popular Git client in the world today.

GitKraken Client is the perfect example of a Git tool that has evolved to meet new challenges, with advanced features like interactive pull request management, merge conflict detection and resolution, deep linking, and more.

Enter the GitKraken CLI

The focus on making the best GUI, or graphical user interface, for Git, led us to take a somewhat anti-CLI stance at times. While the benefit of GUIs over command line interfaces seems obvious to some, there is a significant population of developers who have learned on and become comfortable using only the CLI on a daily basis.

In our continuing efforts to help all developers be more effective with Git, we sought to gain a better understanding of why developers use the Git CLI with the hopes of addressing the most common pain points associated with using Git on the command line. The GitKraken CLI is the result of a lot of research and interviews with developers who prefer to use the command line over a GUI for Git. 

After internal testing and a private alpha, the GitKraken CLI was released as a preview in GitKraken Client version 8.0.

Terminal Tabs

While there is nothing new about terminals, the terminal tabs in GitKraken Client provides an entirely new way to work in a command line with your Git repositories. The tabs are designed to work with existing shells, so you can continue to use the plug-ins and aliases you’re used to while taking advantage of some truly unique and powerful Git enhancements built into the GitKraken CLI.

The GitKraken CLI terminal tabs

The GitKraken CLI is a culmination of years of experience building a powerful GUI for Git combined with knowledge gained from interviewing users who depend heavily on the CLI in their daily Git interactions. The result is a terminal first experience that will radically improve the way Git is used on the command line.

Auto-Complete & Auto-Suggest for Git Commands

One of the enhancements offered by the GitKraken CLI is auto-complete and auto-suggest for Git commands. When the GitKraken team asked users what bothered them the most about using Git on the command line, the most common response was remembering Git commands along with the multitude of parameters. 

The GitKraken CLI offers a built-in system that automatically suggests Git commands and flags as you type. It even includes a brief description right next to each command, just in case you need to jog your memory on what those commands do.

Auto-complete suggestions in GitKraken CLI

If you’re writing a command that requires a commit SHA, branch name, or file name, the GitKraken CLI will use a fuzzy logic search to help you find them easily, even if you can’t remember the exact path, by inserting them into your command. Auto-complete suggestions have been an essential enhancement to IDEs for a long time, and they feel just as natural and powerful in the GitKraken CLI. 

The easy-to-read commit graph offered in GitKraken Client will help Git users of all skill levels better visualize and understand the branch structure and commit history of their repositories.

Visualizing Git Repositories

The second thing that bothered people most about using Git in the command line was poor visualization of Git repositories. This one makes a lot of sense since CLIs are really good at displaying text, but not much else; certainly not visualizing branch structure and commit history. 

Many GitKraken Client users who are also heavy Git CLI users have told us that they use GitKraken Client simply because the commit graph is the best way to visualize repositories. 

In GitKraken CLI, we’ve taken the most helpful visualization features from the standard GitKraken Client interface and made them easily accessible through the command line. This combines the power and speed that CLI users expect in a terminal, with the visual information about repositories that make working with Git easier via a GUI, all in one minimal view.

The GitKraken CLI showing commit graph at the bottom

These visualizations appear the first time you navigate into a Git repository. GitKraken Client will immediately open the commit graph in a panel at the bottom of the terminal, providing a quick visual representation of the repository that can be referenced while performing Git commands in the terminal above.

The commit graph is fully interactive and continues to function with drag-and-drop and context menu options if you need them.  Just above the graph, the repository name, branch, tag, and any changes ahead or behind will be displayed so you always know exactly where you are.

The GitKraken CLI gk Commands

To control this new visualization panel, you can utilize a set of commands for The GitKraken CLI by typing gk along with one of the following parameters: 

  • gk graph to toggle the graph on or off
    • Add top, bottom, left or right to change the position. For example, gk graph right sets the view to split-screen
  • gk diff to quickly see what has changed in between commits 
  • gk history shows you the File History view 
  • gk blame shows what has changed in a file or commit and who made those changes
The GitKraken CLI using the gk diff command

Command Palette Power

ProTip for GitKraken CLI users: use GitKraken Client’s Command Palette, accessible using Ctrl/Cmd+P, or click the new magic wand icon in the toolbar, for quick access to all advanced features. For example, to open a file in the editor, just type edit followed by the name of the file, and that file will open in edit mode inside of your terminal.

We’re Just Getting Started!

There are even more features to come in the future releases of the GitKraken CLI.  The GitKraken team is looking forward to hearing feedback about GitKraken Client and the GitKraken CLI from users so we can continue to refine our legendary Git tools and provide the best experience on the command line.  You can download and start using the legendary GitKraken Client today for free on Mac, Windows, and Linux, now with GitKraken CLI!

Make Git Easier, Safer & more Powerful

With the #1 Git GUI + Git Enhanced CLI

Visual Studio Code is required to install GitLens.

Don’t have Visual Studio Code? Get it now.