Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / docs / user / userguide / arcanist.diviner
blob0de18a9358fa13af3f70c5e5f9beff4c2d1fd8cd
1 @title Arcanist User Guide
2 @group userguide
4 Guide to Arcanist, a command-line interface to Phabricator.
6 Arcanist provides command-line access to many Phabricator tools (like
7 Differential, Files, and Paste), integrates with static analysis ("lint") and
8 unit tests, and manages common workflows like getting changes into Differential
9 for review.
11 A detailed command reference is available by running `arc help`. This
12 document provides an overview of common workflows and installation.
14 Arcanist has technical, contributor-focused documentation here:
15 <https://secure.phabricator.com/book/arcanist/>
17 = Quick Start =
19 A quick start guide is available at @{article:Arcanist Quick Start}. It provides
20 a much more compact summary of how to get `arc` set up and running for a new
21 project. You may want to start there, and return here if you need more
22 information.
24 = Overview =
26 Arcanist is a wrapper script that sits on top of other tools (e.g.,
27 Differential, linters, unit test frameworks, git, Mercurial, and SVN) and
28 provides a simple command-line API to manage code review and some related
29 revision control operations.
31 For a detailed list of all available commands, run:
33   $ arc help
35 For detailed information about a specific command, run:
37   $ arc help <command>
39 Arcanist allows you to do things like:
41   - get detailed help about available commands with `arc help`
42   - send your code to Differential for review with `arc diff` (for detailed
43     instructions, see @{article:Arcanist User Guide: arc diff})
44   - show pending revision information with `arc list`
45   - find likely reviewers for a change with `arc cover`
46   - apply changes in a revision to the working copy with `arc patch`
47   - download a patch from Differential with `arc export`
48   - update Git commit messages after review with `arc amend`
49   - commit SVN changes with `arc commit`
50   - push Git and Mercurial changes with `arc land`
51   - view enhanced information about Git branches with `arc branch`
53 Once you've configured lint and unit test integration, you can also:
55   - check your code for syntax and style errors with `arc lint`
56     (see @{article:Arcanist User Guide: Lint})
57   - run unit tests that cover your changes with `arc unit`
59 Arcanist integrates with other tools:
61   - upload and download files with `arc upload` and `arc download`
62   - create and view pastes with `arc paste`
64 Arcanist has some advanced features as well, you can:
66   - execute Conduit method calls with `arc call-conduit`
67   - create or update libphutil libraries with `arc liberate`
68   - activate tab completion with `arc shell-complete`
69   - ...or extend Arcanist and add new commands.
71 Except where otherwise noted, these workflows are generally agnostic to the
72 underlying version control system and will work properly in git, Mercurial, or
73 SVN repositories.
75 = Installing Arcanist =
77 Arcanist is meant to be installed on your local machine or development server --
78 whatever machine you're editing code on. It runs on:
80   - Linux;
81   - Other operating systems which are pretty similar to Linux, or which
82     Linux is pretty similar to;
83   - FreeBSD, a fine operating system held in great esteem by many;
84   - Mac OS X (see @{article:Arcanist User Guide: Mac OS X}); and
85   - Windows (see @{article:Arcanist User Guide: Windows}).
87 Arcanist is written in PHP, so you need to install the PHP CLI first if you
88 don't already have it. Arcanist should run on PHP 5.2 and newer. If you don't
89 have PHP installed, you can download it from <http://www.php.net/>.
91 To install Arcanist, pick an install directory and clone the code from GitHub:
93   some_install_path/ $ git clone https://github.com/phacility/arcanist.git
95 Now add `some_install_path/arcanist/bin/` to your PATH environment variable.
96 When you type "arc", you should see something like this:
98   Usage Exception: No command provided. Try 'arc help'.
100 If you get that far, you've done things correctly. If you get an error or have
101 trouble getting this far, see these detailed guides:
103   - On Windows: @{article:Arcanist User Guide: Windows}
104   - On Mac OS X: @{article:Arcanist User Guide: Mac OS X}
106 You can later upgrade Arcanist to the latest version with `arc upgrade`:
108   $ arc upgrade
110 == Installing Arcanist for a Team ==
112 Arcanist changes quickly, so it can be something of a headache to get it
113 installed and keep people up to date. Here are some approaches you might be
114 able to use:
116   - Facebook does most development on development servers, which have a standard
117     environment and NFS mounts. Arcanist lives on an
118     NFS mount, and the default `.bashrc` adds them to the PATH. Updating the
119     mount source updates everyone's versions, and new employees have a working
120     `arc` when they first log in.
121   - Another common approach is to write an install script as an action into
122     existing build scripts, so users can run `make install-arc` or
123     `ant install-arc` or similar.
125 == Installing Tab Completion ==
127 If you use `bash`, you can set up tab completion by running this command:
129   $ arc shell-complete
131 This will install shell completion into your current shell. After installing,
132 you may need to start a new shell (or open a new terminal window) to pick up
133 the updated configuration.
135 == Configuration ==
137 Some Arcanist commands can be configured. This configuration is read from
138 three sources, in order:
140   # A project can specify configuration in an `.arcconfig` file. This file is
141     JSON, and can be updated using  `arc set-config --local` or by editing
142     it manually.
143   # User configuration is read from `~/.arcconfig`. This file is JSON, and can
144     be updated using `arc set-config`.
145   # Host configuration is read from `/etc/arcconfig` (on Windows, the path
146     is `C:\ProgramData\Phabricator\Arcanist\config`).
148 Arcanist uses the first definition it encounters as the runtime setting.
150 Existing settings can be printed with `arc get-config`.
152 Use `arc help set-config` and `arc help get-config` for more information
153 about reading and writing configuration.
155 == Next Steps ==
157 Continue by:
159   - setting up a new project for use with `arc`, with
160     @{article:Arcanist User Guide: Configuring a New Project}; or
161   - learning how to use `arc` to send changes for review with
162     @{article:Arcanist User Guide: arc diff}.
164 Advanced topics are also available. These are detailed guides to configuring
165 technical features of `arc` that refine its behavior. You do not need to read
166 them to get it working.
168  - @{article:Arcanist User Guide: Commit Ranges}
169  - @{article:Arcanist User Guide: Lint}
170  - @{article:Arcanist User Guide: Customizing Existing Linters}
171  - @{article:Arcanist User Guide: Customizing Lint, Unit Tests and Workflows}
172  - @{article:Arcanist User Guide: Code Coverage}