backlogr

Crates.iobacklogr
lib.rsbacklogr
version0.0.1
created_at2025-05-30 16:46:28.551254+00
updated_at2025-06-06 04:36:15.550747+00
descriptionCLI for interacting with the Taiga REST API
homepagehttps://github.com/lauacosta/backlogr
repositoryhttps://github.com/lauacosta/backlogr
max_upload_size
id1695335
size62,290
Lautaro Acosta Quintana (lauacosta)

documentation

https://github.com/lauacosta/backlogr#readme

README

Backlogr

A work-in-progress CLI for interacting with the Taiga REST API.

⚠️ Personal Tool Warning
backlogr is tailored for personal CI workflows and only implements what I need.
It is not a general-purpose client and may never be. Current limitations include:

  • Only supports User Stories (no tasks, issues, or epics)
  • Basic status transitions only (New β†’ WIP β†’ Done)
  • No bulk operations or advanced filtering
  • Limited error handling and validation

πŸš€ Quick Start

  1. Install backlogr (see Installation)
  2. Set up environment variables:
    export USERNAME=your_taiga_username
    export PASSWORD=your_taiga_password
    export PROJECT_NAME=your_project_name
    
  3. Create and manage stories:
    # Create a new story
    backlogr create
    
    # List all stories
    backlogr list
    
    # Move story #10 to work in progress
    backlogr wip 10
    
    # Mark story #10 as done
    backlogr done 10
    
    # Delete story #10
    backlogr delete 10
    

πŸ“¦ Installation

From binary

cargo binstall backlogr
backlogr --version

From crates.io

cargo install backlogr
backlogr --version

From Releases

# Download the latest release for your platform
curl -L https://github.com/lauacosta/backlogr/releases/download/v0.0.1/backlogr-v0.0.1-x86_64-unknown-linux-musl.tar.gz | tar xz
sudo mv backlogr-v0.0.1-x86_64-unknown-linux-musl/backlogr /usr/local/bin/

From Source

# Requires Rust 1.85.1+
git clone https://github.com/lauacosta/backlogr.git
cd backlogr
cargo install --path .
backlogr --version

πŸ“‹ Prerequisites

  • Taiga Instance: Access to a Taiga instance (tested with Taiga 6.x)
  • Account: Valid Taiga username and password
  • Project: Existing project in Taiga with User Stories enabled
  • Rust: 1.85.1+ (if building from source)

✨ Features

  • πŸ” Authenticate with Taiga using username/password
  • πŸ“ Create new User Stories interactively
  • πŸ”„ Transition stories between New, WIP, and Done
  • πŸ—‘οΈ Delete stories by title or ID
  • πŸ“Š List all stories grouped by status
  • πŸ€– Designed for CI pipelines and manual project automation
  • 🌍 Environment variable support for secure credential handling

πŸ› οΈ Usage

Basic Command Structure

backlogr --username <USERNAME> --password <PASSWORD> --project_name <PROJECT_NAME> [COMMAND]

Using Environment Variables (Recommended)

export USERNAME=myuser
export PASSWORD=mypass
export PROJECT_NAME=myproject

backlogr [COMMAND]

Command Help

β–—β–„β–„β–– β–—β–žβ–€β–œβ–Œβ–—β–žβ–€β–˜β–ˆ  β–„ β–ˆ  β–„β–„β–„   β–„β–„β–„
β–β–Œ β–β–Œβ–β–šβ–„β–Ÿβ–Œβ–β–šβ–„β––β–ˆβ–„β–€  β–ˆ β–ˆ   β–ˆ β–ˆ
β–β–›β–€β–šβ––         β–ˆ β–€β–„ β–ˆ β–€β–„β–„β–„β–€ β–ˆ
β–β–™β–„β–žβ–˜         β–ˆ  β–ˆ β–ˆ     β–—β–„β––
                        β–β–Œ β–β–Œ
                         β–β–€β–œβ–Œ
                        β–β–™β–„β–žβ–˜
    @lauacosta/backlogr 0.0.1

