feat: Non-directory specific tracking support#76
Merged
DylanDevelops merged 6 commits intomainfrom Jan 31, 2026
Merged
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
mainbranch of tmpo.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
.tmporcconfiguration. 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
--globalflag in thetmpo initcommand, storing global projects in~/.tmpo/projects.yaml. Users can now track time from any directory using the--projectflag. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Updated project detection logic to prioritize the
--projectflag, followed by.tmporc, git repository, and directory name.Command Enhancements:
--projectflag support toedit,manual,log, andexportcommands, 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:
README.mdandCONTRIBUTING.mdto document global project functionality, usage examples, and configuration file structure. [1] [2] [3] [4] [5]Refactoring and Code Quality:
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.