Command line

The backlog command reads and changes the same projects, tasks and notes that agents use. Every data command is an MCP client: it connects to a server, calls MCP tools, and prints the result as a table or a panel. This page explains how to connect the command to a local or a remote server and how to register a project. The command reference lists every command.

Choose a server

The command works in one of two modes:

  • Local mode. No server URL is set. Each command starts a local stdio server, sends its requests, and stops the server when the command finishes. The local server uses the configured database, computer name and working directory. See Local MCP server over stdio for the server itself.

  • Remote mode. A server URL is set. Each command connects to a running HTTP server. See Remote MCP server over HTTP to run one.

Local mode

Local mode needs no setup. The global options set what the local server uses:

-d, --database

The SQLite file. The default is $XDG_DATA_HOME/backlog-mcp/backlog.sqlite3.

-r, --root

The directory that selects the project. The default is the working directory.

--computer

The name of this computer. The default is the short host name.

--default-user

The user name that the local server acts for. The default is $USER.

backlog --database ~/work/backlog.sqlite3 task list

Where the data lives describes the database location and the configuration files.

Remote mode

Set the MCP endpoint of the server in one of three ways:

  • the --url option;

  • the url key in the global section of a TOML configuration file;

  • the BACKLOG_MCP_URL environment variable.

backlog --url https://backlog.example/mcp task list
url = "https://backlog.example/mcp"

The URL must be an absolute http or https address. --url '' selects local mode again when a configuration file or the environment sets a URL.

Choose one authentication method:

Method

Options

Environment variables

HTTP Basic

--user, --password

BACKLOG_MCP_USER, BACKLOG_MCP_PASSWORD

JWT

--token

BACKLOG_MCP_TOKEN

With a token, the command sends the header Authorization: Bearer <token>. A token in the endpoint URL, ?token=<JWT>, also works. Basic credentials and a token are mutually exclusive: the command stops with an error when both are set. The Basic user name must not contain a colon.

export BACKLOG_MCP_URL=https://backlog.example/mcp
export BACKLOG_MCP_TOKEN=eyJhbGciOi...
backlog whoami

--timeout sets the request timeout in seconds. The default is 120.

The command never falls back to the local database. When the configured server is unreachable, the command prints an error and exits with code 1. No write goes elsewhere.

In remote mode, the command tells the server which computer it runs on. It adds computer to the query of the endpoint URL. --computer overrides a computer that the URL already holds. Without both, the command uses the local computer name.

Always use a remote server

Put the server in your user configuration file, and every backlog command uses it without options. The command reads these files in this order; a later file overrides the keys that it sets:

File

Scope

/etc/backlog-mcp/config.toml

Every user of the computer.

$XDG_CONFIG_HOME/backlog-mcp/config.toml, by default ~/.config/backlog-mcp/config.toml

Your user.

.backlog-mcp.toml in the working directory

One checkout.

The file that --config FILE names

One command.

A missing file is skipped. Environment variables and command-line options override every file. See Where the data lives for the details.

Write the keys at the top of the file, before any table. With Basic authentication:

# ~/.config/backlog-mcp/config.toml
url = "https://backlog.example/mcp"
user = "alice"
password = "secret"
computer = "laptop"

With a JWT, give token instead of user and password:

url = "https://backlog.example/mcp"
token = "eyJhbGciOi..."
computer = "laptop"

computer is the name of this computer on the server. The command adds it to the endpoint URL, so the server knows where your checkouts are. Use the same name in the agent configuration of this computer.

The file holds a secret, so make it readable only for you:

chmod 600 ~/.config/backlog-mcp/config.toml

Check the result. backlog whoami prints the user, the authentication type and the computer that the server sees:

backlog whoami

To run one command against the local database, give --url ''.

Select a project

Most commands work on one project. The command selects it in this order:

  1. The --project option, or BACKLOG_MCP_PROJECT. The value is the owner-qualified name, such as alice/my-project, a slug, or a path inside the project.

  2. In remote mode, the project query parameter of the endpoint URL.

  3. The deepest registered directory of this computer that contains the working directory, or the directory that --root names.

--project is a global option. Put it before the command group, as with every other global option:

backlog --project alice/my-project task list

backlog task list --project alice/my-project is an error: no subcommand takes --project.

The server never uses its own working directory to select a project for the command. In remote mode, the command finds the directory on its own computer and then names the project to the server.

Register a project

A project binds one or more directories. Each binding names a computer and a directory on it. The first command that needs a project in an unregistered directory starts the registration.

Interactive registration

In a terminal, the command asks three questions. Press Enter to keep the default value.

  1. Input project directory. The default is the nearest parent directory with .git, .hg, .svn or .jj. Without one, the default is the working directory.

  2. Input project name. The default is the name of the selected directory.

  3. Input project description. The default is empty.

If the selected directory already belongs to a project, the command offers that project. If the name or the slug matches an existing project, also one on another computer, the command offers to bind this directory to it. The existing project keeps its description, tasks and notes. Otherwise, the command asks you to confirm a new project.

When you cancel or close the input, the command creates nothing: no project and no task. Later commands use the binding and ask nothing.

Registration without prompts

backlog init registers the directory directly:

backlog init                                     # ask the questions above
backlog init "My project" --description "Release coordination"
backlog init --existing alice/my-project         # bind this directory to a known project

init NAME creates a new project. It fails when a project of yours with that name already exists, and it names the --existing command to use instead. It never creates a second project with a changed slug. --existing takes the owner-qualified name or the slug of the project.

Without a terminal, for example in a script or a CI job, the command cannot ask. A missing binding is then an error, and the command exits with code 2. Run backlog init before such scripts.

Commands that do not register

Some commands never start the registration:

  • whoami, projects, skills and watch;

  • commands that address a task or a note by id, such as task show 1 or memory show 1;

  • board PROJECT with an explicit project;

  • listings with --all-projects, --computer or --all-computers.