Usage: backlogr --username <USERNAME> --password <PASSWORD> --project_name <PROJECT_NAME> [COMMAND]

Commands:
  create  Creates a new User Story
  wip     Updates a User Story to 'In Progress'
  done    Updates a User Story to 'Done'
  delete  Deletes a User Story
  list    List User stories
  help    Print this message or the help of the given subcommand(s)

Options:
      --username <USERNAME>          Taiga Username [env: USERNAME=]
      --password <PASSWORD>          Taiga password [env: PASSWORD=]
      --project_name <PROJECT_NAME>  Taiga project name [env: PROJECT_NAME=]
  -h, --help                         Print help
  -V, --version                      Print version

πŸ“– Command Examples

Create a New Story

# Interactive creation
backlogr create --description "Implement user authentication" --description "Add JWT-based auth system"

# βœ… Created story: "Implement user authentication" (#42)

List Stories

backlogr list

# Output:
# πŸ“‹ Total user stories: (8)
# 
# πŸ†• New (2)
#   #41 Fix login bug
#   #43 Update documentation
# 
# πŸ”„ In Progress (1)  
#   #42 Implement user authentication
# 
# βœ… Done (5)
#   #40 Setup CI pipeline
#   #39 Initial project setup
#   ...

Update Story Status

# Move to Work in Progress
backlogr wip 10
# βœ… Story #10 marked as 'In Progress'

# Mark as Done
backlogr done 15
# βœ… Story #15 marked as 'Done'

Delete a Story

backlogr delete 32
# βœ… Successfully deleted user story (#32)

πŸ€– CI Pipeline Usage

Environment Setup

# GitHub Actions example
env:
  USERNAME: ${{ secrets.TAIGA_USERNAME }}
  PASSWORD: ${{ secrets.TAIGA_PASSWORD }}
  PROJECT_NAME: "MyProject"

Common CI Workflows

# Create deployment story
backlogr create --subject "Deploy v$VERSION" --description "Automated deployment"

# βœ… Created story: "Deploy v1.0.1" (#42)

# Mark deployment as in progress
backlogr wip 42

# Mark as complete after successful deployment
backlogr done 42

Automated Commit-Based Workflow

Here's a complete CI script that automatically updates Taiga stories based on commit messages:

#!/bin/bash
set -e

# Check if backlogr is installed
command -v backlogr >/dev/null 2>&1 || {
  echo >&2 "❌ backlogr is required but it's not installed. Aborting."
  exit 1
}

# Extract commit message
COMMIT_MSG=$(git log -1 --pretty=%B)
echo "πŸ” Parsing commit message: $COMMIT_MSG"

