Skip to content

feat: Non-directory specific tracking support#76

Merged
DylanDevelops merged 6 commits intomainfrom
ravel/alternative-tracking-logic
Jan 31, 2026
Merged

feat: Non-directory specific tracking support#76
DylanDevelops merged 6 commits intomainfrom
ravel/alternative-tracking-logic

Conversation

@DylanDevelops
Copy link
Owner

Pull Request Checklist

  • I have read and followed the contribution guidelines.
  • My pull request targets the main branch of tmpo.
  • I have tested these changes locally on my machine.

Closes #75

Description

This pull request introduces support for global projects, allowing users to track time for any project from any directory, not just those with a local .tmporc configuration. It updates documentation, adds new flags and logic to various commands to support global project selection, and refactors the project initialization process to handle both local and global projects.

Global Projects Feature:

  • Added support for creating and tracking global projects via a new --global flag in the tmpo init command, storing global projects in ~/.tmpo/projects.yaml. Users can now track time from any directory using the --project flag. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

  • Updated project detection logic to prioritize the --project flag, followed by .tmporc, git repository, and directory name.

Command Enhancements:

  • Added --project flag support to edit, manual, log, and export commands, enabling users to select a specific global project when creating or editing entries or viewing logs/exports. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Documentation Updates:

  • Updated README.md and CONTRIBUTING.md to document global project functionality, usage examples, and configuration file structure. [1] [2] [3] [4] [5]

Refactoring and Code Quality:

  • Refactored project initialization logic to separate local and global project creation, improved prompts, and streamlined validation and detail display functions. [1] [2] [3] [4] [5] [6] [7]

These changes collectively make it much easier to manage and track time for projects that are not tied to a specific directory, improving flexibility for users who work across multiple locations.

Introduces a global projects registry in internal/settings/projects.go with full CRUD operations and tests. Updates the setup init command to support a --global flag for creating global projects, and refactors project detection logic to prioritize explicit project selection, .tmporc, and directory-based detection. Adds integration and unit tests for new behaviors and project config retrieval.
Introduces a --project (-p) flag to edit, manual, resume, and start commands, allowing users to specify a global project explicitly. Updates project detection logic to use the override when provided, and adjusts config source messaging accordingly. Also updates history export and log commands to respect the project flag when filtering by milestone.
@DylanDevelops
Copy link
Owner Author

This feature required significant refactoring, so I will conduct thorough testing before merging it into production.

Updated environment variable setup in tests to use t.Setenv for both HOME and USERPROFILE, ensuring compatibility across Unix/macOS and Windows. Standardized test directories to use .tmpo instead of .tmpo-dev and removed dev mode logic from tests.
Disallows using --accept-defaults with --global to require explicit configuration for global projects. Updates prompts to require a project name for global projects and adjusts tests to directly verify registry operations instead of interactive input.
@DylanDevelops DylanDevelops merged commit 21fa115 into main Jan 31, 2026
6 checks passed
@DylanDevelops DylanDevelops deleted the ravel/alternative-tracking-logic branch January 31, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Track a project in any directory

1 participant