The Log Time CLI tool streamlines the process of logging time to ITS PRO (Jira) issues directly from the command line.
- Python 3
-
Clone the repository to your local machine:
git clone https://github.com/UCSD/LogTime.git
-
Navigate to the project directory and install the required dependencies:
cd LogTime pip install -r requirements.txt
-
Create a
.env
file at the root of your project directory. This file will store your ITS PRO domain and Access Token.Obtain the following credentials:
- ITS PRO Domain: Visit the Log Time Documentation to get your ITS PRO Domain.
- Personal Access Token: Generate your token through the Log Time Documentation.
Add the following to your
.env
file, replacing the placeholders, including the< >
, with the value of your ITS PRO domain and access token:ITS_PRO_DOMAIN=<YOUR_ITS_PRO_DOMAIN> ITS_PRO_ACCESS_TOKEN=<YOUR_ITS_PRO_ACCESS_TOKEN>
To simplify using the tool, create an alias so you can run the tool using a shorter command, like lt
:
echo 'alias "lt"="python3 '"$(pwd)"'/log-time.py"' >> ~/.zshrc
source ~/.zshrc
- Open PowerShell.
- Add the following alias to your PowerShell profile:
Replace
echo 'Set-Alias lt "python C:\path\to\log-time.py"' >> $PROFILE
C:\path\to\log-time.py
with the full path to yourlog-time.py
script. - Restart PowerShell or reload the profile:
. $PROFILE
Once you have the alias set up, you can log time using the following command:
lt <ITS PRO Issue ID> <Time Spent> ["Description"]
For example:
lt SVCOPS-407 30 "Completed initial setup"
This command logs 30 minutes to ITS PRO issue SVCOPS-407
.
<ITS PRO Issue ID
: Your ITS PRO issue ID (e.g.,SVCOPS-407
).<Time Spent>
: Time spent working on the issue (e.g., 30 or 30m for 30 minutes; 2 or 2h for 2 hours).["Description"]
: An optional description that details the work related to the time logged.
MIT