diff --git a/docs/rbtools/rbt/commands/setup-repo.txt b/docs/rbtools/rbt/commands/setup-repo.txt
new file mode 100644
index 0000000000000000000000000000000000000000..ac4eaec3113cfc6e7ae74fcf7a3ab2126d54d1c7
--- /dev/null
+++ b/docs/rbtools/rbt/commands/setup-repo.txt
@@ -0,0 +1,57 @@
+.. _rbt-setup-repo:
+.. program:: rbt setup-repo
+
+==========
+setup-repo
+==========
+
+:command:`rbt setup-repo` will interactively configure your repository to point
+to a Review Board server by generating or overwriting the configuration file
+:file:`.reviewboardrc` in the current working directory.
+
+Usage::
+
+   $ rbt setup-repo [options]
+
+
+Default Options
+===============
+
+A number of options to :command:`rbt setup-repo` can be set by default
+in :file:`.reviewboardrc`. These can go either in the repository's
+or the user's :file:`.reviewboardrc`.
+
+The options include:
+
+* ``DEBUG`` (:option:`-d`)
+* ``REVIEWBOARD_URL`` (:option:`--server`)
+* ``USERNAME`` (:option:`--username`)
+* ``PASSWORD`` (:option:`--password`)
+
+
+Options
+=======
+
+.. cmdoption:: -d, --debug
+
+   Display debug output.
+
+   The default can be set in ``DEBUG`` in :file:`.reviewboardrc`.
+
+.. cmdoption:: --server
+
+   Specify a different Review Board server to use.
+
+   The default can be set in ``REVIEWBOARD_URL`` in :file:`.reviewboardrc`.
+
+.. cmdoption:: --username
+
+   Username to be supplied to the Review Board server.
+
+   The default can be set in ``USERNAME`` in :file:`.reviewboardrc`.
+
+.. cmdoption:: --password
+
+   Password to be supplied to the Review Board server.
+
+   The default can be set in ``PASSWORD`` in :file:`.reviewboardrc`.
diff --git a/rbtools/clients/__init__.py b/rbtools/clients/__init__.py
index c3617e754cc2a49c463a49ba1a8676944dabbc85..130da3d0be4d3b799d4c33a4b84487542ba93afd 100644
--- a/rbtools/clients/__init__.py
+++ b/rbtools/clients/__init__.py
@@ -168,6 +168,17 @@ class SCMClient(object):
         """
         raise NotImplementedError
 
+    def get_current_branch(self):
+        """Returns the repository branch name of the current directory.
+
+        Derived classes should override this method if they are able to
+        determine the current branch of the working directory.
+
+        If a derived class is unable to unable to determine the branch,
+        ``None`` should be returned.
+        """
+        raise NotImplementedError
+
 
 class RepositoryInfo(object):
     """
@@ -247,7 +258,7 @@ def scan_usable_client(options, client_name=None):
         if client_name:
             logging.error('The provided repository type was not detected '
                           'in the current directory.')
-        elif options.repository_url:
+        elif getattr(options, 'repository_url', None):
             logging.error('No supported repository could be accessed at '
                           'the supplied url.')
         else:
diff --git a/rbtools/clients/git.py b/rbtools/clients/git.py
index c86fca8bda9d608363535df66eef60208e9cde97..cbd28299f35cfe4ed45457491cf7430eb41c45d2 100644
--- a/rbtools/clients/git.py
+++ b/rbtools/clients/git.py
@@ -530,3 +530,8 @@ class GitClient(SCMClient):
         execute(['git', 'add', '--all', ':/'])
         execute(['git', 'commit', '-m', modified_message,
                  '--author="%s <%s>"' % (author.fullname, author.email)])
