This document demonstrates how to use Worklog with multiple projects, each with its own prefix.
First, initialize your project configuration:
worklog initWhen prompted:
- Project name: Enter your project name (e.g., "My Web App")
- Issue ID prefix: Enter a short prefix (e.g., "WEB", "API", "PROJ")
This creates a .worklog/config.yaml file with your local configuration and automatically syncs with the remote repository to pull any existing work items.
projectName: My Web App
prefix: WEBConfiguration System: Worklog uses a two-tier configuration system:
.worklog/config.defaults.yaml(if present): Team defaults, committed to version control.worklog/config.yaml: Your local overrides, not committed to version control
Values in config.yaml override those in config.defaults.yaml, allowing teams to share defaults while individuals can customize their setup.
All CLI commands will use the prefix from your config by default:
# Create a work item - will use WEB prefix
worklog create -t "Add user authentication"
# Output: Created work item with id WEB-0J8L1JQ3H8ZQ2K6DYou can override the default prefix for any command using the --prefix flag:
# Create work items for different projects
worklog create -t "API: Add login endpoint" --prefix API
worklog create -t "Frontend: Create login form" --prefix FRONT
worklog create -t "Backend: Setup database" --prefix BACK
# List items from a specific project
worklog list --prefix API
# Update items from different projects
worklog update API-0J8L1JQ3H8ZQ2K6D -s completed --prefix API
worklog update FRONT-0J8L1JQ3H8ZQ2K6D -s in-progress --prefix FRONTThe API supports both legacy routes (using default prefix) and prefix-based routes:
# Create item with default prefix
curl -X POST http://localhost:3000/items \
-H "Content-Type: application/json" \
-d '{"title": "Task with default prefix"}'
# Get all items
curl http://localhost:3000/items# Create item with API prefix
curl -X POST http://localhost:3000/projects/API/items \
-H "Content-Type: application/json" \
-d '{"title": "Add authentication endpoint"}'
# Get items for API project
curl http://localhost:3000/projects/API/items
# Create item with FRONT prefix
curl -X POST http://localhost:3000/projects/FRONT/items \
-H "Content-Type: application/json" \
-d '{"title": "Create login form"}'
# Get specific item
curl http://localhost:3000/projects/API/items/API-0J8L1JQ3H8ZQ2K6D
# Update item
curl -X PUT http://localhost:3000/projects/API/items/API-0J8L1JQ3H8ZQ2K6D \
-H "Content-Type: application/json" \
-d '{"status": "completed"}'Here's a complete workflow using multiple projects:
# Initialize main project
worklog init
# Project name: WebApp
# Prefix: WEB
# Create main web app tasks
worklog create -t "Setup project structure"
worklog create -t "Create homepage"
# Create API tasks with custom prefix
worklog create -t "Design REST API" --prefix API
worklog create -t "Implement user endpoints" --prefix API
# Create mobile tasks with custom prefix
worklog create -t "Setup React Native" --prefix MOB
worklog create -t "Create login screen" --prefix MOB
# List all tasks (shows all prefixes)
worklog list
# List tasks for specific project
worklog list --prefix API
# Update status
worklog update WEB-0J8L1JQ3H8ZQ2K6D -s completed
worklog update API-0J8L1JQ3H8ZQ2K6D -s in-progress --prefix API
worklog update MOB-0J8L1JQ3H8ZQ2K6D -s completed --prefix MOB-
Share Defaults: If working in a team, commit
.worklog/config.defaults.yamlto version control so team members share the same default prefix. Individual users can create their own.worklog/config.yamlto override values as needed. -
Consistent Prefixes: Use short, meaningful prefixes:
WEBfor web applicationAPIfor API servicesMOBfor mobile appDOCfor documentationTESTfor testing tasks
-
Shared Data: All items regardless of prefix are stored in the same
.worklog/worklog-data.jsonlfile, making it easy to track work across projects. -
Override When Needed: Use
--prefixflag only when you need to work with a different project temporarily. Most of the time, use the default prefix from config.
If you have existing data with WI prefix and want to migrate to a new prefix:
- Initialize config with your new prefix
- Your existing
WI-*items will continue to work - New items will use the new prefix
- Both old and new items can coexist in the same database