macbot-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.
- macbot_cli-0.1.0/.gitignore +30 -0
- macbot_cli-0.1.0/LICENSE +21 -0
- macbot_cli-0.1.0/PKG-INFO +210 -0
- macbot_cli-0.1.0/README.md +176 -0
- macbot_cli-0.1.0/SKILL.md +169 -0
- macbot_cli-0.1.0/pyproject.toml +67 -0
- macbot_cli-0.1.0/src/macbot/__init__.py +3 -0
- macbot_cli-0.1.0/src/macbot/cli.py +48 -0
- macbot_cli-0.1.0/src/macbot/commands/__init__.py +1 -0
- macbot_cli-0.1.0/src/macbot/commands/apps.py +187 -0
- macbot_cli-0.1.0/src/macbot/commands/audio.py +252 -0
- macbot_cli-0.1.0/src/macbot/commands/bluetooth.py +261 -0
- macbot_cli-0.1.0/src/macbot/commands/brightness.py +104 -0
- macbot_cli-0.1.0/src/macbot/commands/clipboard.py +75 -0
- macbot_cli-0.1.0/src/macbot/commands/notify.py +50 -0
- macbot_cli-0.1.0/src/macbot/commands/say.py +94 -0
- macbot_cli-0.1.0/src/macbot/commands/screenshot.py +109 -0
- macbot_cli-0.1.0/src/macbot/commands/wifi.py +222 -0
- macbot_cli-0.1.0/src/macbot/commands/window.py +234 -0
- macbot_cli-0.1.0/src/macbot/context.py +47 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*$py.class
|
|
4
|
+
*.so
|
|
5
|
+
.Python
|
|
6
|
+
build/
|
|
7
|
+
develop-eggs/
|
|
8
|
+
dist/
|
|
9
|
+
downloads/
|
|
10
|
+
eggs/
|
|
11
|
+
.eggs/
|
|
12
|
+
lib/
|
|
13
|
+
lib64/
|
|
14
|
+
parts/
|
|
15
|
+
sdist/
|
|
16
|
+
var/
|
|
17
|
+
wheels/
|
|
18
|
+
*.egg-info/
|
|
19
|
+
.installed.cfg
|
|
20
|
+
*.egg
|
|
21
|
+
.env
|
|
22
|
+
.venv
|
|
23
|
+
env/
|
|
24
|
+
venv/
|
|
25
|
+
.pytest_cache/
|
|
26
|
+
.coverage
|
|
27
|
+
htmlcov/
|
|
28
|
+
.tox/
|
|
29
|
+
.mypy_cache/
|
|
30
|
+
.ruff_cache/
|
macbot_cli-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Marcus
|
|
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,210 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: macbot-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: macOS automation CLI for AI agents and developers
|
|
5
|
+
Project-URL: Homepage, https://github.com/marcusbuildsthings-droid/macbot
|
|
6
|
+
Project-URL: Repository, https://github.com/marcusbuildsthings-droid/macbot
|
|
7
|
+
Project-URL: Issues, https://github.com/marcusbuildsthings-droid/macbot/issues
|
|
8
|
+
Author-email: Marcus <marcus.builds.things@gmail.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ai-agent,applescript,automation,cli,macos
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Environment :: MacOS X
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: MacOS
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
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 :: System :: Systems Administration
|
|
24
|
+
Classifier: Topic :: Utilities
|
|
25
|
+
Requires-Python: >=3.9
|
|
26
|
+
Requires-Dist: click>=8.0
|
|
27
|
+
Requires-Dist: rich>=13.0
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: black>=23.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# macbot
|
|
36
|
+
|
|
37
|
+
macOS automation CLI for AI agents and developers. Control notifications, clipboard, windows, audio, display, and more from the command line with optional JSON output.
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install macbot-cli
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Quick Start
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Send a notification
|
|
49
|
+
macbot notify "Build Complete" "All tests passed"
|
|
50
|
+
|
|
51
|
+
# Get/set clipboard
|
|
52
|
+
macbot clipboard get
|
|
53
|
+
macbot clipboard set "Hello, World!"
|
|
54
|
+
|
|
55
|
+
# Text-to-speech
|
|
56
|
+
macbot say "Hello from macbot" --voice Daniel
|
|
57
|
+
|
|
58
|
+
# Take a screenshot
|
|
59
|
+
macbot screenshot ~/Desktop/screen.png
|
|
60
|
+
|
|
61
|
+
# Volume control
|
|
62
|
+
macbot audio volume 50
|
|
63
|
+
macbot audio mute
|
|
64
|
+
|
|
65
|
+
# WiFi control
|
|
66
|
+
macbot wifi status
|
|
67
|
+
macbot wifi networks
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Commands
|
|
71
|
+
|
|
72
|
+
### Notifications
|
|
73
|
+
```bash
|
|
74
|
+
macbot notify "Title" "Message"
|
|
75
|
+
macbot notify "Alert" --subtitle "Warning" --sound Ping
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Clipboard
|
|
79
|
+
```bash
|
|
80
|
+
macbot clipboard get # Get contents
|
|
81
|
+
macbot clipboard set "text" # Set contents
|
|
82
|
+
macbot clipboard clear # Clear clipboard
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Text-to-Speech
|
|
86
|
+
```bash
|
|
87
|
+
macbot say "Hello" # Default voice
|
|
88
|
+
macbot say "British" --voice Daniel # Specific voice
|
|
89
|
+
macbot say "Fast" --rate 300 # Faster speech
|
|
90
|
+
macbot say "Save" --output speech.aiff # Save to file
|
|
91
|
+
macbot say "" --list-voices # List voices
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Screenshots
|
|
95
|
+
```bash
|
|
96
|
+
macbot screenshot # Desktop with timestamp
|
|
97
|
+
macbot screenshot screen.png # Specific file
|
|
98
|
+
macbot screenshot --clipboard # To clipboard
|
|
99
|
+
macbot screenshot --window # Front window
|
|
100
|
+
macbot screenshot --interactive # Select region
|
|
101
|
+
macbot screenshot --delay 3 # 3 second delay
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Window Management
|
|
105
|
+
```bash
|
|
106
|
+
macbot window list # List all windows
|
|
107
|
+
macbot window list --app Safari # Filter by app
|
|
108
|
+
macbot window focus Safari # Focus app
|
|
109
|
+
macbot window focus "VS Code" -t project # Focus specific window
|
|
110
|
+
macbot window move Safari -x 0 -y 0 -w 1200 -h 800
|
|
111
|
+
macbot window minimize Safari
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Applications
|
|
115
|
+
```bash
|
|
116
|
+
macbot apps list # All installed apps
|
|
117
|
+
macbot apps list --running # Running apps only
|
|
118
|
+
macbot apps launch Safari # Launch app
|
|
119
|
+
macbot apps launch Safari -b # Launch in background
|
|
120
|
+
macbot apps quit Safari # Quit app
|
|
121
|
+
macbot apps quit "Frozen" --force # Force quit
|
|
122
|
+
macbot apps hide Safari # Hide app
|
|
123
|
+
macbot apps show Safari # Show/unhide app
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Audio
|
|
127
|
+
```bash
|
|
128
|
+
macbot audio volume # Get volume
|
|
129
|
+
macbot audio volume 50 # Set to 50%
|
|
130
|
+
macbot audio mute # Mute
|
|
131
|
+
macbot audio mute --toggle # Toggle mute
|
|
132
|
+
macbot audio unmute # Unmute
|
|
133
|
+
macbot audio devices # List devices
|
|
134
|
+
macbot audio output "Speakers" # Set output device
|
|
135
|
+
macbot audio input "Microphone" # Set input device
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Display Brightness
|
|
139
|
+
```bash
|
|
140
|
+
macbot brightness # Get brightness
|
|
141
|
+
macbot brightness 0.7 # Set to 70%
|
|
142
|
+
macbot brightness 0.5 -d 1 # Set external display
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Requires: `brew install brightness`
|
|
146
|
+
|
|
147
|
+
### WiFi
|
|
148
|
+
```bash
|
|
149
|
+
macbot wifi status # Status and IP
|
|
150
|
+
macbot wifi on # Turn on
|
|
151
|
+
macbot wifi off # Turn off
|
|
152
|
+
macbot wifi networks # List available
|
|
153
|
+
macbot wifi connect "SSID" --password "pass"
|
|
154
|
+
macbot wifi disconnect
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Bluetooth
|
|
158
|
+
```bash
|
|
159
|
+
macbot bluetooth status # Power state
|
|
160
|
+
macbot bluetooth on # Turn on
|
|
161
|
+
macbot bluetooth off # Turn off
|
|
162
|
+
macbot bluetooth devices # List devices
|
|
163
|
+
macbot bluetooth devices --connected # Connected only
|
|
164
|
+
macbot bluetooth connect XX-XX-XX-XX-XX-XX
|
|
165
|
+
macbot bluetooth disconnect XX-XX-XX-XX-XX-XX
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Requires: `brew install blueutil`
|
|
169
|
+
|
|
170
|
+
## JSON Output
|
|
171
|
+
|
|
172
|
+
All commands support `--json` for machine-readable output:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
macbot --json wifi status
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"interface": "en0",
|
|
181
|
+
"power": "on",
|
|
182
|
+
"network": "MyNetwork",
|
|
183
|
+
"ip_address": "192.168.1.100",
|
|
184
|
+
"connected": true,
|
|
185
|
+
"success": true
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Optional Dependencies
|
|
190
|
+
|
|
191
|
+
Some commands require additional tools:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Display brightness
|
|
195
|
+
brew install brightness
|
|
196
|
+
|
|
197
|
+
# Bluetooth control
|
|
198
|
+
brew install blueutil
|
|
199
|
+
|
|
200
|
+
# Audio device switching
|
|
201
|
+
brew install switchaudio-osx
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## For AI Agents
|
|
205
|
+
|
|
206
|
+
See [SKILL.md](SKILL.md) for agent-optimized documentation.
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
|
|
210
|
+
MIT
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# macbot
|
|
2
|
+
|
|
3
|
+
macOS automation CLI for AI agents and developers. Control notifications, clipboard, windows, audio, display, and more from the command line with optional JSON output.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install macbot-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Send a notification
|
|
15
|
+
macbot notify "Build Complete" "All tests passed"
|
|
16
|
+
|
|
17
|
+
# Get/set clipboard
|
|
18
|
+
macbot clipboard get
|
|
19
|
+
macbot clipboard set "Hello, World!"
|
|
20
|
+
|
|
21
|
+
# Text-to-speech
|
|
22
|
+
macbot say "Hello from macbot" --voice Daniel
|
|
23
|
+
|
|
24
|
+
# Take a screenshot
|
|
25
|
+
macbot screenshot ~/Desktop/screen.png
|
|
26
|
+
|
|
27
|
+
# Volume control
|
|
28
|
+
macbot audio volume 50
|
|
29
|
+
macbot audio mute
|
|
30
|
+
|
|
31
|
+
# WiFi control
|
|
32
|
+
macbot wifi status
|
|
33
|
+
macbot wifi networks
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Commands
|
|
37
|
+
|
|
38
|
+
### Notifications
|
|
39
|
+
```bash
|
|
40
|
+
macbot notify "Title" "Message"
|
|
41
|
+
macbot notify "Alert" --subtitle "Warning" --sound Ping
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Clipboard
|
|
45
|
+
```bash
|
|
46
|
+
macbot clipboard get # Get contents
|
|
47
|
+
macbot clipboard set "text" # Set contents
|
|
48
|
+
macbot clipboard clear # Clear clipboard
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Text-to-Speech
|
|
52
|
+
```bash
|
|
53
|
+
macbot say "Hello" # Default voice
|
|
54
|
+
macbot say "British" --voice Daniel # Specific voice
|
|
55
|
+
macbot say "Fast" --rate 300 # Faster speech
|
|
56
|
+
macbot say "Save" --output speech.aiff # Save to file
|
|
57
|
+
macbot say "" --list-voices # List voices
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Screenshots
|
|
61
|
+
```bash
|
|
62
|
+
macbot screenshot # Desktop with timestamp
|
|
63
|
+
macbot screenshot screen.png # Specific file
|
|
64
|
+
macbot screenshot --clipboard # To clipboard
|
|
65
|
+
macbot screenshot --window # Front window
|
|
66
|
+
macbot screenshot --interactive # Select region
|
|
67
|
+
macbot screenshot --delay 3 # 3 second delay
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Window Management
|
|
71
|
+
```bash
|
|
72
|
+
macbot window list # List all windows
|
|
73
|
+
macbot window list --app Safari # Filter by app
|
|
74
|
+
macbot window focus Safari # Focus app
|
|
75
|
+
macbot window focus "VS Code" -t project # Focus specific window
|
|
76
|
+
macbot window move Safari -x 0 -y 0 -w 1200 -h 800
|
|
77
|
+
macbot window minimize Safari
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Applications
|
|
81
|
+
```bash
|
|
82
|
+
macbot apps list # All installed apps
|
|
83
|
+
macbot apps list --running # Running apps only
|
|
84
|
+
macbot apps launch Safari # Launch app
|
|
85
|
+
macbot apps launch Safari -b # Launch in background
|
|
86
|
+
macbot apps quit Safari # Quit app
|
|
87
|
+
macbot apps quit "Frozen" --force # Force quit
|
|
88
|
+
macbot apps hide Safari # Hide app
|
|
89
|
+
macbot apps show Safari # Show/unhide app
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Audio
|
|
93
|
+
```bash
|
|
94
|
+
macbot audio volume # Get volume
|
|
95
|
+
macbot audio volume 50 # Set to 50%
|
|
96
|
+
macbot audio mute # Mute
|
|
97
|
+
macbot audio mute --toggle # Toggle mute
|
|
98
|
+
macbot audio unmute # Unmute
|
|
99
|
+
macbot audio devices # List devices
|
|
100
|
+
macbot audio output "Speakers" # Set output device
|
|
101
|
+
macbot audio input "Microphone" # Set input device
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Display Brightness
|
|
105
|
+
```bash
|
|
106
|
+
macbot brightness # Get brightness
|
|
107
|
+
macbot brightness 0.7 # Set to 70%
|
|
108
|
+
macbot brightness 0.5 -d 1 # Set external display
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Requires: `brew install brightness`
|
|
112
|
+
|
|
113
|
+
### WiFi
|
|
114
|
+
```bash
|
|
115
|
+
macbot wifi status # Status and IP
|
|
116
|
+
macbot wifi on # Turn on
|
|
117
|
+
macbot wifi off # Turn off
|
|
118
|
+
macbot wifi networks # List available
|
|
119
|
+
macbot wifi connect "SSID" --password "pass"
|
|
120
|
+
macbot wifi disconnect
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Bluetooth
|
|
124
|
+
```bash
|
|
125
|
+
macbot bluetooth status # Power state
|
|
126
|
+
macbot bluetooth on # Turn on
|
|
127
|
+
macbot bluetooth off # Turn off
|
|
128
|
+
macbot bluetooth devices # List devices
|
|
129
|
+
macbot bluetooth devices --connected # Connected only
|
|
130
|
+
macbot bluetooth connect XX-XX-XX-XX-XX-XX
|
|
131
|
+
macbot bluetooth disconnect XX-XX-XX-XX-XX-XX
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Requires: `brew install blueutil`
|
|
135
|
+
|
|
136
|
+
## JSON Output
|
|
137
|
+
|
|
138
|
+
All commands support `--json` for machine-readable output:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
macbot --json wifi status
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"interface": "en0",
|
|
147
|
+
"power": "on",
|
|
148
|
+
"network": "MyNetwork",
|
|
149
|
+
"ip_address": "192.168.1.100",
|
|
150
|
+
"connected": true,
|
|
151
|
+
"success": true
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Optional Dependencies
|
|
156
|
+
|
|
157
|
+
Some commands require additional tools:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Display brightness
|
|
161
|
+
brew install brightness
|
|
162
|
+
|
|
163
|
+
# Bluetooth control
|
|
164
|
+
brew install blueutil
|
|
165
|
+
|
|
166
|
+
# Audio device switching
|
|
167
|
+
brew install switchaudio-osx
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## For AI Agents
|
|
171
|
+
|
|
172
|
+
See [SKILL.md](SKILL.md) for agent-optimized documentation.
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
MIT
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# macbot Skill
|
|
2
|
+
|
|
3
|
+
macOS automation CLI with JSON output for AI agent consumption.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- macOS (tested on Ventura+)
|
|
8
|
+
- Python 3.9+
|
|
9
|
+
- Optional: `brew install brightness blueutil switchaudio-osx`
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install macbot-cli
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Command Reference
|
|
18
|
+
|
|
19
|
+
| Command | Description |
|
|
20
|
+
|---------|-------------|
|
|
21
|
+
| `macbot notify "Title" "Msg"` | Send notification |
|
|
22
|
+
| `macbot clipboard get\|set\|clear` | Clipboard ops |
|
|
23
|
+
| `macbot say "text"` | Text-to-speech |
|
|
24
|
+
| `macbot screenshot [path]` | Take screenshot |
|
|
25
|
+
| `macbot window list\|focus\|move\|minimize` | Window management |
|
|
26
|
+
| `macbot apps list\|launch\|quit\|hide\|show` | App control |
|
|
27
|
+
| `macbot audio volume\|mute\|unmute\|devices\|output\|input` | Audio control |
|
|
28
|
+
| `macbot brightness [0.0-1.0]` | Display brightness |
|
|
29
|
+
| `macbot wifi status\|on\|off\|networks\|connect\|disconnect` | WiFi control |
|
|
30
|
+
| `macbot bluetooth status\|on\|off\|devices\|connect\|disconnect\|pair\|unpair` | Bluetooth |
|
|
31
|
+
|
|
32
|
+
## JSON Output
|
|
33
|
+
|
|
34
|
+
**Always use `--json` flag for automation:**
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
macbot --json <command>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
All responses include `"success": true|false`.
|
|
41
|
+
|
|
42
|
+
## Common Patterns
|
|
43
|
+
|
|
44
|
+
### Check System State
|
|
45
|
+
```bash
|
|
46
|
+
# WiFi status
|
|
47
|
+
macbot --json wifi status
|
|
48
|
+
# Returns: {"interface": "en0", "power": "on", "network": "...", "connected": true}
|
|
49
|
+
|
|
50
|
+
# Audio status
|
|
51
|
+
macbot --json audio volume
|
|
52
|
+
# Returns: {"volume": 50}
|
|
53
|
+
|
|
54
|
+
# Running apps
|
|
55
|
+
macbot --json apps list --running
|
|
56
|
+
# Returns: {"apps": [{"name": "...", "running": true}], "count": N}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### System Control
|
|
60
|
+
```bash
|
|
61
|
+
# Set volume to 50%
|
|
62
|
+
macbot --json audio volume 50
|
|
63
|
+
|
|
64
|
+
# Mute/unmute
|
|
65
|
+
macbot --json audio mute
|
|
66
|
+
macbot --json audio unmute
|
|
67
|
+
|
|
68
|
+
# WiFi on/off
|
|
69
|
+
macbot --json wifi on
|
|
70
|
+
macbot --json wifi off
|
|
71
|
+
|
|
72
|
+
# Bluetooth
|
|
73
|
+
macbot --json bluetooth on
|
|
74
|
+
macbot --json bluetooth off
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Notifications
|
|
78
|
+
```bash
|
|
79
|
+
macbot --json notify "Title" "Message body"
|
|
80
|
+
macbot --json notify "Alert" --subtitle "Warning" --sound Ping
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Clipboard
|
|
84
|
+
```bash
|
|
85
|
+
# Read
|
|
86
|
+
macbot --json clipboard get
|
|
87
|
+
# Returns: {"content": "...", "length": N}
|
|
88
|
+
|
|
89
|
+
# Write
|
|
90
|
+
macbot --json clipboard set "text to copy"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Screenshots
|
|
94
|
+
```bash
|
|
95
|
+
# Save to file
|
|
96
|
+
macbot --json screenshot /path/to/output.png
|
|
97
|
+
# Returns: {"captured": true, "path": "...", "exists": true, "size": N}
|
|
98
|
+
|
|
99
|
+
# To clipboard
|
|
100
|
+
macbot --json screenshot --clipboard
|
|
101
|
+
|
|
102
|
+
# Front window only
|
|
103
|
+
macbot --json screenshot --window /path/to/window.png
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Window Management
|
|
107
|
+
```bash
|
|
108
|
+
# List all windows
|
|
109
|
+
macbot --json window list
|
|
110
|
+
# Returns: {"windows": [{"app": "...", "title": "...", "x": 0, "y": 0, "width": N, "height": N}]}
|
|
111
|
+
|
|
112
|
+
# Focus app
|
|
113
|
+
macbot --json window focus Safari
|
|
114
|
+
|
|
115
|
+
# Move/resize
|
|
116
|
+
macbot --json window move Safari --x 0 --y 0 --width 1200 --height 800
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### App Control
|
|
120
|
+
```bash
|
|
121
|
+
# Launch
|
|
122
|
+
macbot --json apps launch Safari
|
|
123
|
+
|
|
124
|
+
# Quit
|
|
125
|
+
macbot --json apps quit Safari
|
|
126
|
+
macbot --json apps quit "Frozen App" --force
|
|
127
|
+
|
|
128
|
+
# Hide/show
|
|
129
|
+
macbot --json apps hide Safari
|
|
130
|
+
macbot --json apps show Safari
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Text-to-Speech
|
|
134
|
+
```bash
|
|
135
|
+
# Speak
|
|
136
|
+
macbot --json say "Hello world"
|
|
137
|
+
|
|
138
|
+
# Specific voice
|
|
139
|
+
macbot --json say "British accent" --voice Daniel
|
|
140
|
+
|
|
141
|
+
# Save to file
|
|
142
|
+
macbot --json say "Save this" --output speech.aiff
|
|
143
|
+
# Returns: {"saved": true, "output": "speech.aiff"}
|
|
144
|
+
|
|
145
|
+
# List voices
|
|
146
|
+
macbot --json say "" --list-voices
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Error Handling
|
|
150
|
+
|
|
151
|
+
Errors return non-zero exit code and JSON:
|
|
152
|
+
```json
|
|
153
|
+
{"error": "Description", "success": false}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Dependencies
|
|
157
|
+
|
|
158
|
+
| Feature | Dependency | Install |
|
|
159
|
+
|---------|-----------|---------|
|
|
160
|
+
| Brightness | brightness | `brew install brightness` |
|
|
161
|
+
| Bluetooth | blueutil | `brew install blueutil` |
|
|
162
|
+
| Audio devices | SwitchAudioSource | `brew install switchaudio-osx` |
|
|
163
|
+
|
|
164
|
+
Commands will error with install instructions if dependencies are missing.
|
|
165
|
+
|
|
166
|
+
## Exit Codes
|
|
167
|
+
|
|
168
|
+
- `0` - Success
|
|
169
|
+
- `1` - Error (details in JSON/stderr)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "macbot-cli"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "macOS automation CLI for AI agents and developers"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "Marcus", email = "marcus.builds.things@gmail.com" }
|
|
13
|
+
]
|
|
14
|
+
keywords = ["macos", "automation", "cli", "ai-agent", "applescript"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
|
+
"Environment :: Console",
|
|
18
|
+
"Environment :: MacOS X",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: MacOS",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.9",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Topic :: System :: Systems Administration",
|
|
28
|
+
"Topic :: Utilities",
|
|
29
|
+
]
|
|
30
|
+
requires-python = ">=3.9"
|
|
31
|
+
dependencies = [
|
|
32
|
+
"click>=8.0",
|
|
33
|
+
"rich>=13.0",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.optional-dependencies]
|
|
37
|
+
dev = [
|
|
38
|
+
"pytest>=7.0",
|
|
39
|
+
"pytest-cov>=4.0",
|
|
40
|
+
"black>=23.0",
|
|
41
|
+
"ruff>=0.1.0",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[project.scripts]
|
|
45
|
+
macbot = "macbot.cli:main"
|
|
46
|
+
|
|
47
|
+
[project.urls]
|
|
48
|
+
Homepage = "https://github.com/marcusbuildsthings-droid/macbot"
|
|
49
|
+
Repository = "https://github.com/marcusbuildsthings-droid/macbot"
|
|
50
|
+
Issues = "https://github.com/marcusbuildsthings-droid/macbot/issues"
|
|
51
|
+
|
|
52
|
+
[tool.hatch.build.targets.wheel]
|
|
53
|
+
packages = ["src/macbot"]
|
|
54
|
+
|
|
55
|
+
[tool.ruff]
|
|
56
|
+
line-length = 100
|
|
57
|
+
target-version = "py39"
|
|
58
|
+
|
|
59
|
+
[tool.ruff.lint]
|
|
60
|
+
select = ["E", "F", "I", "W"]
|
|
61
|
+
|
|
62
|
+
[tool.black]
|
|
63
|
+
line-length = 100
|
|
64
|
+
target-version = ["py39"]
|
|
65
|
+
|
|
66
|
+
[tool.pytest.ini_options]
|
|
67
|
+
testpaths = ["tests"]
|