This guide covers all aspects of configuring Locus, including configuration files, environment variables, and the interactive setup wizard.
- Configuration Overview
- Configuration File
- Environment Variables
- Interactive Setup
- Configuration Options
- Examples
- Troubleshooting
Locus uses a hierarchical configuration system with three levels of precedence:
- Environment Variables (highest priority)
- Configuration File (
~/.config/locus/settings.yml) - Default Values (lowest priority)
This allows you to:
- Override specific settings temporarily using environment variables
- Set persistent preferences in the configuration file
- Rely on sensible defaults without any configuration
The configuration file is stored at:
- Unix/Linux/macOS:
~/.config/locus/settings.yml - Windows:
%USERPROFILE%\.config\locus\settings.yml
This follows the XDG Base Directory Specification.
You have three ways to create a configuration file:
locus config setupThis launches an interactive wizard that guides you through all configuration options.
locus config initThis creates a configuration file with default values that you can edit manually.
Create the directory and file manually:
mkdir -p ~/.config/locus
touch ~/.config/locus/settings.ymlThen edit the file with your preferred text editor.
The configuration file uses YAML format:
# Task storage directory
task_directory: "~/locus"
# Language settings
language:
default: "en" # Available: "en" (English) or "ja" (Japanese)
# Git integration settings
git:
extract_username: true # Extract username from Git config
username_from_remote: true # Use username from remote URL
# File naming configuration
file_naming:
pattern: "{slug}.md" # File naming pattern
date_format: "YYYY-MM-DD" # Date format in filenames
hash_length: 8 # Length of random hash
# Default values for new tasks
defaults:
status: "todo" # Default task status
priority: "normal" # Default task priority
tags: [] # Default tags (empty array)Environment variables override configuration file settings. They are useful for:
- Temporary overrides
- CI/CD environments
- Testing different configurations
| Variable | Description | Example |
|---|---|---|
LOCUS_LANG |
Override language setting | LOCUS_LANG=en locus list |
LOCUS_TASK_DIRECTORY |
Override task directory | LOCUS_TASK_DIRECTORY=/tmp/tasks locus add "Test" |
LOCUS_GIT_EXTRACT_USERNAME |
Enable/disable username extraction | LOCUS_GIT_EXTRACT_USERNAME=false locus add "Task" |
LOCUS_GIT_USERNAME_FROM_REMOTE |
Enable/disable username from remote | LOCUS_GIT_USERNAME_FROM_REMOTE=false locus add "Task" |
LOCUS_FILE_NAMING_PATTERN |
File naming pattern | LOCUS_FILE_NAMING_PATTERN="{date}-{slug}.md" locus add "Task" |
LOCUS_FILE_NAMING_DATE_FORMAT |
Date format for filenames | LOCUS_FILE_NAMING_DATE_FORMAT="YYYYMMDD" locus add "Task" |
LOCUS_FILE_NAMING_HASH_LENGTH |
Hash length for unique identifiers | LOCUS_FILE_NAMING_HASH_LENGTH=12 locus add "Task" |
LOCUS_DEFAULTS_STATUS |
Override default status | LOCUS_DEFAULTS_STATUS=in-progress locus add "Task" |
LOCUS_DEFAULTS_PRIORITY |
Override default priority | LOCUS_DEFAULTS_PRIORITY=high locus add "Urgent" |
LOCUS_DEFAULTS_TAGS |
Default tags (comma-separated) | LOCUS_DEFAULTS_TAGS="work,urgent" locus add "Task" |
LOCUS_LANGUAGE_DEFAULT |
Default language (en/ja) | LOCUS_LANGUAGE_DEFAULT=ja locus config show |
Boolean values can be specified as:
true,1,yes,onfor truefalse,0,no,offfor false
The configuration directory location can be overridden using standard XDG environment variables:
XDG_CONFIG_HOME: Override the base config directory (default:~/.config)XDG_CONFIG_DIRS: Additional config directories to search (default:/etc/xdg)
The interactive setup wizard (locus config setup) provides a user-friendly way to configure Locus:
$ locus config setup
🚀 Welcome to the Locus Setup Wizard!
? Where would you like to store your tasks? (~/locus) › ~/my-tasks
? Which language would you like to use? › English
? Extract Git user ID automatically? (Y/n) › Yes
? Use username from remote URL? (Y/n) › Yes
? Select file naming pattern › {date}-{slug}-{hash}.md (e.g., 2024-01-15-my-task-a1b2c3d4.md)
? Select date format › YYYY-MM-DD (2024-01-15)
? Hash length? (4-32) › 8
? Default status? › todo
? Default priority? › normal
? Default tags (comma-separated, optional) ›
📋 Configuration preview:
task_directory: ~/my-tasks
language:
default: en
git:
extract_username: true
username_from_remote: true
file_naming:
pattern: '{date}-{slug}-{hash}.md'
date_format: YYYY-MM-DD
hash_length: 8
defaults:
status: todo
priority: normal
tags: []
? Save this configuration? (Y/n) › Yes
✅ Configuration saved: /Users/username/.config/locus/settings.ymlKey: task_directory
Default: ~/locus
Environment: LOCUS_TASK_DIRECTORY
The base directory where all task files are stored. Tasks are organized by Git repository under this directory.
Example structure:
~/locus/
├── github-username/
│ ├── project-a/
│ │ ├── 2024-01-15-fix-bug-a1b2c3d4.md
│ │ └── 2024-01-16-add-feature-e5f6g7h8.md
│ └── project-b/
│ └── 2024-01-17-update-docs-i9j0k1l2.md
└── default/ # Tasks created outside Git repositories
└── 2024-01-18-personal-task-m3n4o5p6.md
Key: language.default
Default: en
Environment: LOCUS_LANG
Options: en (English), ja (Japanese)
Controls the display language for all command output, error messages, and prompts.
Language detection priority:
LOCUS_LANGenvironment variable- Configuration file setting
- System
LANGenvironment variable - Default to English
Key: git.extract_username
Default: true
Environment: LOCUS_GIT_EXTRACT_USERNAME
When enabled, Locus extracts the Git username to organize tasks by repository owner.
Key: git.username_from_remote
Default: true
When enabled, Locus extracts the username from the Git remote URL. This is useful when your local Git username differs from your GitHub/GitLab username.
Example:
- Remote URL:
https://github.com/john-doe/project.git - Extracted username:
john-doe - Task location:
~/locus/john-doe/project/
Key: file_naming.pattern
Default: {slug}.md
Available placeholders:
{date}: Current date formatted according todate_format{slug}: Sanitized task title (lowercase, alphanumeric, hyphens){hash}: Random alphanumeric string for uniqueness
Common patterns:
{date}-{slug}-{hash}.md→2024-01-15-fix-auth-bug-a1b2c3d4.md{slug}-{date}-{hash}.md→fix-auth-bug-2024-01-15-a1b2c3d4.md{date}-{slug}.md→2024-01-15-fix-auth-bug.md{slug}.md→fix-auth-bug.md
Key: file_naming.date_format
Default: YYYY-MM-DD
Supported formats:
YYYY-MM-DD→2024-01-15YYYYMMDD→20240115YYYY/MM/DD→2024/01/15DD-MM-YYYY→15-01-2024
Key: file_naming.hash_length
Default: 8
Range: 4-32
The length of the random hash appended to filenames. Longer hashes reduce the chance of collisions.
Key: defaults.status
Default: todo
Environment: LOCUS_DEFAULTS_STATUS
Common values:
todo- Task not startedin-progress- Currently working ondone- Completedcancelled- No longer needed
Key: defaults.priority
Default: normal
Environment: LOCUS_DEFAULTS_PRIORITY
Common values:
high- Urgent tasksnormal- Regular prioritylow- Can be deferred
Key: defaults.tags
Default: [] (empty array)
An array of default tags applied to all new tasks. Can be overridden per task.
Example:
defaults:
tags: ["work", "current-sprint"]task_directory: "~/dev/tasks"
language:
default: "en"
git:
extract_username: true
username_from_remote: true
file_naming:
pattern: "{date}-{slug}-{hash}.md" # Include hash to avoid conflicts
date_format: "YYYYMMDD"
hash_length: 8
defaults:
status: "todo"
priority: "normal"
tags: ["dev"]task_directory: "/shared/team-tasks"
language:
default: "en"
git:
extract_username: false # Don't organize by user
username_from_remote: false
file_naming:
pattern: "{slug}-{hash}.md" # No date for better sorting
date_format: "YYYY-MM-DD"
hash_length: 12 # Longer hash for more uniqueness
defaults:
status: "todo"
priority: "normal"
tags: ["team"]task_directory: "~/Documents/tasks"
language:
default: "en"
git:
extract_username: false # Don't use Git organization
username_from_remote: false
file_naming:
pattern: "{date}-{slug}.md"
date_format: "YYYY-MM-DD"
hash_length: 8
defaults:
status: "todo"
priority: "normal"
tags: ["personal"]-
Check file location:
locus config path
-
Verify file exists:
ls -la ~/.config/locus/settings.yml -
Validate YAML syntax:
locus config show
-
Verify variable is set:
echo $LOCUS_LANG
-
Check for typos in variable names (must start with
LOCUS_) -
Ensure boolean values are correctly formatted
-
Check directory permissions:
ls -la ~/.config/locus/ -
Ensure write permissions:
chmod 755 ~/.config/locus chmod 644 ~/.config/locus/settings.yml
If settings aren't applying as expected:
-
Check all configuration sources:
locus config show
-
Look for environment variable overrides:
env | grep LOCUS_ -
Remember the precedence order:
- Environment variables (highest)
- Configuration file
- Defaults (lowest)
- Locus README - General usage and commands
- Task File Format - Task file structure
- Command Reference - All available commands