@@ -16,45 +16,38 @@ just tui-dev
1616
1717# Clear saved session
1818just tui-logout
19-
20- # Print config path and create default config if missing
21- just tui-config
2219```
2320
24- ## Configuration
25-
26- Config file: ` ~/.config/toki-tui/config.toml `
27-
28- Run ` just tui-config ` (or ` cargo run -- config-path ` ) to print the path and create the file with defaults if it does not exist.
21+ ## CLI Commands
2922
30- All keys are optional. If the file is missing, built-in defaults are used.
31-
32- ### Environment variables
23+ All commands are available via the binary directly (` toki-tui <command> ` ) or through ` just ` :
3324
34- You can override config values with environment variables.
25+ | Command | ` just ` recipe | Description |
26+ | -------------- | -------------- | -------------------------------------------------- |
27+ | ` run ` | ` just tui ` | Run against the real toki-api server |
28+ | ` dev ` | ` just tui-dev ` | Run in dev mode with in-memory mock data |
29+ | ` login ` | ` just tui-login ` | Authenticate via browser OAuth |
30+ | ` logout ` | ` just tui-logout ` | Clear saved session and Milltime cookies |
31+ | ` status ` | ` just tui-status ` | Show current login and Milltime session status |
32+ | ` config-path ` | ` just tui-config ` | Print config path; create default file if missing |
33+ | ` logs-path ` | ` just tui-logs ` | Print the log notes directory path |
34+ | ` version ` | ` just tui-version ` | Print the current version |
3535
36- - Prefix: ` TOKI_TUI_ `
37- - Key format: uppercase snake case
38- - Nested keys (if added later): use ` __ ` as separator
36+ ## Configuration
3937
40- Current variables:
38+ Config file: ` ~/.config/toki-tui/config.toml `
4139
42- ``` bash
43- TOKI_TUI_API_URL=" http://localhost:8080"
44- TOKI_TUI_GIT_DEFAULT_PREFIX=" Development"
45- TOKI_TUI_TASK_FILTER=" +work project:Toki"
46- TOKI_TUI_AUTO_RESIZE_TIMER=true
47- ```
40+ Run ` just tui-config ` (or ` toki-tui config-path ` ) to print the path and create the file with defaults if it does not exist.
4841
49- Environment variables override values from ` config.toml ` .
42+ All keys are optional. If the file is missing, built-in defaults are used .
5043
5144``` toml
5245# URL of the toki-api server. Defaults to the production instance.
5346api_url = " https://toki-api.spinit.se"
5447
5548# Prefix used when converting a git branch name to a time entry note,
5649# when no conventional commit prefix (feat/fix/etc.) or ticket number is found.
57- # Example: branch "branding/redesign" → "Utveckling : branding/redesign"
50+ # Example: branch "branding/redesign" → "Development : branding/redesign"
5851git_default_prefix = " Utveckling"
5952
6053# Taskwarrior filter tokens prepended before `status:pending export`.
@@ -66,6 +59,32 @@ task_filter = ""
6659# When true (default), the timer grows large when running and shrinks when stopped.
6760# Set to false to keep the timer at a fixed (normal) size at all times.
6861auto_resize_timer = true
62+
63+ # Entry templates — pre-fill project, activity and note from a picker (press T).
64+ # [[template]] sections can be repeated.
65+ [[template ]]
66+ name = " My project"
67+ project = " My Project"
68+ activity = " Development"
69+ note = " Working on stuff"
70+ ```
71+
72+ ### Entry templates
73+
74+ Define reusable presets in ` config.toml ` . In the timer view, press ` T ` to open the template picker and select one to pre-fill the current entry.
75+
76+ ### Environment variables
77+
78+ Environment variables override values from ` config.toml ` .
79+
80+ - Prefix: ` TOKI_TUI_ `
81+ - Key format: uppercase snake case
82+
83+ ``` bash
84+ TOKI_TUI_API_URL=" http://localhost:8080"
85+ TOKI_TUI_GIT_DEFAULT_PREFIX=" Development"
86+ TOKI_TUI_TASK_FILTER=" +work project:Toki"
87+ TOKI_TUI_AUTO_RESIZE_TIMER=true
6988```
7089
7190### Example: local dev setup
@@ -76,33 +95,71 @@ git_default_prefix = "Development"
7695task_filter = " +work"
7796```
7897
79- ## Testing
98+ ## Log notes
99+
100+ Attach a freeform markdown log file to any time entry. Log files are stored in ` ~/.local/share/toki-tui/logs/ ` and linked to entries via a tag embedded in the note (` [log:XXXXXX] ` ). The tag is hidden in all display locations — only the clean summary is shown.
101+
102+ Run ` just tui-logs ` (or ` toki-tui logs-path ` ) to print the log directory path.
103+
104+ ## Key bindings
105+
106+ ### Timer view
107+
108+ | Key | Action |
109+ | -------------------- | ----------------------------- |
110+ | ` Space ` | Start / stop timer |
111+ | ` Ctrl+S ` | Save (with options) |
112+ | ` Ctrl+R ` | Resume last entry |
113+ | ` Ctrl+X ` | Clear current entry |
114+ | ` Enter ` | Edit description |
115+ | ` P ` | Edit project / activity |
116+ | ` N ` | Edit note (description editor) |
117+ | ` T ` | Open template picker |
118+ | ` H ` | Switch to history view |
119+ | ` S ` | Switch to statistics view |
120+ | ` X ` | Toggle timer size |
121+ | ` Z ` | Zen mode (hide UI chrome) |
122+ | ` Tab / ↑↓ / j/k ` | Navigate |
123+ | ` Q ` | Quit |
124+
125+ ### Description editor (note / ` N ` )
126+
127+ | Key | Action |
128+ | -------------------- | ----------------------------- |
129+ | ` Ctrl+L ` | Add / edit log file |
130+ | ` Ctrl+R ` | Remove linked log file |
131+ | ` Ctrl+D ` | Change working directory |
132+ | ` Ctrl+G ` | Git: copy/paste branch or commit |
133+ | ` Ctrl+T ` | Taskwarrior: pick a task |
134+ | ` Ctrl+X ` | Clear note |
135+ | ` Ctrl+←/→ ` | Word-boundary navigation |
136+ | ` Ctrl+Backspace ` | Delete word back |
137+ | ` Enter ` | Confirm |
138+ | ` Esc ` | Cancel |
139+
140+ ### History view
141+
142+ | Key | Action |
143+ | -------------------- | ----------------------------- |
144+ | ` ↑↓ ` | Navigate entries |
145+ | ` Enter ` | Edit entry |
146+ | ` Ctrl+R ` | Resume entry (copy to timer) |
147+ | ` Ctrl+L ` | Open linked log file |
148+ | ` H / Esc ` | Back to timer view |
149+ | ` Q ` | Quit |
150+
151+ ** While editing a history entry:**
152+
153+ | Key | Action |
154+ | -------------------- | ----------------------------- |
155+ | ` Tab ` | Next field |
156+ | ` P / A ` | Change project / activity |
157+ | ` Esc ` | Save and exit edit mode |
80158
81- Run the TUI test suite with:
159+ ## Testing
82160
83161``` bash
84- cargo test -p toki-tui
162+ SQLX_OFFLINE=true cargo test -p toki-tui
85163```
86164
87- The current tests focus on the most stable and useful layers first:
88-
89- - app and state behavior
90- - parsing and text input helpers
91- - runtime action handling with the dev backend
92- - focused Ratatui render assertions for important UI states
93-
94- ## Standard key bindings
95-
96- | Key | Action |
97- | -------------- | ------------------ |
98- | ` Space ` | Start / stop timer |
99- | ` Ctrl+S ` | Save (options) |
100- | ` Ctrl+X ` | Clear |
101- | ` Tab / ↑↓ / j/k ` | Navigate |
102- | ` H ` | History view |
103- | ` P ` | Project |
104- | ` N ` | Note |
105- | ` T ` | Toggle timer size |
106- | ` S ` | Stats |
107- | ` Esc ` | Exit / cancel |
108- | ` Q ` | Quit |
165+ Tests cover app and state behavior, text input helpers, runtime action handling, and focused Ratatui render assertions.
0 commit comments