super-productivity-cli 0.1.0__tar.gz
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.
- super_productivity_cli-0.1.0/.github/workflows/publish.yml +44 -0
- super_productivity_cli-0.1.0/.gitignore +23 -0
- super_productivity_cli-0.1.0/LICENSE +21 -0
- super_productivity_cli-0.1.0/PKG-INFO +205 -0
- super_productivity_cli-0.1.0/README.md +178 -0
- super_productivity_cli-0.1.0/demo.json +743 -0
- super_productivity_cli-0.1.0/pyproject.toml +45 -0
- super_productivity_cli-0.1.0/sp.py +925 -0
- super_productivity_cli-0.1.0/test.py +83 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
name: Build distribution 📦
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- name: Set up Python
|
|
15
|
+
uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.x"
|
|
18
|
+
- name: Install pypa/build
|
|
19
|
+
run: python3 -m pip install build --user
|
|
20
|
+
- name: Build a binary wheel and a source tarball
|
|
21
|
+
run: python3 -m build
|
|
22
|
+
- name: Store the distribution packages
|
|
23
|
+
uses: actions/upload-artifact@v4
|
|
24
|
+
with:
|
|
25
|
+
name: python-package-distributions
|
|
26
|
+
path: dist/
|
|
27
|
+
|
|
28
|
+
publish-to-pypi:
|
|
29
|
+
name: Publish to PyPI 🚀
|
|
30
|
+
needs: build
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
environment:
|
|
33
|
+
name: pypi
|
|
34
|
+
url: https://pypi.org/p/super-productivity-cli
|
|
35
|
+
permissions:
|
|
36
|
+
id-token: write # IMPORTANT: mandatory for Trusted Publishing
|
|
37
|
+
steps:
|
|
38
|
+
- name: Download all the dists
|
|
39
|
+
uses: actions/download-artifact@v4
|
|
40
|
+
with:
|
|
41
|
+
name: python-package-distributions
|
|
42
|
+
path: dist/
|
|
43
|
+
- name: Publish distribution 📦 to PyPI
|
|
44
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.pyc
|
|
4
|
+
|
|
5
|
+
# Local data / Backups
|
|
6
|
+
data/sync-data.extracted.json
|
|
7
|
+
data/sync-data.json
|
|
8
|
+
*.bak
|
|
9
|
+
|
|
10
|
+
# Virtual Env
|
|
11
|
+
.venv/
|
|
12
|
+
venv/
|
|
13
|
+
env/
|
|
14
|
+
.env
|
|
15
|
+
|
|
16
|
+
# OS Files
|
|
17
|
+
.DS_Store
|
|
18
|
+
Thumbs.db
|
|
19
|
+
|
|
20
|
+
# Build artifacts
|
|
21
|
+
build/
|
|
22
|
+
dist/
|
|
23
|
+
*.egg-info/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Onur
|
|
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.
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: super-productivity-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A fast, lightweight, and powerful Command Line Interface for Super Productivity
|
|
5
|
+
Project-URL: Homepage, https://github.com/onesvat/super-productivity-cli
|
|
6
|
+
Project-URL: Repository, https://github.com/onesvat/super-productivity-cli.git
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/onesvat/super-productivity-cli/issues
|
|
8
|
+
Author-email: Onur NESVAT <onurnesvat@gmail.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: cli,productivity,super-productivity,task-manager,time-tracking
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Office/Business :: Scheduling
|
|
24
|
+
Classifier: Topic :: Utilities
|
|
25
|
+
Requires-Python: >=3.7
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# Super Productivity CLI (`sp.py`)
|
|
29
|
+
|
|
30
|
+
A fast, lightweight, and powerful Command Line Interface for [Super Productivity](https://super-productivity.com/) written in Python. It directly reads, modifies, and synchronizes your Super Productivity data file natively, allowing for quick terminal-based task and time management that immediately reflects in your main GUI app.
|
|
31
|
+
|
|
32
|
+
## ☁️ Cloud Sync & Requirements (Read First!)
|
|
33
|
+
|
|
34
|
+
To use this CLI effectively with cloud sync, you **must have Dropbox Sync enabled** in your Super Productivity app and **`rclone` installed** on your system.
|
|
35
|
+
|
|
36
|
+
**1. Install `rclone`**
|
|
37
|
+
- **macOS/Linux:** `sudo -v ; curl https://rclone.org/install.sh | sudo bash`
|
|
38
|
+
- **Windows:** Download from [rclone.org](https://rclone.org/downloads/) or run `winget install Rclone.Rclone`
|
|
39
|
+
|
|
40
|
+
**2. Configure Dropbox remote**
|
|
41
|
+
Run `rclone config`, create a new remote, and name it **exactly** `dropbox`. Follow the interactive prompts to authorize it.
|
|
42
|
+
|
|
43
|
+
**3. Python 3.x** is required to run the script.
|
|
44
|
+
|
|
45
|
+
**4. Install the CLI**
|
|
46
|
+
For standalone CLI tools like this, we recommend using **pipx**:
|
|
47
|
+
```bash
|
|
48
|
+
pipx install super-productivity-cli
|
|
49
|
+
```
|
|
50
|
+
Alternatively, using standard pip:
|
|
51
|
+
```bash
|
|
52
|
+
pip install super-productivity-cli
|
|
53
|
+
```
|
|
54
|
+
Now you can simply use the `sp` command from anywhere!
|
|
55
|
+
|
|
56
|
+
*(Note: The CLI config path defaults to `~/.config/super-productivity-cli` for your data and state configs.)*
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Development
|
|
61
|
+
|
|
62
|
+
If you want to contribute or run from source:
|
|
63
|
+
|
|
64
|
+
1. Clone the repo:
|
|
65
|
+
```bash
|
|
66
|
+
git clone https://github.com/onur/super-productivity-cli
|
|
67
|
+
cd super-productivity-cli
|
|
68
|
+
```
|
|
69
|
+
2. Install in editable mode:
|
|
70
|
+
```bash
|
|
71
|
+
pip install -e .
|
|
72
|
+
```
|
|
73
|
+
*Tip: We use [Hatch](https://hatch.pypa.io/) as our build backend.*
|
|
74
|
+
|
|
75
|
+
## Publishing
|
|
76
|
+
|
|
77
|
+
This project uses **Trusted Publishing** via GitHub Actions. To release a new version:
|
|
78
|
+
1. Update the version in `pyproject.toml`.
|
|
79
|
+
2. Push a new git tag (e.g., `git tag v0.1.0 && git push --tags`).
|
|
80
|
+
3. GitHub Actions will automatically build and publish the package to PyPI.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
## Capabilities
|
|
86
|
+
|
|
87
|
+
- **Full Native Compatibility:** Edits `sync-data.json` directly via standard JSON encoding, meaning tasks and time tracking are fully compatible with the official Super Productivity app.
|
|
88
|
+
- **Resource Endpoints:** Cleanly categorized commands (`sp status`, `sp task`, `sp project`, `sp counter`).
|
|
89
|
+
- **Cloud Sync Support:** Built-in integration with `rclone` for syncing your tasks to Dropbox before and after execution.
|
|
90
|
+
- **Graceful Offline Fallback:** Uninterrupted usage if cloud sync fails or if `rclone` isn't configured.
|
|
91
|
+
- **Advanced Counters (`simpleCounter`):** Full control over Click Counters and Stopwatches, including daily/weekly streak tracking and countdown timers.
|
|
92
|
+
- **Fuzzy Matching:** Smart substring-based searching for easily referring to tasks without knowing full titles.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
## Usage
|
|
96
|
+
|
|
97
|
+
The CLI behaves just like `git` or `docker`. You pass an endpoint (`task`, `project`, `counter`) followed by a verb (`add`, `edit`, `list`, `delete`, etc.).
|
|
98
|
+
|
|
99
|
+
### 📊 Global Status
|
|
100
|
+
|
|
101
|
+
See a quick daily summary of active tracking, unticked tasks for today, total time spent, and project distribution.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
sp.py status
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 📋 Task Management (`sp task`)
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# List all tasks
|
|
111
|
+
sp.py task list
|
|
112
|
+
|
|
113
|
+
# Filter tasks
|
|
114
|
+
sp.py task list --today
|
|
115
|
+
sp.py task list --done
|
|
116
|
+
sp.py task list --project "Work"
|
|
117
|
+
|
|
118
|
+
# Setup tasks
|
|
119
|
+
sp.py task add "Write weekly report"
|
|
120
|
+
sp.py task add "Fix bug #123" --project "Inbox" --estimate 45m
|
|
121
|
+
|
|
122
|
+
# Edit or Modify
|
|
123
|
+
sp.py task edit "weekly report" --title "Write final report"
|
|
124
|
+
sp.py task estimate "report" 2h
|
|
125
|
+
|
|
126
|
+
# Log Time & Status Updates
|
|
127
|
+
sp.py task log "report" 1h30m # Log 1 hour and 30 minutes
|
|
128
|
+
sp.py task log "report" 2h --date 2026-02-28 # Log time for a past date
|
|
129
|
+
sp.py task done "bug" # Mask task as done
|
|
130
|
+
sp.py task today "report" # Toggle task on Today's list
|
|
131
|
+
sp.py task move "bug" --project Work # Move task to another project
|
|
132
|
+
|
|
133
|
+
# Delete
|
|
134
|
+
sp.py task delete "bug"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
*Note: `sp task start` and `sp task stop` are not provided as active session states are stored client-side in the Super Productivity frontend.*
|
|
138
|
+
|
|
139
|
+
### ⏳ Counters & Habits (`sp counter`)
|
|
140
|
+
|
|
141
|
+
Supports two native types: **StopWatches** (tracking durations) and **ClickCounters** (tracking counts/habits).
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# List all counters
|
|
145
|
+
sp.py counter list
|
|
146
|
+
|
|
147
|
+
# Quickly toggle a state:
|
|
148
|
+
sp.py counter toggle "water" # Increments a ClickCounter (+1)
|
|
149
|
+
sp.py counter toggle "stand desk" # Starts or Pauses a StopWatch
|
|
150
|
+
|
|
151
|
+
# Manually log values
|
|
152
|
+
sp.py counter log "water" 5
|
|
153
|
+
sp.py counter log "stand desk" 1h
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Advanced Counter Creation & Editing**
|
|
157
|
+
|
|
158
|
+
It natively supports Super Productivity's streak tracker, schedules, icons, and countdowns!
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Create simple ClickCounter
|
|
162
|
+
sp.py counter add "Drink Water" --type ClickCounter --icon "local_drink"
|
|
163
|
+
|
|
164
|
+
# Create a StopWatch that counts down
|
|
165
|
+
sp.py counter add "Reading Session" --type StopWatch --countdown 30m --icon "menu_book"
|
|
166
|
+
|
|
167
|
+
# Create a habit with specific streak days (1=Mon ... 5=Fri)
|
|
168
|
+
sp.py counter add "Work out" --type ClickCounter \
|
|
169
|
+
--track-streaks \
|
|
170
|
+
--streak-min 1 \
|
|
171
|
+
--streak-days "1,2,3,4,5" \
|
|
172
|
+
--icon "fitness_center"
|
|
173
|
+
|
|
174
|
+
# Create a habit for exactly 3 times a week (Frequency Streak)
|
|
175
|
+
sp.py counter add "Call Parents" --type ClickCounter \
|
|
176
|
+
--track-streaks \
|
|
177
|
+
--streak-mode weekly-frequency \
|
|
178
|
+
--streak-freq 3
|
|
179
|
+
|
|
180
|
+
# Edit an existing counter
|
|
181
|
+
sp.py counter edit "Work out" --title "Gym" --streak-freq 4
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### 📁 Project Management (`sp project`)
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# List existing projects
|
|
188
|
+
sp.py project list
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
## Automation & Testing
|
|
193
|
+
|
|
194
|
+
We provide a **`test.py`** script containing full endpoint integration coverage using a sterilized `demo.json`.
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# Automatically sets up demo.json in a safe sandbox mode, runs all commands, and restores original data securely.
|
|
198
|
+
python3 test.py
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Setup Notes `(Syncing)`
|
|
202
|
+
|
|
203
|
+
By default, the script looks for your synced application save on Dropbox via `rclone`.
|
|
204
|
+
The hardcoded target inside `sp.py` is `dropbox:Apps/super_productivity/sync-data.json`.
|
|
205
|
+
Make sure you have an rclone remote configured named `dropbox` exactly if you plan to use sync. If it fails, the script falls back back safely to `data/sync-data.extracted.json`!
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Super Productivity CLI (`sp.py`)
|
|
2
|
+
|
|
3
|
+
A fast, lightweight, and powerful Command Line Interface for [Super Productivity](https://super-productivity.com/) written in Python. It directly reads, modifies, and synchronizes your Super Productivity data file natively, allowing for quick terminal-based task and time management that immediately reflects in your main GUI app.
|
|
4
|
+
|
|
5
|
+
## ☁️ Cloud Sync & Requirements (Read First!)
|
|
6
|
+
|
|
7
|
+
To use this CLI effectively with cloud sync, you **must have Dropbox Sync enabled** in your Super Productivity app and **`rclone` installed** on your system.
|
|
8
|
+
|
|
9
|
+
**1. Install `rclone`**
|
|
10
|
+
- **macOS/Linux:** `sudo -v ; curl https://rclone.org/install.sh | sudo bash`
|
|
11
|
+
- **Windows:** Download from [rclone.org](https://rclone.org/downloads/) or run `winget install Rclone.Rclone`
|
|
12
|
+
|
|
13
|
+
**2. Configure Dropbox remote**
|
|
14
|
+
Run `rclone config`, create a new remote, and name it **exactly** `dropbox`. Follow the interactive prompts to authorize it.
|
|
15
|
+
|
|
16
|
+
**3. Python 3.x** is required to run the script.
|
|
17
|
+
|
|
18
|
+
**4. Install the CLI**
|
|
19
|
+
For standalone CLI tools like this, we recommend using **pipx**:
|
|
20
|
+
```bash
|
|
21
|
+
pipx install super-productivity-cli
|
|
22
|
+
```
|
|
23
|
+
Alternatively, using standard pip:
|
|
24
|
+
```bash
|
|
25
|
+
pip install super-productivity-cli
|
|
26
|
+
```
|
|
27
|
+
Now you can simply use the `sp` command from anywhere!
|
|
28
|
+
|
|
29
|
+
*(Note: The CLI config path defaults to `~/.config/super-productivity-cli` for your data and state configs.)*
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Development
|
|
34
|
+
|
|
35
|
+
If you want to contribute or run from source:
|
|
36
|
+
|
|
37
|
+
1. Clone the repo:
|
|
38
|
+
```bash
|
|
39
|
+
git clone https://github.com/onur/super-productivity-cli
|
|
40
|
+
cd super-productivity-cli
|
|
41
|
+
```
|
|
42
|
+
2. Install in editable mode:
|
|
43
|
+
```bash
|
|
44
|
+
pip install -e .
|
|
45
|
+
```
|
|
46
|
+
*Tip: We use [Hatch](https://hatch.pypa.io/) as our build backend.*
|
|
47
|
+
|
|
48
|
+
## Publishing
|
|
49
|
+
|
|
50
|
+
This project uses **Trusted Publishing** via GitHub Actions. To release a new version:
|
|
51
|
+
1. Update the version in `pyproject.toml`.
|
|
52
|
+
2. Push a new git tag (e.g., `git tag v0.1.0 && git push --tags`).
|
|
53
|
+
3. GitHub Actions will automatically build and publish the package to PyPI.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## Capabilities
|
|
59
|
+
|
|
60
|
+
- **Full Native Compatibility:** Edits `sync-data.json` directly via standard JSON encoding, meaning tasks and time tracking are fully compatible with the official Super Productivity app.
|
|
61
|
+
- **Resource Endpoints:** Cleanly categorized commands (`sp status`, `sp task`, `sp project`, `sp counter`).
|
|
62
|
+
- **Cloud Sync Support:** Built-in integration with `rclone` for syncing your tasks to Dropbox before and after execution.
|
|
63
|
+
- **Graceful Offline Fallback:** Uninterrupted usage if cloud sync fails or if `rclone` isn't configured.
|
|
64
|
+
- **Advanced Counters (`simpleCounter`):** Full control over Click Counters and Stopwatches, including daily/weekly streak tracking and countdown timers.
|
|
65
|
+
- **Fuzzy Matching:** Smart substring-based searching for easily referring to tasks without knowing full titles.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
## Usage
|
|
69
|
+
|
|
70
|
+
The CLI behaves just like `git` or `docker`. You pass an endpoint (`task`, `project`, `counter`) followed by a verb (`add`, `edit`, `list`, `delete`, etc.).
|
|
71
|
+
|
|
72
|
+
### 📊 Global Status
|
|
73
|
+
|
|
74
|
+
See a quick daily summary of active tracking, unticked tasks for today, total time spent, and project distribution.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
sp.py status
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 📋 Task Management (`sp task`)
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# List all tasks
|
|
84
|
+
sp.py task list
|
|
85
|
+
|
|
86
|
+
# Filter tasks
|
|
87
|
+
sp.py task list --today
|
|
88
|
+
sp.py task list --done
|
|
89
|
+
sp.py task list --project "Work"
|
|
90
|
+
|
|
91
|
+
# Setup tasks
|
|
92
|
+
sp.py task add "Write weekly report"
|
|
93
|
+
sp.py task add "Fix bug #123" --project "Inbox" --estimate 45m
|
|
94
|
+
|
|
95
|
+
# Edit or Modify
|
|
96
|
+
sp.py task edit "weekly report" --title "Write final report"
|
|
97
|
+
sp.py task estimate "report" 2h
|
|
98
|
+
|
|
99
|
+
# Log Time & Status Updates
|
|
100
|
+
sp.py task log "report" 1h30m # Log 1 hour and 30 minutes
|
|
101
|
+
sp.py task log "report" 2h --date 2026-02-28 # Log time for a past date
|
|
102
|
+
sp.py task done "bug" # Mask task as done
|
|
103
|
+
sp.py task today "report" # Toggle task on Today's list
|
|
104
|
+
sp.py task move "bug" --project Work # Move task to another project
|
|
105
|
+
|
|
106
|
+
# Delete
|
|
107
|
+
sp.py task delete "bug"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
*Note: `sp task start` and `sp task stop` are not provided as active session states are stored client-side in the Super Productivity frontend.*
|
|
111
|
+
|
|
112
|
+
### ⏳ Counters & Habits (`sp counter`)
|
|
113
|
+
|
|
114
|
+
Supports two native types: **StopWatches** (tracking durations) and **ClickCounters** (tracking counts/habits).
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# List all counters
|
|
118
|
+
sp.py counter list
|
|
119
|
+
|
|
120
|
+
# Quickly toggle a state:
|
|
121
|
+
sp.py counter toggle "water" # Increments a ClickCounter (+1)
|
|
122
|
+
sp.py counter toggle "stand desk" # Starts or Pauses a StopWatch
|
|
123
|
+
|
|
124
|
+
# Manually log values
|
|
125
|
+
sp.py counter log "water" 5
|
|
126
|
+
sp.py counter log "stand desk" 1h
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Advanced Counter Creation & Editing**
|
|
130
|
+
|
|
131
|
+
It natively supports Super Productivity's streak tracker, schedules, icons, and countdowns!
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Create simple ClickCounter
|
|
135
|
+
sp.py counter add "Drink Water" --type ClickCounter --icon "local_drink"
|
|
136
|
+
|
|
137
|
+
# Create a StopWatch that counts down
|
|
138
|
+
sp.py counter add "Reading Session" --type StopWatch --countdown 30m --icon "menu_book"
|
|
139
|
+
|
|
140
|
+
# Create a habit with specific streak days (1=Mon ... 5=Fri)
|
|
141
|
+
sp.py counter add "Work out" --type ClickCounter \
|
|
142
|
+
--track-streaks \
|
|
143
|
+
--streak-min 1 \
|
|
144
|
+
--streak-days "1,2,3,4,5" \
|
|
145
|
+
--icon "fitness_center"
|
|
146
|
+
|
|
147
|
+
# Create a habit for exactly 3 times a week (Frequency Streak)
|
|
148
|
+
sp.py counter add "Call Parents" --type ClickCounter \
|
|
149
|
+
--track-streaks \
|
|
150
|
+
--streak-mode weekly-frequency \
|
|
151
|
+
--streak-freq 3
|
|
152
|
+
|
|
153
|
+
# Edit an existing counter
|
|
154
|
+
sp.py counter edit "Work out" --title "Gym" --streak-freq 4
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### 📁 Project Management (`sp project`)
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# List existing projects
|
|
161
|
+
sp.py project list
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
## Automation & Testing
|
|
166
|
+
|
|
167
|
+
We provide a **`test.py`** script containing full endpoint integration coverage using a sterilized `demo.json`.
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
# Automatically sets up demo.json in a safe sandbox mode, runs all commands, and restores original data securely.
|
|
171
|
+
python3 test.py
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Setup Notes `(Syncing)`
|
|
175
|
+
|
|
176
|
+
By default, the script looks for your synced application save on Dropbox via `rclone`.
|
|
177
|
+
The hardcoded target inside `sp.py` is `dropbox:Apps/super_productivity/sync-data.json`.
|
|
178
|
+
Make sure you have an rclone remote configured named `dropbox` exactly if you plan to use sync. If it fails, the script falls back back safely to `data/sync-data.extracted.json`!
|