Skip to content

thecuriousts/premflow

Repository files navigation

premflow

premflow

Tiny. Clean. Powerful.
A minimalist productivity CLI in pure C — fewer flags, less noise, more signal in your daily log.

Why you need to use premflow

Because your tools should get out of the way — not throw a party. premflow delivers a small binary with minimal dependencies, zero bloat, and zero reasons left to procrastinate. Tiny. Clean. Powerful. Like your morning coffee, but with better error handling. It’s the CLI that respects your time so much it refuses to waste any of its own — and honestly, installing a 200MB Electron app just to write “buy milk” is a crime against humanity. Your excuses have nowhere to hide.


Features

  • 📝 Quick notes & wins logging
  • ✅ Task management (add, list, complete)
  • 📅 Smart daily review — pending todos and recent wins/notes/dones first; pomodoros summarized, not spammed
  • 🍅 Pomodoro timer with sound notifications
  • 📖 Daily journal with template
  • 🔍 Search across logs & tasks
  • 📊 Personal stats dashboard
  • ⚙️ Customizable sounds via config

usecase polished

Installation

Requires CMake 3.14+ and a C11 compiler. The elomaxz MVU library is fetched automatically via CMake FetchContent.

git clone https://github.com/thecuriousts/premflow.git
cd premflow

./build.sh

# Run without installing
./build/premflow

Offline / local elomaxz (skip network fetch):

export ELOMAXZ_SOURCE_DIR=/path/to/elomaxz
./build.sh
# or: cmake -B build -DELOMAXZ_SOURCE_DIR=/path/to/elomaxz && cmake --build build

User-local Install (No sudo)

Make sure ~/.local/bin is in your PATH.

make install   # installs to ~/.local/bin (default)

The Makefile wraps CMake and sets PREFIX ?= $(HOME)/.local by default.

Simplicity by default

Recent work on this branch doubles down on less ceremony, clearer output:

Habit Why
premflow with no args Help — no --help / -h to parse or remember
premflow review Curated end-of-day view: priorities, wins, notes, dones; POMO sessions counted, not listed line-by-line
premflow review --full Raw log tail + full task list only when you need everything
premflow task list Full todo file, always
Plain text under ~/.premflow/ No database, no sync service — grep-friendly logs

Defaults should answer “what matters today?” Opt in to noise (review --full) instead of wading through it every evening.

Usage

Basic commands

premflow                         # Help — type this, not --help
premflow note "Great idea!"
premflow win "Nailed the demo"
premflow task add "Buy milk"
premflow task list               # All active tasks
premflow task done 2
premflow pomo 25
premflow journal
premflow stats
premflow review                  # Smart review (recommended)
premflow review --full           # Raw dump when debugging or auditing
premflow search "meeting"
premflow edit todo
premflow config sound

premflow --help is intentionally unsupported (unknown command). Muscle memory: bare binary for help, subcommand for work.

Example daily workflow

# Morning — plan
premflow journal
premflow task add "Finish project proposal"

# Focus
premflow pomo 50

# Evening — signal, not spam
premflow win "Shipped v2.0"
premflow review                  # Quick curated recap
# premflow review --full         # Uncomment only when you need the raw log

Configuration

Edit sound settings:

premflow config sound

Example config (~/.premflow/config.txt):

Find out your Linux distro's PLAYER and sounds. Update POMO_START, POMO_COMPLETE, TASK_COMPLETE.

PLAYER=paplay
POMO_START=paplay /usr/share/sounds/freedesktop/stereo/phone-incoming-call.oga >/dev/null 2>&1
POMO_COMPLETE=paplay /usr/share/sounds/freedesktop/stereo/complete.oga >/dev/null 2>&1
TASK_COMPLETE=paplay /usr/share/sounds/freedesktop/stereo/bell.oga >/dev/null 2>&1

Empty value = disable that sound.


Useful Make Targets

make              # Configure and build (output in build/)
make test         # Run all 8 comprehensive tests via ctest
make format       # Apply clang-format to all sources (.clang-format)
make format-check # Fail if sources are not formatted (used in CI)
make clean        # Remove build/ directory
make install      # Install to ~/.local/bin (recommended)
make install PREFIX=/usr/local   # System-wide (requires sudo)
make uninstall    # Remove installed binary

Formatting uses clang-format with the repo .clang-format config (requires clang on PATH).

Or with CMake directly:

cmake -B build && cmake --build build
ctest --test-dir build --output-on-failure
cmake --install build --prefix ~/.local

Testing

The test suite includes:

  • String trimming logic
  • Path generation
  • Append / complete task with real temp files
  • Config template creation
  • Journal path & creation
  • Pomodoro edge cases (0, negative values)
  • Full journal template verification

All tests use mkstemp() for safe, isolated file I/O testing.

Philosophy

  • Small surface area — one binary, one shot per shell invocation, no REPL
  • Smart defaults — help without flags; review that highlights signal; --full only when you ask
  • Plain datalog.txt, todo.txt, config.txt under ~/.premflow/
  • Honest Unix CLIelomaxz MVU (run_batch): parse → update → effects → view, then exit
  • Readable C — named limits instead of magic call literals; UI separate from file logic

Design notes and v2 direction: designs/ (start with architecture_v1.md).

Architecture (short)

Each command is a fresh process: parse_argvelomaxz_run_batch (one message) → update / effects / view. No interactive runner, no --help parser — fewer code paths, faster habit loop. Details, diagrams, and runner comparison: designs/architecture_v1.md.

Project Structure

premflow/
├── src/
│   ├── premflow.h  # Shared types and core/ui API
│   ├── main.c      # Bootstrap + argv → message + elomaxz_run_batch
│   ├── app.c/h     # Model, messages, init/update/view
│   ├── effects.c   # handle_cmd — file I/O, editor, pomodoro
│   ├── core.c      # Business logic + error handling
│   └── ui.c        # Display / output functions
├── tests/
│   └── test.c      # Comprehensive test suite
├── designs/            # Architecture + v2 ideas (plain markdown)
│   └── architecture_v1.md
├── CMakeLists.txt  # FetchContent(elomaxz) + targets
├── Makefile        # Thin CMake wrapper
└── README.md

Screenshots

build make usecase

Todos

  • AUR packaging for Arch Linux

premflow — because your tools should get out of the way.


Made with ❤️ for focused, productive humans.

About

Small C CLI for notes, tasks, pomodoro, a daily journal, quick search, and a simple stats view

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors