doingapp 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.
- doingapp-0.1.0/LICENSE +21 -0
- doingapp-0.1.0/PKG-INFO +97 -0
- doingapp-0.1.0/README.md +72 -0
- doingapp-0.1.0/doing_cli/__init__.py +0 -0
- doingapp-0.1.0/doing_cli/api.py +134 -0
- doingapp-0.1.0/doing_cli/auth.py +21 -0
- doingapp-0.1.0/doing_cli/main.py +319 -0
- doingapp-0.1.0/doingapp.egg-info/PKG-INFO +97 -0
- doingapp-0.1.0/doingapp.egg-info/SOURCES.txt +13 -0
- doingapp-0.1.0/doingapp.egg-info/dependency_links.txt +1 -0
- doingapp-0.1.0/doingapp.egg-info/entry_points.txt +2 -0
- doingapp-0.1.0/doingapp.egg-info/requires.txt +3 -0
- doingapp-0.1.0/doingapp.egg-info/top_level.txt +1 -0
- doingapp-0.1.0/pyproject.toml +37 -0
- doingapp-0.1.0/setup.cfg +4 -0
doingapp-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Altellus, LLC
|
|
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.
|
doingapp-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: doingapp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A fast CLI task tracker — track what you're doing from the terminal.
|
|
5
|
+
Author-email: Parker Grimes <parker@altellus.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://doingapp.co
|
|
8
|
+
Project-URL: Repository, https://github.com/altellusllc/doing-cli
|
|
9
|
+
Keywords: cli,tasks,productivity,todo
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Office/Business :: Scheduling
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: typer>=0.9
|
|
22
|
+
Requires-Dist: httpx>=0.25
|
|
23
|
+
Requires-Dist: rich>=13.0
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# doingapp
|
|
27
|
+
|
|
28
|
+
A fast CLI task tracker — track what you're doing from the terminal.
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
$ doing add "Write CLI docs"
|
|
32
|
+
● Added: Write CLI docs (#42)
|
|
33
|
+
|
|
34
|
+
$ doing
|
|
35
|
+
● #42 Write CLI docs
|
|
36
|
+
● #41 Review PR
|
|
37
|
+
|
|
38
|
+
$ doing done 42
|
|
39
|
+
✓ Done: Write CLI docs
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pipx install doingapp
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Or with pip:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install doingapp
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Requires Python 3.11+.
|
|
55
|
+
|
|
56
|
+
## Getting started
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
doing login # Log in with your Doing account
|
|
60
|
+
doing add "My task" # Add a task
|
|
61
|
+
doing # See what's on your plate
|
|
62
|
+
doing done 1 # Mark task #1 as done
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Commands
|
|
66
|
+
|
|
67
|
+
| Command | Description |
|
|
68
|
+
|---------|-------------|
|
|
69
|
+
| `doing` | Show active tasks (same as `doing ls`) |
|
|
70
|
+
| `doing add <title>` | Add a task (`-n` notes, `-c` context ID) |
|
|
71
|
+
| `doing done <id>` | Mark a task as done |
|
|
72
|
+
| `doing pause <id>` | Pause a task |
|
|
73
|
+
| `doing resume <id>` | Resume a paused task |
|
|
74
|
+
| `doing reopen <id>` | Reopen a completed task |
|
|
75
|
+
| `doing edit <id>` | Edit a task (`-t` title, `-n` notes, `-c` context, `--no-context`) |
|
|
76
|
+
| `doing rm <id>` | Delete a task |
|
|
77
|
+
| `doing ls` | List active tasks |
|
|
78
|
+
| `doing log` | Show tasks done today (`-d YYYY-MM-DD` for other dates) |
|
|
79
|
+
| `doing today` | Show all tasks grouped by status |
|
|
80
|
+
| `doing clear` | Mark all active tasks as done |
|
|
81
|
+
| `doing contexts` | List contexts |
|
|
82
|
+
| `doing context add <name>` | Create a context |
|
|
83
|
+
| `doing context rm <id>` | Delete a context |
|
|
84
|
+
| `doing login` | Log in |
|
|
85
|
+
| `doing logout` | Log out |
|
|
86
|
+
|
|
87
|
+
## Configuration
|
|
88
|
+
|
|
89
|
+
By default the CLI talks to `https://doingapp.co`. To point at a different server:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
export DOING_API_URL=http://localhost:8001
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
MIT
|
doingapp-0.1.0/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# doingapp
|
|
2
|
+
|
|
3
|
+
A fast CLI task tracker — track what you're doing from the terminal.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
$ doing add "Write CLI docs"
|
|
7
|
+
● Added: Write CLI docs (#42)
|
|
8
|
+
|
|
9
|
+
$ doing
|
|
10
|
+
● #42 Write CLI docs
|
|
11
|
+
● #41 Review PR
|
|
12
|
+
|
|
13
|
+
$ doing done 42
|
|
14
|
+
✓ Done: Write CLI docs
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pipx install doingapp
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or with pip:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install doingapp
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Requires Python 3.11+.
|
|
30
|
+
|
|
31
|
+
## Getting started
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
doing login # Log in with your Doing account
|
|
35
|
+
doing add "My task" # Add a task
|
|
36
|
+
doing # See what's on your plate
|
|
37
|
+
doing done 1 # Mark task #1 as done
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Commands
|
|
41
|
+
|
|
42
|
+
| Command | Description |
|
|
43
|
+
|---------|-------------|
|
|
44
|
+
| `doing` | Show active tasks (same as `doing ls`) |
|
|
45
|
+
| `doing add <title>` | Add a task (`-n` notes, `-c` context ID) |
|
|
46
|
+
| `doing done <id>` | Mark a task as done |
|
|
47
|
+
| `doing pause <id>` | Pause a task |
|
|
48
|
+
| `doing resume <id>` | Resume a paused task |
|
|
49
|
+
| `doing reopen <id>` | Reopen a completed task |
|
|
50
|
+
| `doing edit <id>` | Edit a task (`-t` title, `-n` notes, `-c` context, `--no-context`) |
|
|
51
|
+
| `doing rm <id>` | Delete a task |
|
|
52
|
+
| `doing ls` | List active tasks |
|
|
53
|
+
| `doing log` | Show tasks done today (`-d YYYY-MM-DD` for other dates) |
|
|
54
|
+
| `doing today` | Show all tasks grouped by status |
|
|
55
|
+
| `doing clear` | Mark all active tasks as done |
|
|
56
|
+
| `doing contexts` | List contexts |
|
|
57
|
+
| `doing context add <name>` | Create a context |
|
|
58
|
+
| `doing context rm <id>` | Delete a context |
|
|
59
|
+
| `doing login` | Log in |
|
|
60
|
+
| `doing logout` | Log out |
|
|
61
|
+
|
|
62
|
+
## Configuration
|
|
63
|
+
|
|
64
|
+
By default the CLI talks to `https://doingapp.co`. To point at a different server:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
export DOING_API_URL=http://localhost:8001
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## License
|
|
71
|
+
|
|
72
|
+
MIT
|
|
File without changes
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
|
|
5
|
+
from doing_cli.auth import load_token
|
|
6
|
+
|
|
7
|
+
BASE_URL = os.environ.get("DOING_API_URL", "https://doingapp.co")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _client() -> httpx.Client:
|
|
11
|
+
headers = {}
|
|
12
|
+
token = load_token()
|
|
13
|
+
if token:
|
|
14
|
+
headers["Authorization"] = f"Bearer {token}"
|
|
15
|
+
return httpx.Client(base_url=BASE_URL, timeout=10.0, headers=headers)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def register(email: str, password: str) -> dict:
|
|
19
|
+
with httpx.Client(base_url=BASE_URL, timeout=10.0) as c:
|
|
20
|
+
r = c.post("/auth/register", json={"email": email, "password": password})
|
|
21
|
+
r.raise_for_status()
|
|
22
|
+
return r.json()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def login(email: str, password: str) -> dict:
|
|
26
|
+
with httpx.Client(base_url=BASE_URL, timeout=10.0) as c:
|
|
27
|
+
r = c.post("/auth/login", json={"email": email, "password": password})
|
|
28
|
+
r.raise_for_status()
|
|
29
|
+
return r.json()
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def create_task(title: str, notes: str | None = None, context_id: int | None = None) -> dict:
|
|
33
|
+
payload: dict = {"title": title}
|
|
34
|
+
if notes is not None:
|
|
35
|
+
payload["notes"] = notes
|
|
36
|
+
if context_id is not None:
|
|
37
|
+
payload["context_id"] = context_id
|
|
38
|
+
with _client() as c:
|
|
39
|
+
r = c.post("/tasks", json=payload)
|
|
40
|
+
r.raise_for_status()
|
|
41
|
+
return r.json()
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def list_tasks(status: str | None = None, date: str | None = None) -> list[dict]:
|
|
45
|
+
params = {}
|
|
46
|
+
if status is not None:
|
|
47
|
+
params["status"] = status
|
|
48
|
+
if date is not None:
|
|
49
|
+
params["date"] = date
|
|
50
|
+
with _client() as c:
|
|
51
|
+
r = c.get("/tasks", params=params)
|
|
52
|
+
r.raise_for_status()
|
|
53
|
+
return r.json()
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def mark_done(task_id: int) -> dict:
|
|
57
|
+
with _client() as c:
|
|
58
|
+
r = c.post(f"/tasks/{task_id}/done")
|
|
59
|
+
r.raise_for_status()
|
|
60
|
+
return r.json()
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def reopen_task(task_id: int) -> dict:
|
|
64
|
+
with _client() as c:
|
|
65
|
+
r = c.post(f"/tasks/{task_id}/reopen")
|
|
66
|
+
r.raise_for_status()
|
|
67
|
+
return r.json()
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def pause_task(task_id: int) -> dict:
|
|
71
|
+
with _client() as c:
|
|
72
|
+
r = c.post(f"/tasks/{task_id}/pause")
|
|
73
|
+
r.raise_for_status()
|
|
74
|
+
return r.json()
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def resume_task(task_id: int) -> dict:
|
|
78
|
+
with _client() as c:
|
|
79
|
+
r = c.post(f"/tasks/{task_id}/resume")
|
|
80
|
+
r.raise_for_status()
|
|
81
|
+
return r.json()
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def update_task(task_id: int, title: str | None = None, notes: str | None = None,
|
|
85
|
+
context_id: int | None = None, clear_context: bool = False) -> dict:
|
|
86
|
+
payload: dict = {}
|
|
87
|
+
if title is not None:
|
|
88
|
+
payload["title"] = title
|
|
89
|
+
if notes is not None:
|
|
90
|
+
payload["notes"] = notes
|
|
91
|
+
if clear_context:
|
|
92
|
+
payload["clear_context"] = True
|
|
93
|
+
elif context_id is not None:
|
|
94
|
+
payload["context_id"] = context_id
|
|
95
|
+
with _client() as c:
|
|
96
|
+
r = c.patch(f"/tasks/{task_id}", json=payload)
|
|
97
|
+
r.raise_for_status()
|
|
98
|
+
return r.json()
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def delete_task(task_id: int) -> None:
|
|
102
|
+
with _client() as c:
|
|
103
|
+
r = c.delete(f"/tasks/{task_id}")
|
|
104
|
+
r.raise_for_status()
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def get_today() -> dict:
|
|
108
|
+
with _client() as c:
|
|
109
|
+
r = c.get("/today")
|
|
110
|
+
r.raise_for_status()
|
|
111
|
+
return r.json()
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
# --- Contexts ---
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def list_contexts() -> list[dict]:
|
|
118
|
+
with _client() as c:
|
|
119
|
+
r = c.get("/contexts")
|
|
120
|
+
r.raise_for_status()
|
|
121
|
+
return r.json()
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def create_context(name: str) -> dict:
|
|
125
|
+
with _client() as c:
|
|
126
|
+
r = c.post("/contexts", json={"name": name})
|
|
127
|
+
r.raise_for_status()
|
|
128
|
+
return r.json()
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def delete_context(context_id: int) -> None:
|
|
132
|
+
with _client() as c:
|
|
133
|
+
r = c.delete(f"/contexts/{context_id}")
|
|
134
|
+
r.raise_for_status()
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
TOKEN_DIR = Path.home() / ".config" / "doing"
|
|
4
|
+
TOKEN_FILE = TOKEN_DIR / "token"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def save_token(token: str) -> None:
|
|
8
|
+
TOKEN_DIR.mkdir(parents=True, exist_ok=True)
|
|
9
|
+
TOKEN_FILE.write_text(token)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def load_token() -> str | None:
|
|
13
|
+
if TOKEN_FILE.exists():
|
|
14
|
+
token = TOKEN_FILE.read_text().strip()
|
|
15
|
+
return token if token else None
|
|
16
|
+
return None
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def clear_token() -> None:
|
|
20
|
+
if TOKEN_FILE.exists():
|
|
21
|
+
TOKEN_FILE.unlink()
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
from rich.console import Console
|
|
3
|
+
|
|
4
|
+
from doing_cli import api
|
|
5
|
+
from doing_cli.auth import load_token, save_token, clear_token
|
|
6
|
+
|
|
7
|
+
app = typer.Typer(
|
|
8
|
+
help="Doing - track what you're working on.",
|
|
9
|
+
invoke_without_command=True,
|
|
10
|
+
)
|
|
11
|
+
context_app = typer.Typer(help="Manage contexts.")
|
|
12
|
+
app.add_typer(context_app, name="context")
|
|
13
|
+
|
|
14
|
+
console = Console()
|
|
15
|
+
|
|
16
|
+
# Commands that don't require authentication
|
|
17
|
+
AUTH_COMMANDS = {"login", "register", "logout"}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _require_auth():
|
|
21
|
+
"""Exit with a message if the user is not logged in."""
|
|
22
|
+
if load_token() is None:
|
|
23
|
+
console.print("[bold red]Not logged in.[/bold red] Run: [bold]doing login[/bold]")
|
|
24
|
+
raise typer.Exit(code=1)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _handle_connection_error():
|
|
28
|
+
console.print(
|
|
29
|
+
f"[bold red]Could not connect to the Doing API at {api.BASE_URL}[/bold red]\n"
|
|
30
|
+
"Make sure the backend is running."
|
|
31
|
+
)
|
|
32
|
+
raise typer.Exit(code=1)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _print_active_task(task: dict) -> None:
|
|
36
|
+
ctx = f" [dim][{task['context_name']}][/dim]" if task.get("context_name") else ""
|
|
37
|
+
console.print(f" [green bold]●[/green bold] [dim]#{task['id']}[/dim] {task['title']}{ctx}")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _print_paused_task(task: dict) -> None:
|
|
41
|
+
ctx = f" [dim][{task['context_name']}][/dim]" if task.get("context_name") else ""
|
|
42
|
+
console.print(f" [yellow]⏸[/yellow] [dim]#{task['id']}[/dim] {task['title']}{ctx}")
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _print_done_task(task: dict) -> None:
|
|
46
|
+
ctx = f" [{task['context_name']}]" if task.get("context_name") else ""
|
|
47
|
+
console.print(f" [green]✓[/green] [dim]#{task['id']} [strike]{task['title']}[/strike]{ctx}[/dim]")
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@app.callback()
|
|
51
|
+
def main(ctx: typer.Context):
|
|
52
|
+
"""Doing - track what you're working on."""
|
|
53
|
+
if ctx.invoked_subcommand is None:
|
|
54
|
+
_require_auth()
|
|
55
|
+
ls()
|
|
56
|
+
elif ctx.invoked_subcommand not in AUTH_COMMANDS:
|
|
57
|
+
_require_auth()
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@app.command()
|
|
61
|
+
def login():
|
|
62
|
+
"""Log in to your Doing account."""
|
|
63
|
+
email = typer.prompt("Email")
|
|
64
|
+
password = typer.prompt("Password", hide_input=True)
|
|
65
|
+
try:
|
|
66
|
+
data = api.login(email, password)
|
|
67
|
+
except Exception:
|
|
68
|
+
_handle_connection_error()
|
|
69
|
+
save_token(data["access_token"])
|
|
70
|
+
console.print(f"[bold green]Logged in[/bold green] as [bold]{email}[/bold]")
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@app.command()
|
|
74
|
+
def register():
|
|
75
|
+
"""Create a new Doing account."""
|
|
76
|
+
email = typer.prompt("Email")
|
|
77
|
+
password = typer.prompt("Password", hide_input=True)
|
|
78
|
+
password_confirm = typer.prompt("Confirm password", hide_input=True)
|
|
79
|
+
if password != password_confirm:
|
|
80
|
+
console.print("[bold red]Passwords do not match.[/bold red]")
|
|
81
|
+
raise typer.Exit(code=1)
|
|
82
|
+
try:
|
|
83
|
+
data = api.register(email, password)
|
|
84
|
+
except Exception:
|
|
85
|
+
_handle_connection_error()
|
|
86
|
+
save_token(data["access_token"])
|
|
87
|
+
console.print(f"[bold green]Account created![/bold green] Logged in as [bold]{email}[/bold]")
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@app.command()
|
|
91
|
+
def logout():
|
|
92
|
+
"""Log out and clear stored credentials."""
|
|
93
|
+
clear_token()
|
|
94
|
+
console.print("[dim]Logged out.[/dim]")
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
@app.command()
|
|
98
|
+
def add(
|
|
99
|
+
title: str = typer.Argument(..., help="What are you working on?"),
|
|
100
|
+
notes: str = typer.Option(None, "--notes", "-n", help="Optional notes"),
|
|
101
|
+
context: int = typer.Option(None, "--context", "-c", help="Context ID"),
|
|
102
|
+
):
|
|
103
|
+
"""Add something to your plate."""
|
|
104
|
+
try:
|
|
105
|
+
task = api.create_task(title, notes, context)
|
|
106
|
+
except Exception:
|
|
107
|
+
_handle_connection_error()
|
|
108
|
+
console.print(f"[green bold]●[/green bold] Added: [bold]{task['title']}[/bold] [dim](#{task['id']})[/dim]")
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
@app.command()
|
|
112
|
+
def ls():
|
|
113
|
+
"""Show what's on your plate right now."""
|
|
114
|
+
try:
|
|
115
|
+
tasks = api.list_tasks(status="active")
|
|
116
|
+
except Exception:
|
|
117
|
+
_handle_connection_error()
|
|
118
|
+
if not tasks:
|
|
119
|
+
console.print("Nothing on your plate. Add something: [bold]doing add 'task name'[/bold]")
|
|
120
|
+
raise typer.Exit()
|
|
121
|
+
for t in tasks:
|
|
122
|
+
_print_active_task(t)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
@app.command()
|
|
126
|
+
def log(
|
|
127
|
+
date: str = typer.Option(None, "--date", "-d", help="Date (YYYY-MM-DD), defaults to today"),
|
|
128
|
+
):
|
|
129
|
+
"""List tasks marked done today (or on a given date)."""
|
|
130
|
+
from datetime import date as date_cls
|
|
131
|
+
query_date = date if date else date_cls.today().isoformat()
|
|
132
|
+
try:
|
|
133
|
+
tasks = api.list_tasks(status="done", date=query_date)
|
|
134
|
+
except Exception:
|
|
135
|
+
_handle_connection_error()
|
|
136
|
+
if not tasks:
|
|
137
|
+
label = query_date if date else "today"
|
|
138
|
+
console.print(f"Nothing marked done {label}.")
|
|
139
|
+
raise typer.Exit()
|
|
140
|
+
for t in tasks:
|
|
141
|
+
_print_done_task(t)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
@app.command()
|
|
145
|
+
def done(
|
|
146
|
+
task_id: int = typer.Argument(..., help="ID of the task to mark done"),
|
|
147
|
+
):
|
|
148
|
+
"""Mark a task as done."""
|
|
149
|
+
try:
|
|
150
|
+
task = api.mark_done(task_id)
|
|
151
|
+
except Exception:
|
|
152
|
+
_handle_connection_error()
|
|
153
|
+
console.print(f"[green]✓[/green] Done: [bold]{task['title']}[/bold]")
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
@app.command()
|
|
157
|
+
def reopen(
|
|
158
|
+
task_id: int = typer.Argument(..., help="ID of the task to reopen"),
|
|
159
|
+
):
|
|
160
|
+
"""Reopen a completed task."""
|
|
161
|
+
try:
|
|
162
|
+
task = api.reopen_task(task_id)
|
|
163
|
+
except Exception:
|
|
164
|
+
_handle_connection_error()
|
|
165
|
+
console.print(f"[green bold]●[/green bold] Reopened: [bold]{task['title']}[/bold]")
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
@app.command()
|
|
169
|
+
def pause(
|
|
170
|
+
task_id: int = typer.Argument(..., help="ID of the task to pause"),
|
|
171
|
+
):
|
|
172
|
+
"""Pause an active task."""
|
|
173
|
+
try:
|
|
174
|
+
task = api.pause_task(task_id)
|
|
175
|
+
except Exception:
|
|
176
|
+
_handle_connection_error()
|
|
177
|
+
console.print(f"[yellow]⏸[/yellow] Paused: [bold]{task['title']}[/bold]")
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
@app.command()
|
|
181
|
+
def resume(
|
|
182
|
+
task_id: int = typer.Argument(..., help="ID of the task to resume"),
|
|
183
|
+
):
|
|
184
|
+
"""Resume a paused task."""
|
|
185
|
+
try:
|
|
186
|
+
task = api.resume_task(task_id)
|
|
187
|
+
except Exception:
|
|
188
|
+
_handle_connection_error()
|
|
189
|
+
console.print(f"[green bold]●[/green bold] Resumed: [bold]{task['title']}[/bold]")
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
@app.command()
|
|
193
|
+
def edit(
|
|
194
|
+
task_id: int = typer.Argument(..., help="ID of the task to edit"),
|
|
195
|
+
title: str = typer.Option(None, "--title", "-t", help="New title"),
|
|
196
|
+
notes: str = typer.Option(None, "--notes", "-n", help="New notes"),
|
|
197
|
+
context: int = typer.Option(None, "--context", "-c", help="Move to context ID"),
|
|
198
|
+
no_context: bool = typer.Option(False, "--no-context", help="Remove context"),
|
|
199
|
+
):
|
|
200
|
+
"""Edit a task's title, notes, or context."""
|
|
201
|
+
try:
|
|
202
|
+
task = api.update_task(task_id, title=title, notes=notes,
|
|
203
|
+
context_id=context, clear_context=no_context)
|
|
204
|
+
except Exception:
|
|
205
|
+
_handle_connection_error()
|
|
206
|
+
console.print(f"[green bold]Updated:[/green bold] {task['title']} [dim](#{task['id']})[/dim]")
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
@app.command()
|
|
210
|
+
def today():
|
|
211
|
+
"""Show everything from today, grouped by status."""
|
|
212
|
+
try:
|
|
213
|
+
data = api.get_today()
|
|
214
|
+
except Exception:
|
|
215
|
+
_handle_connection_error()
|
|
216
|
+
|
|
217
|
+
active = data.get("active", [])
|
|
218
|
+
paused = data.get("paused", [])
|
|
219
|
+
done_tasks = data.get("done", [])
|
|
220
|
+
|
|
221
|
+
if not active and not paused and not done_tasks:
|
|
222
|
+
console.print("Nothing on your plate today. Add something: [bold]doing add 'task name'[/bold]")
|
|
223
|
+
raise typer.Exit()
|
|
224
|
+
|
|
225
|
+
if active:
|
|
226
|
+
console.print("\n[bold]Active[/bold]")
|
|
227
|
+
for t in active:
|
|
228
|
+
_print_active_task(t)
|
|
229
|
+
|
|
230
|
+
if paused:
|
|
231
|
+
console.print("\n[bold yellow]Paused[/bold yellow]")
|
|
232
|
+
for t in paused:
|
|
233
|
+
_print_paused_task(t)
|
|
234
|
+
|
|
235
|
+
if done_tasks:
|
|
236
|
+
console.print("\n[bold]Done[/bold]")
|
|
237
|
+
for t in done_tasks:
|
|
238
|
+
_print_done_task(t)
|
|
239
|
+
|
|
240
|
+
console.print()
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
@app.command()
|
|
244
|
+
def rm(
|
|
245
|
+
task_id: int = typer.Argument(..., help="ID of the task to delete"),
|
|
246
|
+
):
|
|
247
|
+
"""Delete a task."""
|
|
248
|
+
try:
|
|
249
|
+
api.delete_task(task_id)
|
|
250
|
+
except Exception:
|
|
251
|
+
_handle_connection_error()
|
|
252
|
+
console.print(f"[dim]Deleted task #{task_id}.[/dim]")
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
@app.command()
|
|
256
|
+
def clear():
|
|
257
|
+
"""Mark ALL active tasks as done."""
|
|
258
|
+
try:
|
|
259
|
+
tasks = api.list_tasks(status="active")
|
|
260
|
+
except Exception:
|
|
261
|
+
_handle_connection_error()
|
|
262
|
+
|
|
263
|
+
if not tasks:
|
|
264
|
+
console.print("Nothing to clear.")
|
|
265
|
+
raise typer.Exit()
|
|
266
|
+
|
|
267
|
+
for t in tasks:
|
|
268
|
+
try:
|
|
269
|
+
api.mark_done(t["id"])
|
|
270
|
+
except Exception:
|
|
271
|
+
console.print(f"[red]Failed to complete task #{t['id']}[/red]")
|
|
272
|
+
continue
|
|
273
|
+
console.print(f"[green]✓[/green] Done: [bold]{t['title']}[/bold]")
|
|
274
|
+
|
|
275
|
+
console.print(f"\n[dim]Cleared {len(tasks)} task(s).[/dim]")
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
@app.command()
|
|
279
|
+
def contexts():
|
|
280
|
+
"""List all contexts."""
|
|
281
|
+
try:
|
|
282
|
+
ctx_list = api.list_contexts()
|
|
283
|
+
except Exception:
|
|
284
|
+
_handle_connection_error()
|
|
285
|
+
if not ctx_list:
|
|
286
|
+
console.print("No contexts. Create one: [bold]doing context add 'name'[/bold]")
|
|
287
|
+
raise typer.Exit()
|
|
288
|
+
for c in ctx_list:
|
|
289
|
+
console.print(f" [dim]#{c['id']}[/dim] {c['name']}")
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
@context_app.command("add")
|
|
293
|
+
def context_add(
|
|
294
|
+
name: str = typer.Argument(..., help="Context name"),
|
|
295
|
+
):
|
|
296
|
+
"""Create a new context."""
|
|
297
|
+
_require_auth()
|
|
298
|
+
try:
|
|
299
|
+
ctx = api.create_context(name)
|
|
300
|
+
except Exception:
|
|
301
|
+
_handle_connection_error()
|
|
302
|
+
console.print(f"[green bold]Created context:[/green bold] {ctx['name']} [dim](#{ctx['id']})[/dim]")
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
@context_app.command("rm")
|
|
306
|
+
def context_rm(
|
|
307
|
+
context_id: int = typer.Argument(..., help="Context ID to delete"),
|
|
308
|
+
):
|
|
309
|
+
"""Delete a context (tasks keep their data, just lose the context)."""
|
|
310
|
+
_require_auth()
|
|
311
|
+
try:
|
|
312
|
+
api.delete_context(context_id)
|
|
313
|
+
except Exception:
|
|
314
|
+
_handle_connection_error()
|
|
315
|
+
console.print(f"[dim]Deleted context #{context_id}.[/dim]")
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
if __name__ == "__main__":
|
|
319
|
+
app()
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: doingapp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A fast CLI task tracker — track what you're doing from the terminal.
|
|
5
|
+
Author-email: Parker Grimes <parker@altellus.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://doingapp.co
|
|
8
|
+
Project-URL: Repository, https://github.com/altellusllc/doing-cli
|
|
9
|
+
Keywords: cli,tasks,productivity,todo
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Office/Business :: Scheduling
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: typer>=0.9
|
|
22
|
+
Requires-Dist: httpx>=0.25
|
|
23
|
+
Requires-Dist: rich>=13.0
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# doingapp
|
|
27
|
+
|
|
28
|
+
A fast CLI task tracker — track what you're doing from the terminal.
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
$ doing add "Write CLI docs"
|
|
32
|
+
● Added: Write CLI docs (#42)
|
|
33
|
+
|
|
34
|
+
$ doing
|
|
35
|
+
● #42 Write CLI docs
|
|
36
|
+
● #41 Review PR
|
|
37
|
+
|
|
38
|
+
$ doing done 42
|
|
39
|
+
✓ Done: Write CLI docs
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pipx install doingapp
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Or with pip:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install doingapp
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Requires Python 3.11+.
|
|
55
|
+
|
|
56
|
+
## Getting started
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
doing login # Log in with your Doing account
|
|
60
|
+
doing add "My task" # Add a task
|
|
61
|
+
doing # See what's on your plate
|
|
62
|
+
doing done 1 # Mark task #1 as done
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Commands
|
|
66
|
+
|
|
67
|
+
| Command | Description |
|
|
68
|
+
|---------|-------------|
|
|
69
|
+
| `doing` | Show active tasks (same as `doing ls`) |
|
|
70
|
+
| `doing add <title>` | Add a task (`-n` notes, `-c` context ID) |
|
|
71
|
+
| `doing done <id>` | Mark a task as done |
|
|
72
|
+
| `doing pause <id>` | Pause a task |
|
|
73
|
+
| `doing resume <id>` | Resume a paused task |
|
|
74
|
+
| `doing reopen <id>` | Reopen a completed task |
|
|
75
|
+
| `doing edit <id>` | Edit a task (`-t` title, `-n` notes, `-c` context, `--no-context`) |
|
|
76
|
+
| `doing rm <id>` | Delete a task |
|
|
77
|
+
| `doing ls` | List active tasks |
|
|
78
|
+
| `doing log` | Show tasks done today (`-d YYYY-MM-DD` for other dates) |
|
|
79
|
+
| `doing today` | Show all tasks grouped by status |
|
|
80
|
+
| `doing clear` | Mark all active tasks as done |
|
|
81
|
+
| `doing contexts` | List contexts |
|
|
82
|
+
| `doing context add <name>` | Create a context |
|
|
83
|
+
| `doing context rm <id>` | Delete a context |
|
|
84
|
+
| `doing login` | Log in |
|
|
85
|
+
| `doing logout` | Log out |
|
|
86
|
+
|
|
87
|
+
## Configuration
|
|
88
|
+
|
|
89
|
+
By default the CLI talks to `https://doingapp.co`. To point at a different server:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
export DOING_API_URL=http://localhost:8001
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
MIT
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
doing_cli/__init__.py
|
|
5
|
+
doing_cli/api.py
|
|
6
|
+
doing_cli/auth.py
|
|
7
|
+
doing_cli/main.py
|
|
8
|
+
doingapp.egg-info/PKG-INFO
|
|
9
|
+
doingapp.egg-info/SOURCES.txt
|
|
10
|
+
doingapp.egg-info/dependency_links.txt
|
|
11
|
+
doingapp.egg-info/entry_points.txt
|
|
12
|
+
doingapp.egg-info/requires.txt
|
|
13
|
+
doingapp.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
doing_cli
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "doingapp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A fast CLI task tracker — track what you're doing from the terminal."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Parker Grimes", email = "parker@altellus.com" },
|
|
14
|
+
]
|
|
15
|
+
keywords = ["cli", "tasks", "productivity", "todo"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Topic :: Office/Business :: Scheduling",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"typer>=0.9",
|
|
28
|
+
"httpx>=0.25",
|
|
29
|
+
"rich>=13.0",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Homepage = "https://doingapp.co"
|
|
34
|
+
Repository = "https://github.com/altellusllc/doing-cli"
|
|
35
|
+
|
|
36
|
+
[project.scripts]
|
|
37
|
+
doing = "doing_cli.main:app"
|
doingapp-0.1.0/setup.cfg
ADDED