+
+    def get_current_branch(self):
+        """Returns the name of the current branch."""
+        return execute([self.git, "rev-parse", "--abbrev-ref", "HEAD"],
+                       ignore_errors=True).strip()
diff --git a/rbtools/commands/setup_repo.py b/rbtools/commands/setup_repo.py
new file mode 100644
index 0000000000000000000000000000000000000000..30348d3ae62f8060afc6731f65eed506a22ecb0e
--- /dev/null
+++ b/rbtools/commands/setup_repo.py
@@ -0,0 +1,148 @@
+import os
+
+from rbtools.commands import Command, CommandError, Option
+from rbtools.utils.console import confirm
+from rbtools.utils.filesystem import CONFIG_FILE
+
+
+class SetupRepo(Command):
+    """Configure a repository to point to a Review Board server.
+
+    Interactively creates the configuration file .reviewboardrc in the current
+    working directory.
+
+    The user is prompted for the Review Board server url if it's not supplied
+    as an option. Upon a successful server connection, an attempt is made to
+    match the local repository to a repository on the Review Board server.
+    If no match is found or if the user declines the match, the user is
+    prompted to choose from other repositories on the Review Board server.
+
+    If the client supports it, it attempts to guess the branch name on the
+    server.
+    """
+    name = "setup-repo"
+    author = "The Review Board Project"
+    description = ("Configure a repository to point to a Review Board server "
+                   "by generating the configuration file %s"
+                   % CONFIG_FILE)
+    args = ""
+    option_list = [
+        Option("--server",
+               dest="server",
+               metavar="SERVER",
+               config_key="REVIEWBOARD_URL",
+               default=None,
+               help="specify a different Review Board server to use"),
+        Option("--username",
+               dest="username",
+               metavar="USERNAME",
+               config_key="USERNAME",
+               default=None,
+               help="user name to be supplied to the Review Board server"),
+        Option("--password",
+               dest="password",
+               metavar="PASSWORD",
+               config_key="PASSWORD",
+               default=None,
+               help="password to be supplied to the Review Board server"),
+    ]
+
+    def prompt_rb_repository(self, tool_name, repository_info, api_root):
+        """Interactively prompt to select a matching repository.
+
+        The user is prompted to choose a matching repository found on the
+        Review Board server.
+        """
+        repositories = api_root.get_repositories()
+
+        # Go through each matching repo and prompt for a selection. If a
+        # selection is made, immediately return the selected repo.
+        try:
+            while True:
+                for repo in repositories:
+                    is_match = (
+                        tool_name == repo.tool and
+                        repository_info.path in
+                        (repo['path'], getattr(repo, 'mirror_path', '')))
+
+                    if is_match:
+                        question = (
+                            "Use the %s repository '%s' (%s)?"
+                            % (tool_name, repo['name'], repo['path']))
+
+                        if confirm(question):
+                            return repo
+
+                repositories = repositories.get_next()
+        except StopIteration:
+            pass
+
+        return None
+
+    def _get_output(self, config):
+        """Returns a string output based on the the provided config."""
+        settings = []
+
+        for setting, value in config:
+            settings.append('%s = "%s"' % (setting, value))
+
+        settings.append('')
+
+        return '\n'.join(settings)
+
+    def generate_config_file(self, file_path, config):
+        """Generates the config file in the current working directory."""
+        try:
+            outfile = open(file_path, "w")
+            output = self._get_output(config)
+            outfile.write(output)
+            outfile.close()
+        except IOError as e:
+            raise CommandError('I/O error generating config file (%s): %s'
+                               % e.errno, e.strerror)
+
+        print "Config written to %s" % file_path
+
+    def main(self, *args):
+        server = self.options.server
+
+        if not server:
+            server = raw_input('Enter the Review Board server URL: ')
+
+        repository_info, tool = self.initialize_scm_tool()
+        api_client, api_root = self.get_api(server)
+        self.setup_tool(tool, api_root=api_root)
+
+        selected_repo = self.prompt_rb_repository(
+            tool.name, repository_info, api_root)
+
+        if not selected_repo:
+            print ("No %s repository found or selected for %s. %s not created."
+                   % (tool.name, server, CONFIG_FILE))
+            return
+
+        config = [
+            ('REVIEWBOARD_URL', server),
+            ('REPOSITORY', selected_repo['name'])
+        ]
+
+        try:
+            branch = tool.get_current_branch()
+            config.append(('BRANCH', branch))
+        except NotImplementedError:
+            pass
+
+        outfile_path = os.path.join(os.getcwd(), CONFIG_FILE)
+        output = self._get_output(config)
+
+        if not os.path.exists(outfile_path):
+            question = ("Create '%s' with the following?\n\n%s\n"
+                        % (outfile_path, output))
+        else:
+            question = ("'%s' exists. Overwrite with the following?\n\n%s\n"
+                        % (outfile_path, output))
+
+        if not confirm(question):
+            return
+
+        self.generate_config_file(outfile_path, config)
diff --git a/rbtools/utils/console.py b/rbtools/utils/console.py
index 8699f1ca00bbdcbf80ae9175a5ffbe6aae4a0d6d..37d72ebafad85d0c683340c24354d072c2aa82d7 100644
--- a/rbtools/utils/console.py
+++ b/rbtools/utils/console.py
@@ -1,9 +1,25 @@
 import os
 import subprocess
+from distutils.util import strtobool
 
 from rbtools.utils.filesystem import make_tempfile
 
 
+def confirm(question):
+    """Interactively prompt for a Yes/No answer.
+
+    Accepted values (case-insensitive) depend on distutils.util.strtobool():
+    'Yes' values: y, yes, t, true, on, 1
+    'No' values: n, no , f, false, off, 0
+    """
+    while True:
+        try:
+            answer = raw_input("%s [Yes/No]: " % question).lower()
+            return strtobool(answer)
+        except ValueError:
+            print '%s is not a valid answer.' % answer
+
+
 def edit_text(content):
     """Allows a user to edit a block of text and returns the saved result.
 
diff --git a/setup.py b/setup.py
index 1242d0de6b07495f9421893d331e87f55c2d2037..600b15f0767e42d1ee43dadd4b79bde442292a96 100755
--- a/setup.py
+++ b/setup.py
@@ -57,6 +57,7 @@ rb_commands = [
     'api-get = rbtools.commands.api_get:APIGet',
     'attach = rbtools.commands.attach:Attach',
     'close = rbtools.commands.close:Close',
+    'setup-repo = rbtools.commands.setup_repo:SetupRepo',
     'diff = rbtools.commands.diff:Diff',
     'list-repo-types = rbtools.commands.list_repo_types:ListRepoTypes',
     'patch = rbtools.commands.patch:Patch',
