Read Anthropic’s case study about Graphite Reviewer

Phabricator's CLI: Arcanist

Greg Foster
Greg Foster
Graphite software engineer
Try Graphite


Note

This guide explains this concept in vanilla Git. For Graphite documentation, see our CLI docs.


Arcanist was developed as part of the Phabricator ecosystem, originally created by Facebook to meet its growing need for robust tools that streamlined code review and project management. Over time, Arcanist became the go-to command-line tool for interacting with Differential (Phabricator's code review tool) and Diffusion (its repository hosting service).

Arcanist was initially introduced to simplify developer workflows by offering a centralized CLI for managing linting, testing, and repository interactions. Although its primary use case is integrating with a Phabricator instance, Arcanist can also be adapted to a variety of workflows, making it a powerful addition to many modern software development toolchains.

  1. Code review integration:

One of Arcanist’s main advantages is its seamless integration with Phabricator’s code review system, Differential. By using arc, developers can create and update review requests, add inline comments, and land changes all without leaving their terminal environment. This reduces context switching, enabling a faster, more efficient feedback loop.

  1. Linting and static analysis:

Arcanist supports a wide range of linters and static analysis tools. By configuring them in its .arclint file, you can enforce coding standards, catch style issues, and detect potential bugs before changes even enter code review. This "shift-left" approach helps maintain code quality and consistency across a team.

  1. Command-line convenience:

With Arcanist, common development operations—like linting code, running unit tests, and generating patches—can be performed via straightforward CLI commands. This allows you to automate and script these actions easily, integrating them with custom workflows or CI/CD pipelines.

  1. Unit testing integration:

Before sending changes for review, Arcanist can run your project’s unit tests and report results directly to your terminal. This ensures that only code meeting your team’s quality gate is considered for merging, improving overall reliability and reducing the chance of regressions.

  1. Patch management:

Arcanist can generate and apply patches, making it easier to share work-in-progress code with teammates or handle contributions from external developers. You can use arc patch to apply changes from a Differential revision or a raw patch file, streamlining collaboration on code.

  1. Branch and bookmark management:

Although not a source control system by itself, Arcanist interacts smoothly with Git, Mercurial, and SVN repositories. It can help manage branches or bookmarks associated with Differential reviews, ensuring your code stays synchronized with Phabricator’s review workflow.

  • A developer makes local changes and uses the arc diff command, which lints the code, runs unit tests, and then creates a Differential revision for code review.

  • Upon completion of the review process, arc land is used to merge the approved changes into the main branch.

  • In a continuous integration pipeline, arc commands are utilized to automate code submission and review processes, interfacing with other tools and services.
  • Developer efficiency: Arcanist has been praised for its ability to streamline the developer's workflow, making it a favored tool among Phabricator users.

  • Learning curve: Some users initially found the tool challenging to adopt due to its extensive range of commands and options.

Arcanist's approach to integrating code review and repository management via the command line has influenced other tools and platforms, highlighting the importance of efficient developer-centric tools in software engineering.

The scriptable nature of Arcanist allowed teams to tailor the tool to their unique processes, reinforcing the trend towards customizable dev tools in the industry.

Arcanist stands as a testament to the philosophy that developer tools should be powerful, yet flexible enough to adapt to varied and evolving workflows. Its history is closely tied to that of Phabricator, reflecting the dynamic nature of software development tools and the constant pursuit of efficiency and quality in code collaboration. Arcanist’s functionality, reception, and influence underscore its role in shaping the practices of modern software development.

Git inspired
Graphite's CLI and VS Code extension make working with Git effortless.
Learn more

Built for the world's fastest engineering teams, now available for everyone