backlog

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

README

Backlog

Manage the backlog of your project with just markdown in git. The goal is to provide a frictionless collaboration between AI agents and developers

Backlog is a zero-configuration task manager written in Go where tasks live inside a Git repository. It leverages plain Markdown files for task storage and a comprehensive command-line interface (CLI) for interaction. This design makes it exceptionally well-suited for AI agents thanks to its MCP (Model Context Protocol) integration.

The system is designed to be offline-first and completely portable, as the entire project state is contained within the Git repository.

Introduction

THIS SECTION IS FOR HUMANS

The context window deteriorates rapidly on large-scale projects. A workaround I found is to ask the agent to make a plan for X, write it to a markdown file and keep it updated with the ongoing tasks. It is a simple prompt. This technique has worked incredibly well, making refactoring and other significant code changes more resilient to failures, retries or rate-limiting from the model.

However, this approach cluttered the repository's root directory with files like plan.md or refactor_this_big_codebase.md. To solve this, I created an MCP server that I could understand and trust to handle these details, which has provided a much better experience when using AI tools for complex tasks. Through trial and error, I fine-tuned the parameters to get the results I needed from this project.

You can see an example in the .backlog folder of this repo. It has been generated with this prompt :

If you were to recreate this project from scratch, make a plan and break it down into tasks using backlog break down prompt.
Write that plan to a markdown file called "./docs/plan.md".
Check that the plan in ./docs/plan.md is consistent with the list of tasks in the backlog.
Add implementation plan to relevant tasks
All tasks should have at least one acceptance criteria.

Read the full instructions for backlog: ./internal/mcp/prompt.md

Assuming that backlog is registered as an MCP server with the command backlog mcp. See config examples in .gemini, .claude and .vscode.

Interestingly, while this codebase is mostly hand-written, the documentation, comments, examples, and some of the tests were generated with AI. I found that AI agents yield better results when the structure of the project is already there and exactly how you want it, with the libraries you want, in the code style you want. After that, it gets easier.

I used a few tools for learning purposes, all are paid tier:

  • gemini-2.5-pro
  • claude-sonnet4
  • github-copilot
  • amp

To instruct your AI tools to use backlog, see ./internal/mcp/prompt.md. It is available through backlog instructions > backlog_instructions.md

The rest of this document is mostly generated by AI (except the Inspiration section). Enjoy.

Features

  • Task Management: Create, edit, list, and view tasks with rich metadata
  • Hierarchical Structure: Support for parent-child-grandchild task relationships (T01 → T01.01 → T01.01.01)
  • Search & Filter: Find tasks by content, status, parent relationships, and labels
  • AI-Friendly: MCP server integration for seamless AI agent collaboration
  • Git Integration: Tasks are stored as Markdown files with automatic Git commits
  • Offline-First: Works completely offline with local Git repository storage
  • Portable: Entire project state contained within the Git repository
  • Zero Configuration: No setup files or databases required

Quick Start

Installation
# Build from source
git clone https://github.com/veggiemonk/backlog
cd backlog
go build .

# Or install directly
go install github.com/veggiemonk/backlog@latest

# Or in a container
docker pull ghcr.io/veggiemonk/backlog:latest

You can also download the binary from the release page.

Initialize Your Project

No initialization is needed.

Task Directory Resolution

Backlog stores tasks in a directory referred to as the "tasks folder". By default this is .backlog, but you can override it.

  • How to set the folder

    • CLI flag: --folder <path> (relative or absolute)
    • Environment variable: BACKLOG_FOLDER (used when set)
    • Default: .backlog
  • Resolution rules (applied to the chosen value)

    • Absolute path: used as-is.
    • Relative path: resolved with this precedence:
      • If <CWD>/<path> exists, use it.
      • Search parent directories; if <ancestor>/<path> exists, use it.
      • If a git repository is detected, use <gitRoot>/<path>.
      • Otherwise, fall back to <CWD>/<path> (created on demand).
  • Container tips

    • If your container does not include the .git directory, the resolver still works using the upward search and CWD fallback.
    • For predictable behavior, mount your tasks directory and set BACKLOG_FOLDER to its absolute mount point, or pass --folder with an absolute path.

Configuration

Backlog supports configuration through command-line flags and environment variables. Command-line flags take precedence over environment variables.

Available Configuration Options
Configuration Flag Environment Variable Default Description
Tasks Directory --folder BACKLOG_FOLDER .backlog Directory for backlog tasks
Auto Commit --auto-commit BACKLOG_AUTO_COMMIT true Auto-committing changes to git repository
Page Size --page-size BACKLOG_PAGE_SIZE 25 Default page size for pagination
Max Limit --max-limit BACKLOG_MAX_LIMIT 1000 Maximum limit for pagination
Log Level --log-level BACKLOG_LOG_LEVEL info Log level (debug, info, warn, error)
Log Format --log-format BACKLOG_LOG_FORMAT text Log format (json, text)
Log File --log-file BACKLOG_LOG_FILE "" Log file path (defaults to stderr)
Configuration Examples
# Using command-line flags
backlog --folder /custom/path --log-level debug --auto-commit false list

# Configure pagination limits
backlog --page-size 10 --max-limit 100 list

# Using environment variables
export BACKLOG_FOLDER="/custom/path"
export BACKLOG_LOG_LEVEL="debug"
export BACKLOG_AUTO_COMMIT="false"
export BACKLOG_PAGE_SIZE="10"
export BACKLOG_MAX_LIMIT="100"
backlog list

# Flags override environment variables
export BACKLOG_FOLDER="/env/path"
backlog --folder "/flag/path" list  # Uses /flag/path

# Logging examples
backlog --log-format json --log-level debug list
BACKLOG_LOG_FILE="/tmp/backlog.log" backlog list
Configuration Notes
  • Environment Variables: All environment variables use the BACKLOG_ prefix
  • Precedence: Command-line flags > Environment variables > Default values
  • Log Output: When --log-file is not specified, logs are written to stderr
  • Boolean Values: For environment variables, use true/false strings (e.g., BACKLOG_AUTO_COMMIT=false)

AI Agent Integration

Backlog includes a Model Context Protocol (MCP) server that exposes task management capabilities to AI agents:

Available Tools
  • task_create: Create new tasks with full metadata
  • task_list: List and filter tasks
  • task_view: Get detailed task information
  • task_edit: Update existing tasks
  • task_search: Search tasks by content
  • task_archive: Archive tasks so they are not displayed anymore but still lives in the repository.
Usage with AI Agents
# Start MCP server for AI integration
backlog mcp --http --port 8106
# Start MCP server using STDIO
backlog mcp

# AI agents can now:
# - Create tasks from conversation context
# - Break down large tasks into subtasks
# - Update task status and assignments
# - Search and analyze task patterns

Usage Examples

AI Integration (MCP Server)
# Start MCP server for AI agents (backlog mcp --http transport)
backlog mcp --http  # default port 8106
backlog mcp --http --port 8106 # specify the port

# Start MCP server (stdio transport)
backlog mcp

See this repository .gemini, .claude and .vscode for example configurations.

Basic Task Creation
# Simple task
backlog create "Fix the login button styling"

# Task with description
backlog create "Implement password reset" \
  -d "Users should be able to request a password reset link via email"

# Task with assignees and labels
backlog create "Update dependencies" \
  -a "alex" -a "jordan" \
  -l "maintenance,backend,security" \
  --priority "high"
Hierarchical Task Structure
# Create parent task
backlog create "Implement User Authentication"
# → Creates T01-implement_user_authentication.md

# Create subtask
backlog create "Add Google OAuth login" -p "T01"
# → Creates T01.01-add_google_oauth_login.md

