yoobi-cli 0.1.2__py3-none-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: yoobi-cli
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Environment :: Console
|
|
6
|
+
Classifier: Intended Audience :: Developers
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Programming Language :: Rust
|
|
10
|
+
Classifier: Topic :: Utilities
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Summary: Read, plan and verify Yoobi timesheet updates from the command line
|
|
13
|
+
Author: Ruben J. Jongejan <ruben.jongejan@gmail.com>
|
|
14
|
+
License: MIT
|
|
15
|
+
Requires-Python: >=3.8
|
|
16
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
17
|
+
Project-URL: Homepage, https://github.com/rvben/yoobi-cli
|
|
18
|
+
Project-URL: Repository, https://github.com/rvben/yoobi-cli
|
|
19
|
+
|
|
20
|
+
# yoobi-cli
|
|
21
|
+
|
|
22
|
+
A native Rust CLI for Yoobi's classic timesheet: read bookings, turn actual work into reviewed 4/8-hour plans, apply them, and calculate debt or surplus. No Chrome dependency.
|
|
23
|
+
|
|
24
|
+
Build and install locally:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
cargo install --path . --locked
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Log in once. The command prompts for your URL, username and hidden password, verifies the login with Yoobi, then saves the password in the OS credential store (macOS Keychain, Windows Credential Manager or Linux Secret Service):
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
yoobi-cli auth login
|
|
34
|
+
# Or supply the non-secret fields and enter only your password:
|
|
35
|
+
yoobi-cli auth login --base-url https://your-company.yoobi.nl --username your-login
|
|
36
|
+
yoobi-cli auth status
|
|
37
|
+
yoobi-cli tui --month 2026-11
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Every later command reuses that login automatically. Only identity metadata is written to the platform's user config directory under `yoobi-cli/login.json`; the password stays in the OS credential store. `YOOBI_CONFIG_DIR` overrides that directory. `auth status` inspects local configuration without reading the keychain or contacting Yoobi; it does not verify that the saved password still exists or is accepted. `timesheet` verifies access. SSO/MFA-only login is not supported.
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
yoobi-cli auth logout # removes the saved password and login metadata
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
For scripts/CI, explicit `YOOBI_BASE_URL`, `YOOBI_USERNAME` and `YOOBI_PASSWORD` or `YOOBI_PASSWORD_FILE` remain supported. Set only one password source. Password files must be regular files with no group/world permissions (`chmod 600`). Identity fields default to the saved profile, but a saved password is never reused for a different URL or username. Logout leaves environment variables untouched. With no OS credential store available, keep using explicit environment credentials; the CLI does not silently write a plaintext password file.
|
|
47
|
+
|
|
48
|
+
To save credentials noninteractively, set those environment variables and run `auth login`, or pipe a password manager's output to `auth login --base-url URL --username USER --password-stdin`. Password input is bounded to 16 KiB; `--password-stdin` conflicts with environment password sources. There is no password command-line argument. Prompts and errors stay on stderr; passwords are never printed.
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
yoobi-cli projects --month 2026-11
|
|
52
|
+
yoobi-cli timesheet --month 2026-11
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Use an activity ID returned by `projects` as `project_id`. Create `work.json` with actual durations in integer minutes:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"month": "2026-11",
|
|
60
|
+
"project_id": "activity-id-from-projects",
|
|
61
|
+
"opening_balance_minutes": 450,
|
|
62
|
+
"days": [
|
|
63
|
+
{"date": "2026-11-02", "actual_minutes": 360},
|
|
64
|
+
{"date": "2026-11-03", "actual_minutes": 345, "hours": 8},
|
|
65
|
+
{"date": "2026-11-04", "actual_minutes": 240}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
By default, positive work under 6 hours rounds to 4; 6 hours or more rounds to 8. Set `hours` explicitly to choose 4 or 8, including the 5h45 → 8h exception. Omit zero-work days. A plan replaces that activity's daily total; it does not add another booking.
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
yoobi-cli plan work.json --output json > plan.json
|
|
74
|
+
yoobi-cli apply plan.json --dry-run
|
|
75
|
+
yoobi-cli balance plan.json --output text
|
|
76
|
+
# After reviewing the plan:
|
|
77
|
+
yoobi-cli apply plan.json --yes
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Plans record the origin, employee, and previous daily values. Apply reads fresh data, refuses stale or locked changes, skips already matching entries, then reads again to verify all bookings in the month. It only writes the selected activity and dates. Closing/approving timesheets, overtime, mandatory notes, alternative booking types, and creating activities are unsupported. Existing note/reference values are preserved. The native adapter follows the observed classic Yoobi 2.30.2 routes; format changes fail closed.
|
|
81
|
+
|
|
82
|
+
Yoobi offers no atomic compare-and-save in this protocol: a concurrent edit between the preflight read and save can race. Avoid editing the same timesheet elsewhere while applying. A network error may occur after a save; inspect the timesheet before retrying. Writes are never automatically retried.
|
|
83
|
+
|
|
84
|
+
Balance is `opening balance + actual − booked`: positive is surplus, negative is debt. To calculate an independent balance offline, pass a ledger instead of a plan:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"opening_balance_minutes": 450,
|
|
89
|
+
"days": [
|
|
90
|
+
{"date": "2026-11-02", "actual_minutes": 345, "booked_minutes": 480}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
## Interactive review
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
yoobi-cli tui --demo # offline sample and sample plan
|
|
100
|
+
yoobi-cli tui --month 2026-11 # connected, read only
|
|
101
|
+
yoobi-cli tui --plan plan.json # account-bound plan preview
|
|
102
|
+
yoobi-cli tui --demo --snapshot --month 2026-11 --width 120 --height 36
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The TUI shows activities, a daily ledger, lock/change states, actual versus planned hours, and projected surplus/debt. It adapts from 40-column terminals to a three-pane workspace. The demo is always labelled and does not read credentials or send requests. Connected reads happen in a background worker. If a refresh fails, its error stays visible and can be retried.
|
|
106
|
+
|
|
107
|
+
Use **↑/↓** or **j/k** for days, **Tab/Shift-Tab** for activities, **Enter** for day detail/back, **[ / ]** for months, **/** to find a date, **r** to refresh, **?** for help, and **q** or **Ctrl-C** to quit. Home/End and Page Up/Down work too. In day detail, the movement keys scroll so balances remain reachable in short terminals. Press **e** to expand an error and read its recovery instructions. A real plan fixes the month to prevent mixing accounts or periods. Preview balance includes only the plan dates and its opening carry. The TUI never writes bookings; review then use `apply plan.json --yes`.
|
|
108
|
+
|
|
109
|
+
Interactive use requires terminal stdin and stdout. Piped calls fail before authentication. The bounded, plain-text snapshot mode requires `--demo`; JSON output is available through the regular commands. Human text output uses tables rather than raw JSON. Error code **6** means a terminal is required.
|
|
110
|
+
|
|
111
|
+
Output is JSON when piped and readable text on a terminal. Override with `--output json|text`. `schema` prints the clispec v0.3 contract; `completions zsh` generates shell completion definitions. Plan files and timesheet output contain account identifiers and should be kept private.
|
|
112
|
+
|
|
113
|
+
Exit codes: 0 success; 1 input/network/protocol/I/O error; 3 usage error; 4 authentication error; 5 conflict. Errors are JSON envelopes on stderr.
|
|
114
|
+
|
|
115
|
+
Requires Rust 1.100 or later. Development: `cargo test`, `cargo fmt --check`, `cargo clippy --all-targets -- -D warnings`. `uv run --no-project --with pyte scripts/check_tui.py` exercises help, filtering, month navigation, plan detail, scrolling, Ctrl-C and terminal restoration in real pseudo-terminals at 120×36 and 40×16. CI runs this check too. HTTP tests use synthetic fixtures and a local mock server; no real timesheets are changed by tests.
|
|
116
|
+
|
|
117
|
+
MIT licensed.
|
|
118
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
yoobi_cli-0.1.2.data/scripts/yoobi-cli,sha256=UiOgBwmErY-xaXCGAGiVHD3uvoL_0M7QrDA_h73raJs,5675136
|
|
2
|
+
yoobi_cli-0.1.2.dist-info/METADATA,sha256=bJRsiM_PducLKvdedmwbQDoJKtMvEtJb5NNzyjyrtIc,7544
|
|
3
|
+
yoobi_cli-0.1.2.dist-info/WHEEL,sha256=Fvrs5zUKO4nQbE5Fttn9y8loVOWxn3I3-bRdoW2U0nw,102
|
|
4
|
+
yoobi_cli-0.1.2.dist-info/licenses/LICENSE,sha256=C-fnAxNl5_rkYD0NgIn5gEeZxx-ew8mOfqo_HJk3t4k,1101
|
|
5
|
+
yoobi_cli-0.1.2.dist-info/sboms/yoobi-cli.cyclonedx.json,sha256=hb8i4OYQls0uAVao8ElGDVqAkviuBxEwP6tJs1y4rLY,298408
|
|
6
|
+
yoobi_cli-0.1.2.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ruben J. Jongejan <ruben.jongejan@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|