alexdewar / clockify-tui

An unofficial terminal UI for the Clockify time-tracking app.
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Workspaces #17

Open TinyMarsh opened 1 week ago

TinyMarsh commented 1 week ago

Description

This PR implements some workspaces stuff, hopefully addressing #4.

The code is a bit messy but hopefully the basic stuff is there. To test, fetch a list of available workspaces and their IDs by running

clockify-tui list-workspaces

After including the ID in the config file you can run

clockify-tui workspace-info

to fetch information about the workspace ID you provided in the config.

The workspace info thing might be a bit useless, but I suppose it just serves to demonstrate that it works. Having this ability to fetch and set workspace IDs will come in handy later when implementing further functionality.

Fixes #4

Type of change

Key checklist

Further checks

TinyMarsh commented 1 week ago

I've addressed the first half of your comment, but I'm not really sure how we want to go about the try_read_config() problem. If no config is present then the user is prompted to create one, if the user selects no then it fails. The problem is we always need to have a config file because we always need at least the API_KEY. It seems that we shouldn't really be offering the user the option to not create a config file?