Skip to content

Getting Started

  • Python 3.10+
  • SQLite (bundled with Python)
  • Dependencies (installed automatically): jdatetime, prompt_toolkit
Terminal window
git clone https://github.com/MSadraShakouri/DailyDriver.git
cd DailyDriver
pip install .

To work on the code and run the tests, install the test extra in editable mode:

Terminal window
pip install -e '.[test]'
python -m pytest

From the repository directory:

Terminal window
./main.py # or: python main.py

You’ll see the daily header followed by a > prompt. Type ? for a command summary, add -h after any command for its details, or just start writing a journal entry:

> today was a productive day

Press q to quit. All data is saved instantly to data/daily.db.

Most day-to-day use is single-shot: run one command and exit immediately. Set up a shell alias so logging is a single keystroke away.

Add to ~/.bashrc or ~/.zshrc:

Terminal window
alias da='python /path/to/DailyDriver/main.py'

Then log without entering the interactive prompt:

Terminal window
da p # log the current prayer
da s 23:00 07:15 # log sleep
da "worked on the report 9-11" # a journal entry

Anything you pass as arguments is run as one command, then the app exits. This is the fastest workflow for muscle-memory logging.

The rich interactive prompt (history + autocompletion) only activates in the full REPL on an interactive terminal. Single-shot da calls and piped input fall back to plain prompts automatically, so nothing slows down or breaks.

Both the REPL and the da CLI complete with Tab: subcommands (qada log, nazr counter_reset), flags (-h, --txt, -n), and live database values (target names, qada entries, category paths, active state slots).

  • REPL: built in — just press Tab at the > prompt.
  • CLI: install a script from completions/ (bash, zsh, fish supported), e.g. for bash add to ~/.bashrc:
Terminal window
source /path/to/DailyDriver/completions/daily.bash

Values match fuzzily and best-first: alex, rel/ale, or alemor all find the category relatives/alex_morgan. Command names stay plain substring matches.

In plain zsh, completion is prefix-based as usual. With the fzf-tab plugin, zsh hands every candidate to fzf, so fzf’s own search rules apply (see completions/). Open a new terminal after updating the zsh script.

Then da qada log <TAB> offers prayer slots and backlog names, and da travel <TAB> offers on / off / status.

On Termux you can pop a native Android text dialog for a fast journal entry:

Terminal window
da -md # or: da --termux-dialog

This opens termux-dialog, takes your typed text, and logs it as a journal entry (running category selection afterwards in the terminal). Outside Termux it prints a short notice and exits.

DailyDriver upgrades input with prompt_toolkit (command autocompletion, persistent history, and an autocompleting category picker) when it runs in an interactive terminal. When that isn’t possible — piped input, redirects, a dumb terminal, or if prompt_toolkit is unavailable — it silently falls back to plain prompts and behaves exactly as before. Output (headers, tables, calendars) is always plain text.

Everything lives in data/daily.db (SQLite). There are no analytics; the only network calls are optional weather lookups (Tehran, IRIMO). Inspect the database directly if you like:

Terminal window
sqlite3 data/daily.db ".tables"
sqlite3 data/daily.db "SELECT * FROM entries LIMIT 5;"

You can point the app or the tests at a different database with the DAILYDRIVER_DB environment variable.