# Parse commit message format: <mod>: <message> (#<id>)
if [[ "$COMMIT_MSG" =~ ^([^:]+):[[:space:]]*(.+)[[:space:]]*\(#([0-9]+)\)$ ]]; then
    MOD="${BASH_REMATCH[1]}"
    MESSAGE="${BASH_REMATCH[2]}"
    TASK_ID="${BASH_REMATCH[3]}"
    
    echo "βœ… Extracted from commit:"
    echo "   - Modifier: $MOD"
    echo "   - Message: $MESSAGE"
    echo "   - Task ID: $TASK_ID"
else
    echo "❌ Invalid commit format detected."
    echo "ℹ️ Expected format: <mod>: <message> (#<id>)"
    echo "ℹ️ Examples:"
    echo "   feat: add user authentication (#123)"
    echo "   fix: resolve login bug (#456)"
    echo "   done: complete user profile feature (#789)"
    exit 0
fi

# Validate environment variables
USERNAME="${TAIGA_USERNAME:-}"
PASSWORD="${TAIGA_PASSWORD:-}"
PROJECT_NAME="${PROJECT_NAME:-}"

if [ -z "$USERNAME" ] || [ -z "$PASSWORD" ] || [ -z "$PROJECT_NAME" ]; then
    echo "❌ Environment variables TAIGA_USERNAME, TAIGA_PASSWORD and PROJECT_NAME must be set."
    exit 1
fi

# Determine backlogr command based on modifier
case "${MOD,,}" in 
    "feat"|"feature"|"add"|"implement")
        COMMAND="wip"
        ACTION_DESC="Moving task to 'In Progress'"
        ;;
    "fix"|"bugfix"|"patch"|"hotfix")
        COMMAND="wip"
        ACTION_DESC="Moving task to 'In Progress' (fixing)"
        ;;
    "done"|"complete"|"finish"|"resolve")
        COMMAND="done"
        ACTION_DESC="Moving task to 'Done'"
        ;;
    "delete"|"remove"|"cancel"|"drop")
        COMMAND="delete"
        ACTION_DESC="Deleting task"
        ;;
    "wip"|"progress"|"start"|"begin")
        COMMAND="wip"
        ACTION_DESC="Moving task to 'In Progress'"
        ;;
    *)
        echo "⚠️ Unknown modifier '$MOD'. Supported modifiers:"
        echo "   - feat, feature, add, implement β†’ moves to WIP"
        echo "   - fix, bugfix, patch, hotfix β†’ moves to WIP"
        echo "   - done, complete, finish, resolve β†’ moves to Done"
        echo "   - delete, remove, cancel, drop β†’ deletes task"
        echo "   - wip, progress, start, begin β†’ moves to WIP"
        echo "ℹ️ No action will be taken."
        exit 0
        ;;
esac

echo "πŸš€ $ACTION_DESC for task #$TASK_ID..."

# Execute backlogr command
if backlogr --username "$USERNAME" --password "$PASSWORD" --project_name "$PROJECT_NAME" "$COMMAND" "$TASK_ID"; then
    echo "βœ… Successfully executed: $ACTION_DESC"
    echo "πŸ“ Commit message: $MESSAGE"
else
    echo "❌ Failed to execute backlogr command"
    exit 1
fi

Exit Codes

  • 0: Success
  • 1: General error (authentication, network, etc.)
  • 2: Story not found
  • 3: Invalid project or permissions

πŸ”§ Error Handling Examples

Authentication Failure

backlogr list
# ❌ Authentication failed: HTTP 401: {"detail": "No active account found with the given credentials", "code": "invalid_credentials"}
# πŸ’‘ Troubleshooting authentication:
#    β€’ Set environment variables:
#      export USERNAME=your_taiga_username
#      export PASSWORD=your_taiga_password
#    β€’ Verify credentials by logging into Taiga web interface
#    β€’ Check if your account is active and not locked

Story Not Found

backlogr wip 50
# πŸ” Looking up user story with ref #50 in project...
# ❌ User story not found: User story with ref #50 not found.
# πŸ’‘ Story 'User story with ref #50 not found.' not found. Try:
#   β€’ backlogr list           # See all available stories
#   β€’ backlogr create         # Create a new story
#   β€’ Check for typos in the story title
#   β€’ Ensure you're in the correct project

Network Issues

backlogr list
# ❌ Error: Failed to connect to Taiga instance. Please check your network connection.
# Exit code: 1

πŸ—οΈ Supported Taiga Versions

  • Tested: Taiga 6.5.x, 6.6.x
  • Minimum: Taiga 6.0+ (REST API v1)
  • Compatibility: Should work with most modern Taiga instances

πŸ“„ License

MIT License - see LICENSE file for details.


πŸ—ΊοΈ Roadmap

  • JSON output format for better CI integration
  • Bulk operations (create/update multiple stories)
  • Story filtering and search
  • Support for Tasks and Issues
  • Custom field support
  • Story templates
Commit count: 17

cargo fmt