# Create sub-subtask
backlog create "OAuth token validation" -p "T01.01"
# → Creates T01.01.01-oauth_token_validation.md
Advanced Task Creation
# Comprehensive task with acceptance criteria
backlog create "Build reporting feature" \
  -d "Create monthly performance reports in PDF format" \
  -a "drew" \
  -l "feature,frontend,backend" \
  --priority "high" \
  --ac "Report generation logic is accurate" \
  --ac "Users can select date range" \
  --ac "PDF export works correctly" \
  -p "23"
Task Management
# List all tasks
backlog list

# Filter by status
backlog list --status "todo"
backlog list --status "in-progress"
backlog list --status "done"

# Filter by parent (show subtasks)
backlog list --parent "T01"

# Pagination for large task lists
backlog list --limit 10                         # First 10 tasks
backlog list --limit 5 --offset 10              # Tasks 11-15
backlog list --status "todo" --limit 3          # First 3 todo tasks

# Search with pagination
backlog search "api" --limit 5                  # First 5 API-related tasks
backlog search "bug" --limit 3 --offset 5       # Search results 6-8

# View specific task
backlog view T01.02

# Edit task
backlog edit T01 --status "in-progress" --assignee "alex"

Task File Structure

Tasks are stored as Markdown files with YAML front matter in the .backlog/ directory:

---
id: "01.02.03"
title: "Implement OAuth integration"
status: "todo"
parent: "01.02"
assigned: ["alex", "jordan"]
labels: ["feature", "auth", "backend"]
priority: "high"
created_at: 2024-01-01T00:00:00Z
updated_at: 2024-01-01T00:00:00Z
---

## Description

Integrate OAuth authentication with Google and GitHub providers.

## Acceptance Criteria

<!-- AC:BEGIN -->

- [ ] #1 Google OAuth integration works
- [ ] #2 GitHub OAuth integration works
- [x] #3 OAuth scope validation implemented
<!-- AC:END -->

## Implementation Plan

1. Setup OAuth app registrations
2. Implement OAuth flow handlers
3. Add token validation
4. Write integration tests

## Implementation Notes

- Use oauth2 package for Go
- Store tokens securely
- Handle refresh token rotation

File Naming Convention: T{ID}-{slugified-title}.md

  • T01-implement_user_auth.md (root task)
  • T01.01-setup_oauth.md (subtask)
  • T01.01.01-google_oauth.md (sub-subtask)

Project Structure

.backlog/                     # Task storage directory
├── T01-user_auth.md         # Root task (ID: T01)
├── T01.01-oauth_setup.md    # Subtask (ID: T01.01)
├── T01.02-password_reset.md # Sibling subtask (ID: T01.02)
└── T02-frontend_redesign.md # Another root task (ID: T02)

Development

# Build the project
make build

# Run tests
make test

# Generate CLI documentation
make docs

# Lint code
make lint

Inspiration

This project is inspired by

but backlog aims to be simpler and handle fewer use cases while remaining AI-friendly.

For the MCP server, a lot of good examples are in go-sdk.

For real production use cases, GoogleCloudPlatform/gke-mcp is highly recommended.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cmd
Package cmd contains the cobra commands
Package cmd contains the cobra commands
commit
Package commit only purpose is to commit tasks.
Package commit only purpose is to commit tasks.
core
Package core defines all the core functionalities to work with tasks.
Package core defines all the core functionalities to work with tasks.
logging
Package logging provides global logging configuration and utilities for the backlog application.
Package logging provides global logging configuration and utilities for the backlog application.
mcp
Package mcp creates an MCP server for managing the tasks.
Package mcp creates an MCP server for managing the tasks.
paths
Package paths contains path resolution utilities used by the CLI.
Package paths contains path resolution utilities used by the CLI.
tools/docgen command
Package main provides documentation generation utilities for the backlog CLI.
Package main provides documentation generation utilities for the backlog CLI.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL