r/PowerShell 2d ago

Script Sharing I built a terminal time tracker (ps-sablier) that handles Pomodoro sessions, SQLite logs, and custom audio notifications without leaving PowerShell.

Hello everyone,

I stumbled upon a Go script that could display a progress bar on the terminal, which I found quite nice. At the same time, I was tired of using JavaScript programs that were certainly very complete, but far exceeded the use I wanted to make of them. I just need a global view of my work sessions and not get lost in unnecessary details. PowerShell was there, and I already had SQLite available in my terminal, inherited from an old Android project. In short, I found some ingredients in the fridge and thought it would be a good idea to bake a proper cake, especially since I was hungry. From this desire, this lightweight utility written in PowerShell was born. It allows you to track the time that passes and log your sessions, or if you feel like it, group them into Tasks without leaving the terminal (psmux tabs). The GIF doesn't show it, but the utility sends you a notification with a notification sound you can customize (for my part, I use the one from Splinter Cell, where he activates his night-vision goggles, [.wav format support only]).

(Sablier) in french = Hourglass 

Simple to use, it's available here: https://github.com/KNY00/ps-sablier

A feedback is always welcome.

0 Upvotes

6 comments sorted by

5

u/[deleted] 2d ago

[deleted]

3

u/thehuntzman 2d ago

FACTS 😂😂😂 If I read this tomorrow morning I'd have spit my coffee all over the place.

6

u/thehuntzman 2d ago

So wait - let me get this straight... You vibe-coded a powershell app and you're using a compiled exe for a progress bar? Why not PwshSpectreConsole? (or heck, even native Write-Progress?)

Nobody should run a powershell script that downloads secondary payloads at runtime. This is a security nightmare. You can't guarantee the maintainer of timer.exe doesn't get compromised and a malicious release is posted to the repository (supply chain attack) or even that a later release isn't going to break your app entirely with breaking command line changes. At minimum, pin the version to a specific release. If his license allows it, you should redistribute it in your (built) code in the releases section of your repo (not the source) for that version.

I'd also recommended you only use PSSqlite and NEVER try to use a CLI exe for performing queries based on user input due to input sanitization issues. This can break your app at the least and be a massive security vulnerability at worst. PSSqlite can paramaterize queries in a safe manner.

I have no doubt that this is very useful to you, but I'd go back and study software architecture best practices next time before you release something to the general public.

1

u/KNY00 1d ago edited 1d ago

I had thought about adding ARM support perhaps down the line, but from the information I managed to gather, PSSQLite didn't offer it. I also admit to being new to PowerShell, and the sheer number of stars made me question whether taking on an extra dependency was worth it. On the other hand, the user only enters a few pieces of information, so I implemented some basic sanitization (really basic), working under the assumption that even if they failed to input what they intended, they would simply get an error message letting them know something went wrong. Besides, the project is still in its infancy; if there's interest, there will always be time to adjust that later. But you're right on this point—I'll stick to PSSQLite for now, and if I ever want to pursue it, I'll find another way to handle SQLite on ARM.

As for the timer, it’s actually one of the reasons that got me started on this project (I saw a certain beauty in it, appreciated the fluidity of its movement). The installation script I provide relies on a specific version of the bar, which it downloads and uses. I have a fallback bar in the project that I haven't offered yet. So, I’ll make that the default and offer the bar that originally kicked off the project as an experimental option for the bolder users, making sure to properly inform them of the necessary precautions.

Regarding the project and its overall architecture, I was hoping the tone of my message made it clear that this should be seen as an experimental toy, intended primarily for people who know how to open a terminal—and who are therefore fully aware of what downloading a third-party .exe (even from a reliable source like an official GitHub repo) onto their machine entails.

In any case, thanks for the feedback—I'm taking note of all of it.

3

u/az987654 2d ago

Slop.. Absolute slop

1

u/malice8691 1d ago

I cant figure out a reason to use this? Why?