icloud-cli-tools 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.
Files changed (31) hide show
  1. icloud_cli_tools-0.1.0/.github/workflows/ci.yml +33 -0
  2. icloud_cli_tools-0.1.0/.gitignore +34 -0
  3. icloud_cli_tools-0.1.0/LICENSE +21 -0
  4. icloud_cli_tools-0.1.0/PKG-INFO +212 -0
  5. icloud_cli_tools-0.1.0/README.md +176 -0
  6. icloud_cli_tools-0.1.0/pyproject.toml +68 -0
  7. icloud_cli_tools-0.1.0/setup.cfg +4 -0
  8. icloud_cli_tools-0.1.0/src/icloud_cli/__init__.py +3 -0
  9. icloud_cli_tools-0.1.0/src/icloud_cli/auth.py +273 -0
  10. icloud_cli_tools-0.1.0/src/icloud_cli/config.py +122 -0
  11. icloud_cli_tools-0.1.0/src/icloud_cli/daemon.py +198 -0
  12. icloud_cli_tools-0.1.0/src/icloud_cli/main.py +468 -0
  13. icloud_cli_tools-0.1.0/src/icloud_cli/output.py +146 -0
  14. icloud_cli_tools-0.1.0/src/icloud_cli/services/__init__.py +1 -0
  15. icloud_cli_tools-0.1.0/src/icloud_cli/services/calendar.py +217 -0
  16. icloud_cli_tools-0.1.0/src/icloud_cli/services/findmy.py +171 -0
  17. icloud_cli_tools-0.1.0/src/icloud_cli/services/notes.py +288 -0
  18. icloud_cli_tools-0.1.0/src/icloud_cli/services/reminders.py +218 -0
  19. icloud_cli_tools-0.1.0/src/icloud_cli_tools.egg-info/PKG-INFO +212 -0
  20. icloud_cli_tools-0.1.0/src/icloud_cli_tools.egg-info/SOURCES.txt +29 -0
  21. icloud_cli_tools-0.1.0/src/icloud_cli_tools.egg-info/dependency_links.txt +1 -0
  22. icloud_cli_tools-0.1.0/src/icloud_cli_tools.egg-info/entry_points.txt +2 -0
  23. icloud_cli_tools-0.1.0/src/icloud_cli_tools.egg-info/requires.txt +12 -0
  24. icloud_cli_tools-0.1.0/src/icloud_cli_tools.egg-info/top_level.txt +1 -0
  25. icloud_cli_tools-0.1.0/systemd/icloud-cli-sync.service +20 -0
  26. icloud_cli_tools-0.1.0/tests/conftest.py +57 -0
  27. icloud_cli_tools-0.1.0/tests/test_auth.py +97 -0
  28. icloud_cli_tools-0.1.0/tests/test_calendar.py +104 -0
  29. icloud_cli_tools-0.1.0/tests/test_findmy.py +87 -0
  30. icloud_cli_tools-0.1.0/tests/test_notes.py +76 -0
  31. icloud_cli_tools-0.1.0/tests/test_reminders.py +92 -0
