watercooler-labs / toggl-cli

πŸ• Command Line App for Toggl Track
MIT License
31 stars 7 forks source link

βš™οΈ Add smart tracking config #52

Closed shantanuraj closed 1 year ago

shantanuraj commented 1 year ago

:star2: What does this PR do?

:bug: Recommendations for testing

New commands introduced

# Create a new configuration using the default bundled config
$ toggl config init

# Pretty print currently active configuration
$ toggl config

# Edit the configuration in the system's default editor
$ toggl config --edit # or toggl config -e

# Delete the active configuration for current directory
$ toggl config --delete # or toggl config -d

# Log the path of the active configuration file
$ toggl config --path # or toggl config -p

:memo: Links to relevant issues/docs

See #45 which defines the configuration storage and retrieval mechanism. Minor changes have been incorporated that differ from the original spec.

Instead of using md5(path) we use base64(path)

I've updated the spec to reflect these changes.

Current locations are

linux windows macOS
$XDG_CONFIG_HOME/toggl-cli or $HOME/.config/toggl-cli {FOLDERID_RoamingAppData}/labs/toggl-cli/config $HOME/Library/Application Support/studio.watercooler.labs.toggl-cli

:speech_balloon: Summarise how you feel about this PR with a gif/image

ohstunning-sbagliato

[^1]: Auto tracking RFC at #45

[^3]: For platform agnostic config directory calculation https://docs.rs/directories/5.0.0/directories/struct.ProjectDirs.html#method.config_dir

shantanuraj commented 1 year ago

A follow up to this would be a PR implementing a custom parsing logic for the toml files, that expands our macros. Finally after that we can incorporate the unrolled config into our time entry start commands.

tcrammond commented 1 year ago

Just chiming in that it's functioning beautifully for me πŸ’