@@ -0,0 +1,33 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ lint-and-test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install -e ".[dev]"
28
+
29
+ - name: Lint with ruff
30
+ run: ruff check src/ tests/
31
+
32
+ - name: Run tests
33
+ run: pytest tests/ -v --tb=short
@@ -0,0 +1,34 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ dist/
7
+ build/
8
+ *.egg
9
+ .eggs/
10
+
11
+ # Virtual environments
12
+ .venv/
13
+ venv/
14
+ env/
15
+
16
+ # IDE
17
+ .idea/
18
+ .vscode/
19
+ *.swp
20
+ *.swo
21
+ *~
22
+
23
+ # OS
24
+ .DS_Store
25
+ Thumbs.db
26
+
27
+ # Testing
28
+ .pytest_cache/
29
+ .coverage
30
+ htmlcov/
31
+ .ruff_cache/
32
+
33
+ # icloud-cli session data
34
+ session/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alan Beltran Pozo
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,212 @@
1
+ Metadata-Version: 2.4
2
+ Name: icloud-cli-tools
3
+ Version: 0.1.0
4
+ Summary: Access iCloud Calendar, Reminders, Notes, and Find My from Linux
5
+ Author: alan
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/alan13367/icloud-cli-tools
8
+ Project-URL: Repository, https://github.com/alan13367/icloud-cli-tools
9
+ Project-URL: Issues, https://github.com/alan13367/icloud-cli-tools/issues
10
+ Keywords: icloud,apple,calendar,reminders,notes,findmy,cli,linux
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: End Users/Desktop
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Utilities
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: pyicloud>=1.0.0
25
+ Requires-Dist: click>=8.1
26
+ Requires-Dist: rich>=13.0
27
+ Requires-Dist: keyring>=25.0
28
+ Requires-Dist: toml>=0.10
29
+ Requires-Dist: python-dateutil>=2.8
30
+ Requires-Dist: html2text>=2024.2
31
+ Provides-Extra: dev
32
+ Requires-Dist: pytest>=8.0; extra == "dev"
33
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
34
+ Requires-Dist: ruff>=0.5; extra == "dev"
35
+ Dynamic: license-file
36
+
37
+ # ☁️ icloud-cli-tools
38
+
39
+ > Access your iCloud **Calendar**, **Reminders**, **Notes**, and **Find My** devices from the Linux terminal.
40
+
41
+ [![CI](https://github.com/alan/icloud-cli-tools/actions/workflows/ci.yml/badge.svg)](https://github.com/alan/icloud-cli-tools/actions)
42
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
43
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-green.svg)](https://python.org)
44
+
45
+ ## Features
46
+
47
+ - 📅 **Calendar** — List, create, and delete events with natural date parsing
48
+ - ✅ **Reminders** — Manage reminders across lists, mark complete, set priorities
49
+ - 📝 **Notes** — Read, create, and search your iCloud Notes
50
+ - 📍 **Find My** — Locate devices, play sounds, activate Lost Mode
51
+ - 🔄 **Background Sync** — Daemon with systemd integration for periodic caching
52
+ - 🔐 **Secure Auth** — 2FA support, OS keyring for credentials, session caching
53
+ - 🎨 **Beautiful Output** — Rich tables, JSON, and plain text formats
54
+
55
+ ## Installation
56
+
57
+ ```bash
58
+ # Clone the repo
59
+ git clone https://github.com/alan13367/icloud-cli-tools.git
60
+ cd icloud-cli-tools
61
+
62
+ # Set up a virtual environment (recommended, required on modern Debian/Ubuntu)
63
+ python3 -m venv .venv
64
+ source .venv/bin/activate
65
+ pip install -e .
66
+ ```
67
+
68
+ > **Tip:** To use `icloud-cli` without activating the venv every time, add an alias:
69
+ > ```bash
70
+ > echo 'alias icloud-cli="~/icloud-cli-tools/.venv/bin/icloud-cli"' >> ~/.bashrc
71
+ > source ~/.bashrc
72
+ > ```
73
+
74
+ ## Quick Start
75
+
76
+ ```bash
77
+ # 1. Login to your iCloud account
78
+ icloud-cli login
79
+
80
+ # 2. Set up Notes access (requires app-specific password)
81
+ icloud-cli notes setup-imap
82
+
83
+ # 3. Start using it!
84
+ icloud-cli calendar list
85
+ icloud-cli reminders list
86
+ icloud-cli notes list
87
+ icloud-cli findmy list
88
+ ```
89
+
90
+ ## Usage
91
+
92
+ ### Authentication
93
+
94
+ ```bash
95
+ icloud-cli login # Interactive login with 2FA
96
+ icloud-cli logout # Clear all stored credentials
97
+ icloud-cli status # Check auth status
98
+ ```
99
+
100
+ ### Calendar
101
+
102
+ ```bash
103
+ icloud-cli calendar list # Events for next 7 days
104
+ icloud-cli calendar list --from today --to tomorrow
105
+ icloud-cli calendar show <event-id>
106
+ icloud-cli calendar add -t "Meeting" -s "2025-06-15 10:00" -e "2025-06-15 11:00"
107
+ icloud-cli calendar delete <event-id>
108
+ ```
109
+
110
+ ### Reminders
111
+
112
+ ```bash
113
+ icloud-cli reminders list # All active reminders
114
+ icloud-cli reminders list --list "Shopping" --completed
115
+ icloud-cli reminders add -t "Buy milk" -d "2025-06-15" -l "Shopping"
116
+ icloud-cli reminders complete <reminder-id>
117
+ icloud-cli reminders delete <reminder-id>
118
+ ```
119
+
120
+ ### Notes
121
+
122
+ ```bash
123
+ icloud-cli notes list
124
+ icloud-cli notes show <note-id>
125
+ icloud-cli notes add -t "My Note" -b "Note content here"
126
+ icloud-cli notes search "keyword"
127
+ ```
128
+
129
+ > **Note:** Notes access requires an app-specific password. Generate one at
130
+ > [appleid.apple.com](https://appleid.apple.com/account/manage) →
131
+ > *Sign In & Security* → *App-Specific Passwords*.
132
+
133
+ ### Find My
134
+
135
+ ```bash
136
+ icloud-cli findmy list # All devices with status
137
+ icloud-cli findmy locate "iPhone" # GPS coordinates + Maps link
138
+ icloud-cli findmy play-sound "iPhone" # Ring your device
139
+ icloud-cli findmy lost-mode "iPhone" -p "+1234567890" -m "Please return"
140
+ ```
141
+
142
+ ### Sync & Daemon
143
+
144
+ ```bash
145
+ icloud-cli sync # One-shot sync to local cache
146
+ icloud-cli daemon start # Start background sync (every 15 min)
147
+ icloud-cli daemon stop # Stop daemon
148
+ icloud-cli daemon status # Check daemon status
149
+ ```
150
+
151
+ #### Systemd Integration (Linux)
152
+
153
+ ```bash
154
+ # Install the service
155
+ cp systemd/icloud-cli-sync.service ~/.config/systemd/user/
156
+ systemctl --user enable icloud-cli-sync
157
+ systemctl --user start icloud-cli-sync
158
+ ```
159
+
160
+ ### Output Formats
161
+
162
+ ```bash
163
+ icloud-cli calendar list -f table # Rich formatted table (default)
164
+ icloud-cli calendar list -f json # Machine-readable JSON
165
+ icloud-cli calendar list -f plain # Tab-separated for scripting
166
+ ```
167
+
168
+ ## Configuration
169
+
170
+ Config file: `~/.config/icloud-cli/config.toml`
171
+
172
+ ```toml
173
+ [general]
174
+ default_format = "table"
175
+ verbose = false
176
+
177
+ [auth]
178
+ apple_id = "your@icloud.com"
179
+
180
+ [sync]
181
+ sync_interval_minutes = 15
182
+
183
+ [calendar]
184
+ default_calendar = "Personal"
185
+
186
+ [reminders]
187
+ default_reminder_list = "Reminders"
188
+ ```
189
+
190
+ ## Development
191
+
192
+ ```bash
193
+ # Install with dev dependencies
194
+ pip install -e ".[dev]"
195
+
196
+ # Run tests
197
+ pytest tests/ -v
198
+
199
+ # Lint
200
+ ruff check src/ tests/
201
+ ```
202
+
203
+ ## ⚠️ Disclaimer
204
+
205
+ This project uses **unofficial/private iCloud web APIs** via the
206
+ [pyicloud](https://github.com/picklepete/pyicloud) library. Apple may change
207
+ these APIs at any time without notice, which could break functionality. This
208
+ tool is not affiliated with or endorsed by Apple Inc.
209
+
210
+ ## License
211
+
212
+ [MIT](LICENSE)
@@ -0,0 +1,176 @@
1
+ # ☁️ icloud-cli-tools
2
+
3
+ > Access your iCloud **Calendar**, **Reminders**, **Notes**, and **Find My** devices from the Linux terminal.
4
+
5
+ [![CI](https://github.com/alan/icloud-cli-tools/actions/workflows/ci.yml/badge.svg)](https://github.com/alan/icloud-cli-tools/actions)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-green.svg)](https://python.org)
8
+
9
+ ## Features
10
+
11
+ - 📅 **Calendar** — List, create, and delete events with natural date parsing
12
+ - ✅ **Reminders** — Manage reminders across lists, mark complete, set priorities
13
+ - 📝 **Notes** — Read, create, and search your iCloud Notes
14
+ - 📍 **Find My** — Locate devices, play sounds, activate Lost Mode
15
+ - 🔄 **Background Sync** — Daemon with systemd integration for periodic caching
16
+ - 🔐 **Secure Auth** — 2FA support, OS keyring for credentials, session caching
17
+ - 🎨 **Beautiful Output** — Rich tables, JSON, and plain text formats
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ # Clone the repo
23
+ git clone https://github.com/alan13367/icloud-cli-tools.git
24
+ cd icloud-cli-tools
25
+
26
+ # Set up a virtual environment (recommended, required on modern Debian/Ubuntu)
27
+ python3 -m venv .venv
28
+ source .venv/bin/activate
29
+ pip install -e .
30
+ ```
31
+
32
+ > **Tip:** To use `icloud-cli` without activating the venv every time, add an alias:
33
+ > ```bash
34
+ > echo 'alias icloud-cli="~/icloud-cli-tools/.venv/bin/icloud-cli"' >> ~/.bashrc
35
+ > source ~/.bashrc
36
+ > ```
37
+
38
+ ## Quick Start
39
+
40
+ ```bash
41
+ # 1. Login to your iCloud account
42
+ icloud-cli login
43
+
44
+ # 2. Set up Notes access (requires app-specific password)
45
+ icloud-cli notes setup-imap
46
+
47
+ # 3. Start using it!
48
+ icloud-cli calendar list
49
+ icloud-cli reminders list
50
+ icloud-cli notes list
51
+ icloud-cli findmy list
52
+ ```
53
+
54
+ ## Usage
55
+
56
+ ### Authentication
57
+
58
+ ```bash
59
+ icloud-cli login # Interactive login with 2FA
60
+ icloud-cli logout # Clear all stored credentials
61
+ icloud-cli status # Check auth status
62
+ ```
63
+
64
+ ### Calendar
65
+
66
+ ```bash
67
+ icloud-cli calendar list # Events for next 7 days
68
+ icloud-cli calendar list --from today --to tomorrow
69
+ icloud-cli calendar show <event-id>
70
+ icloud-cli calendar add -t "Meeting" -s "2025-06-15 10:00" -e "2025-06-15 11:00"
71
+ icloud-cli calendar delete <event-id>
72
+ ```
73
+
74
+ ### Reminders
75
+
76
+ ```bash
77
+ icloud-cli reminders list # All active reminders
78
+ icloud-cli reminders list --list "Shopping" --completed
79
+ icloud-cli reminders add -t "Buy milk" -d "2025-06-15" -l "Shopping"
80
+ icloud-cli reminders complete <reminder-id>
81
+ icloud-cli reminders delete <reminder-id>
82
+ ```
83
+
84
+ ### Notes
85
+
86
+ ```bash
87
+ icloud-cli notes list
88
+ icloud-cli notes show <note-id>
89
+ icloud-cli notes add -t "My Note" -b "Note content here"
90
+ icloud-cli notes search "keyword"
91
+ ```
92
+
93
+ > **Note:** Notes access requires an app-specific password. Generate one at
94
+ > [appleid.apple.com](https://appleid.apple.com/account/manage) →
95
+ > *Sign In & Security* → *App-Specific Passwords*.
96
+
97
+ ### Find My
98
+
99
+ ```bash
100
+ icloud-cli findmy list # All devices with status
101
+ icloud-cli findmy locate "iPhone" # GPS coordinates + Maps link
102
+ icloud-cli findmy play-sound "iPhone" # Ring your device
103
+ icloud-cli findmy lost-mode "iPhone" -p "+1234567890" -m "Please return"
104
+ ```
105
+
106
+ ### Sync & Daemon
107
+
108
+ ```bash
109
+ icloud-cli sync # One-shot sync to local cache
110
+ icloud-cli daemon start # Start background sync (every 15 min)
111
+ icloud-cli daemon stop # Stop daemon
112
+ icloud-cli daemon status # Check daemon status
113
+ ```
114
+
115
+ #### Systemd Integration (Linux)
116
+
117
+ ```bash
118
+ # Install the service
119
+ cp systemd/icloud-cli-sync.service ~/.config/systemd/user/
120
+ systemctl --user enable icloud-cli-sync
121
+ systemctl --user start icloud-cli-sync
122
+ ```
123
+
124
+ ### Output Formats
125
+
126
+ ```bash
127
+ icloud-cli calendar list -f table # Rich formatted table (default)
128
+ icloud-cli calendar list -f json # Machine-readable JSON
129
+ icloud-cli calendar list -f plain # Tab-separated for scripting
130
+ ```
131
+
132
+ ## Configuration
133
+
134
+ Config file: `~/.config/icloud-cli/config.toml`
135
+
136
+ ```toml
137
+ [general]
138
+ default_format = "table"
139
+ verbose = false
140
+
141
+ [auth]
142
+ apple_id = "your@icloud.com"
143
+
144
+ [sync]
145
+ sync_interval_minutes = 15
146
+
147
+ [calendar]
148
+ default_calendar = "Personal"
149
+
150
+ [reminders]
151
+ default_reminder_list = "Reminders"
152
+ ```
153
+
154
+ ## Development
155
+
156
+ ```bash
157
+ # Install with dev dependencies
158
+ pip install -e ".[dev]"
159
+
160
+ # Run tests
161
+ pytest tests/ -v
162
+
163
+ # Lint
164
+ ruff check src/ tests/
165
+ ```
166
+
167
+ ## ⚠️ Disclaimer
168
+
169
+ This project uses **unofficial/private iCloud web APIs** via the
170
+ [pyicloud](https://github.com/picklepete/pyicloud) library. Apple may change
171
+ these APIs at any time without notice, which could break functionality. This
172
+ tool is not affiliated with or endorsed by Apple Inc.
173
+
174
+ ## License
175
+
176
+ [MIT](LICENSE)
@@ -0,0 +1,68 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "setuptools-scm>=8.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "icloud-cli-tools"
7
+ version = "0.1.0"
8
+ description = "Access iCloud Calendar, Reminders, Notes, and Find My from Linux"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.9"
12
+ authors = [{ name = "alan" }]
13
+ keywords = [
14
+ "icloud",
15
+ "apple",
16
+ "calendar",
17
+ "reminders",
18
+ "notes",
19
+ "findmy",
20
+ "cli",
21
+ "linux",
22
+ ]
23
+ classifiers = [
24
+ "Development Status :: 3 - Alpha",
25
+ "Environment :: Console",
26
+ "Intended Audience :: End Users/Desktop",
27
+ "Operating System :: POSIX :: Linux",
28
+ "Programming Language :: Python :: 3",
29
+ "Programming Language :: Python :: 3.10",
30
+ "Programming Language :: Python :: 3.11",
31
+ "Programming Language :: Python :: 3.12",
32
+ "Programming Language :: Python :: 3.13",
33
+ "Topic :: Utilities",
34
+ ]
35
+ dependencies = [
36
+ "pyicloud>=1.0.0",
37
+ "click>=8.1",
38
+ "rich>=13.0",
39
+ "keyring>=25.0",
40
+ "toml>=0.10",
41
+ "python-dateutil>=2.8",
42
+ "html2text>=2024.2",
43
+ ]
44
+
45
+ [project.optional-dependencies]
46
+ dev = ["pytest>=8.0", "pytest-cov>=5.0", "ruff>=0.5"]
47
+
48
+ [project.scripts]
49
+ icloud-cli = "icloud_cli.main:cli"
50
+
51
+ [project.urls]
52
+ Homepage = "https://github.com/alan13367/icloud-cli-tools"
53
+ Repository = "https://github.com/alan13367/icloud-cli-tools"
54
+ Issues = "https://github.com/alan13367/icloud-cli-tools/issues"
55
+
56
+ [tool.setuptools.packages.find]
57
+ where = ["src"]
58
+
59
+ [tool.ruff]
60
+ target-version = "py310"
61
+ line-length = 100
62
+
63
+ [tool.ruff.lint]
64
+ select = ["E", "F", "W", "I", "N", "UP", "B", "SIM"]
65
+
66
+ [tool.pytest.ini_options]
67
+ testpaths = ["tests"]
68
+ pythonpath = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """icloud-cli-tools: Access iCloud services from Linux."""
2
+
3
+ __version__ = "0.1.0"