flutter-dev 0.1.0__tar.gz → 0.1.1__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 (34) hide show
  1. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/LICENSE +1 -1
  2. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/PKG-INFO +27 -4
  3. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/README.md +25 -2
  4. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/fdev.py +5 -0
  5. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/managers/__init__.py +1 -0
  6. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/managers/doctor.py +3 -3
  7. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/managers/git_account.py +1 -1
  8. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/managers/mirror.py +174 -10
  9. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/pyproject.toml +2 -2
  10. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/.env.example +0 -0
  11. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/MANIFEST.in +0 -0
  12. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/common_utils.py +0 -0
  13. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/core/__init__.py +0 -0
  14. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/core/constants.py +0 -0
  15. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/core/state.py +0 -0
  16. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/create_page.py +0 -0
  17. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/flutter_dev.egg-info/SOURCES.txt +0 -0
  18. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/gemini_api.py +0 -0
  19. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/git_diff_output_editor.py +0 -0
  20. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/install_legacy.py +0 -0
  21. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/managers/ai.py +0 -0
  22. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/managers/app.py +0 -0
  23. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/managers/brew.py +0 -0
  24. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/managers/build.py +0 -0
  25. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/managers/datetime.py +0 -0
  26. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/managers/device.py +0 -0
  27. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/managers/git.py +0 -0
  28. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/managers/merge.py +0 -0
  29. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/managers/project.py +0 -0
  30. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/managers/web_deploy.py +0 -0
  31. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/requirements.txt +0 -0
  32. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/setup.cfg +0 -0
  33. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/setup.py +0 -0
  34. {flutter_dev-0.1.0 → flutter_dev-0.1.1}/switch_ai.py +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Maxcode
3
+ Copyright (c) 2026 Royal Court BD
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flutter-dev
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: A cross-platform CLI toolkit for Flutter development workflows.
5
- Author: Maxcode
5
+ Author: Royal Court BD
6
6
  License-Expression: MIT
7
7
  Project-URL: Homepage, https://github.com/royalcourtbd/flutter-development-tools
8
8
  Project-URL: Repository, https://github.com/royalcourtbd/flutter-development-tools
@@ -186,6 +186,7 @@ create-page page user_profile # Direct command
186
186
  ```bash
187
187
  fdev uninstall # Uninstall app from connected device
188
188
  fdev clear-data # Clear data of currently running foreground app (Android/iOS)
189
+ fdev install-scrcpy # Install scrcpy for Android screen mirroring
189
190
  fdev mirror # Launch scrcpy screen mirror
190
191
  fdev mirror --wireless # Setup wireless ADB connection first
191
192
  fdev mirror --no-top # Launch mirror without always-on-top window
@@ -229,9 +230,31 @@ fdev clear-data
229
230
 
230
231
  **Installation:**
231
232
 
232
- scrcpy install করার দুইটি উপায়:
233
+ Recommended flow:
233
234
 
234
- **Option 1: Homebrew দিয়ে (Recommended)**
235
+ ```bash
236
+ pip install flutter-dev
237
+ fdev doctor
238
+ fdev install-scrcpy
239
+ fdev mirror
240
+ ```
241
+
242
+ `fdev mirror` চালানোর সময় `scrcpy` না থাকলে tool prompt করবে:
243
+
244
+ ```text
245
+ scrcpy not found.
246
+ Install now? (Y/n)
247
+ ```
248
+
249
+ Platform অনুযায়ী installer command চালানো হবে:
250
+
251
+ - macOS: `brew install scrcpy`
252
+ - Windows: `winget install --exact Genymobile.scrcpy`, fallback `scoop`/`choco`
253
+ - Linux: `sudo apt-get install scrcpy`, fallback `snap`/other package managers
254
+
255
+ Internet না থাকলে, package manager missing থাকলে, বা admin/sudo permission লাগলে tool clear message দেখাবে। Linux/macOS-এ sudo password terminal-এ user নিজে দেবে; Windows-এ permission issue হলে Terminal/PowerShell as Administrator চালাতে হতে পারে।
256
+
257
+ **Manual Option 1: Homebrew দিয়ে**
235
258
 
236
259
  ```bash
237
260
  brew install scrcpy
@@ -154,6 +154,7 @@ create-page page user_profile # Direct command
154
154
  ```bash
155
155
  fdev uninstall # Uninstall app from connected device
156
156
  fdev clear-data # Clear data of currently running foreground app (Android/iOS)
157
+ fdev install-scrcpy # Install scrcpy for Android screen mirroring
157
158
  fdev mirror # Launch scrcpy screen mirror
158
159
  fdev mirror --wireless # Setup wireless ADB connection first
159
160
  fdev mirror --no-top # Launch mirror without always-on-top window
@@ -197,9 +198,31 @@ fdev clear-data
197
198
 
198
199
  **Installation:**
199
200
 
200
- scrcpy install করার দুইটি উপায়:
201
+ Recommended flow:
201
202
 
202
- **Option 1: Homebrew দিয়ে (Recommended)**
203
+ ```bash
204
+ pip install flutter-dev
205
+ fdev doctor
206
+ fdev install-scrcpy
207
+ fdev mirror
208
+ ```
209
+
210
+ `fdev mirror` চালানোর সময় `scrcpy` না থাকলে tool prompt করবে:
211
+
212
+ ```text
213
+ scrcpy not found.
214
+ Install now? (Y/n)
215
+ ```
216
+
217
+ Platform অনুযায়ী installer command চালানো হবে:
218
+
219
+ - macOS: `brew install scrcpy`
220
+ - Windows: `winget install --exact Genymobile.scrcpy`, fallback `scoop`/`choco`
221
+ - Linux: `sudo apt-get install scrcpy`, fallback `snap`/other package managers
222
+
223
+ Internet না থাকলে, package manager missing থাকলে, বা admin/sudo permission লাগলে tool clear message দেখাবে। Linux/macOS-এ sudo password terminal-এ user নিজে দেবে; Windows-এ permission issue হলে Terminal/PowerShell as Administrator চালাতে হতে পারে।
224
+
225
+ **Manual Option 1: Homebrew দিয়ে**
203
226
 
204
227
  ```bash
205
228
  brew install scrcpy
@@ -42,6 +42,7 @@ from managers.project import (
42
42
  from managers.mirror import (
43
43
  setup_wireless_adb,
44
44
  launch_scrcpy,
45
+ install_scrcpy,
45
46
  )
46
47
  from managers.merge import (
47
48
  merge_files,
@@ -90,6 +91,7 @@ def show_usage():
90
91
  print(" install Install built APK on connected device")
91
92
  print(" uninstall Uninstall app from connected device")
92
93
  print(" clear-data Clear data of currently running foreground app")
94
+ print(" install-scrcpy Install scrcpy for Android screen mirroring")
93
95
  print(" mirror Launch scrcpy screen mirror (auto-detect device)")
94
96
  print(" --wireless Setup wireless ADB connection")
95
97
  print(" --no-top Launch mirror without 'always on top' window")
@@ -114,6 +116,7 @@ def show_usage():
114
116
 
115
117
  print(f"\n{BLUE}Examples:{NC}")
116
118
  print(f" {GREEN}fdev mirror{NC} # Launch screen mirror")
119
+ print(f" {GREEN}fdev install-scrcpy{NC} # Install scrcpy for mirroring")
117
120
  print(f" {GREEN}fdev mirror --wireless{NC} # Setup wireless ADB first")
118
121
  print(f" {GREEN}fdev mirror --no-top{NC} # Launch mirror without always-on-top")
119
122
  print(f" {GREEN}fdev datetime{NC} # Open device Date & Time settings")
@@ -177,6 +180,8 @@ def main():
177
180
  uninstall_app()
178
181
  elif command == "clear-data":
179
182
  clear_app_data()
183
+ elif command == "install-scrcpy":
184
+ install_scrcpy()
180
185
 
181
186
  # Git & iOS commands
182
187
  elif command == "pod":
@@ -46,6 +46,7 @@ from .project import (
46
46
  from .mirror import (
47
47
  setup_wireless_adb,
48
48
  launch_scrcpy,
49
+ install_scrcpy,
49
50
  )
50
51
 
51
52
  from .merge import (
@@ -219,11 +219,11 @@ def run_doctor():
219
219
  status, detail = _check_tool("scrcpy", ["scrcpy", "--version"])
220
220
  if not status:
221
221
  if is_macos():
222
- detail = "not found (brew install scrcpy)"
222
+ detail = "not found (run: fdev install-scrcpy)"
223
223
  elif is_windows():
224
- detail = "not found (scoop install scrcpy)"
224
+ detail = "not found (run: fdev install-scrcpy)"
225
225
  else:
226
- detail = "not found (apt install scrcpy)"
226
+ detail = "not found (run: fdev install-scrcpy)"
227
227
  print_result("scrcpy", status, detail, required=False)
228
228
 
229
229
  status, detail = _check_tool("Firebase CLI", ["firebase", "--version"])
@@ -53,7 +53,7 @@ def _run_gh(args, capture=True, timeout=15):
53
53
  def _parse_auth_status():
54
54
  """
55
55
  Parse `gh auth status` output and return a list of dicts:
56
- [{"user": "devsmaxcode", "active": True, "host": "github.com"}, ...]
56
+ [{"user": "royalcourtbd", "active": True, "host": "github.com"}, ...]
57
57
 
58
58
  Returns empty list if `gh` not installed or no accounts logged in.
59
59
  """
@@ -3,8 +3,10 @@
3
3
  Mirror Manager - scrcpy and wireless ADB functions
4
4
  """
5
5
 
6
+ import socket
6
7
  import shutil
7
8
  import subprocess
9
+ import sys
8
10
 
9
11
  from common_utils import (
10
12
  RED, GREEN, YELLOW, BLUE, NC,
@@ -19,6 +21,177 @@ from managers.device import (
19
21
  )
20
22
 
21
23
 
24
+ def _has_internet_connection(timeout=3):
25
+ """Return True when the computer can reach the internet."""
26
+ try:
27
+ socket.create_connection(("github.com", 443), timeout=timeout).close()
28
+ return True
29
+ except OSError:
30
+ return False
31
+
32
+
33
+ def _ask_yes_no(prompt, default_yes=True):
34
+ """Ask a yes/no question in an interactive terminal."""
35
+ if not sys.stdin.isatty():
36
+ return False
37
+
38
+ suffix = "Y/n" if default_yes else "y/N"
39
+ try:
40
+ answer = input(f"{prompt} ({suffix}): ").strip().lower()
41
+ except KeyboardInterrupt:
42
+ print(f"\n{YELLOW}Operation cancelled{NC}")
43
+ return False
44
+
45
+ if not answer:
46
+ return default_yes
47
+ return answer in ("y", "yes")
48
+
49
+
50
+ def _run_install_command(command):
51
+ """Run an installer command interactively so sudo/admin prompts can appear."""
52
+ print(f"\n{BLUE}Running:{NC} {GREEN}{' '.join(command)}{NC}\n")
53
+ try:
54
+ result = subprocess.run(command)
55
+ return result.returncode == 0
56
+ except FileNotFoundError:
57
+ print(f"{RED}Command not found: {command[0]}{NC}")
58
+ return False
59
+ except KeyboardInterrupt:
60
+ print(f"\n{YELLOW}Installation interrupted by user{NC}")
61
+ return False
62
+
63
+
64
+ def _print_scrcpy_manual_install_help():
65
+ """Show platform-specific manual install instructions."""
66
+ print(f"\n{YELLOW}Manual install options:{NC}")
67
+ if is_windows():
68
+ print(f" {BLUE}winget install --exact Genymobile.scrcpy{NC}")
69
+ print(f" {BLUE}scoop install scrcpy{NC}")
70
+ print(f" {BLUE}choco install scrcpy{NC}")
71
+ print(f"\n{YELLOW}If Windows asks for permission, run PowerShell/Terminal as Administrator.{NC}")
72
+ elif is_macos():
73
+ print(f" {BLUE}brew install scrcpy{NC}")
74
+ print(f" {BLUE}brew install --cask android-platform-tools{NC} # if adb is missing")
75
+ print(f"\n{YELLOW}Homebrew should not be run with sudo. Install Homebrew first if brew is missing.{NC}")
76
+ elif is_linux():
77
+ print(f" {BLUE}sudo apt-get update && sudo apt-get install -y scrcpy{NC}")
78
+ print(f" {BLUE}sudo snap install scrcpy{NC}")
79
+ print(f"\n{YELLOW}Linux installs may require your sudo password in the terminal.{NC}")
80
+ else:
81
+ print(f" Download scrcpy from the official Genymobile GitHub releases page.")
82
+
83
+
84
+ def _get_scrcpy_install_plan():
85
+ """
86
+ Return a list of command groups to try for the current platform.
87
+ Each group may contain multiple commands that must all succeed.
88
+ """
89
+ if is_macos():
90
+ if shutil.which("brew"):
91
+ return [[["brew", "install", "scrcpy"]]]
92
+ return []
93
+
94
+ if is_windows():
95
+ plans = []
96
+ if shutil.which("winget"):
97
+ plans.append([[
98
+ "winget", "install", "--exact", "Genymobile.scrcpy",
99
+ "--accept-package-agreements", "--accept-source-agreements"
100
+ ]])
101
+ if shutil.which("scoop"):
102
+ plans.append([["scoop", "install", "scrcpy"]])
103
+ if shutil.which("choco"):
104
+ plans.append([["choco", "install", "scrcpy", "-y"]])
105
+ return plans
106
+
107
+ if is_linux():
108
+ plans = []
109
+ if shutil.which("apt-get"):
110
+ plans.append([
111
+ ["sudo", "apt-get", "update"],
112
+ ["sudo", "apt-get", "install", "-y", "scrcpy"],
113
+ ])
114
+ if shutil.which("snap"):
115
+ plans.append([["sudo", "snap", "install", "scrcpy"]])
116
+ if shutil.which("pacman"):
117
+ plans.append([["sudo", "pacman", "-S", "--needed", "scrcpy"]])
118
+ if shutil.which("dnf"):
119
+ plans.append([["sudo", "dnf", "install", "-y", "scrcpy"]])
120
+ return plans
121
+
122
+ return []
123
+
124
+
125
+ def install_scrcpy():
126
+ """
127
+ Install scrcpy using the best available platform package manager.
128
+ Returns True when scrcpy is available after the install attempt.
129
+ """
130
+ existing = shutil.which("scrcpy")
131
+ if existing:
132
+ print(f"{GREEN}✓ scrcpy already installed: {existing}{NC}")
133
+ return True
134
+
135
+ print(f"{YELLOW}scrcpy not found. Installing scrcpy...{NC}")
136
+
137
+ if not _has_internet_connection():
138
+ print(f"{RED}Could not reach the internet from this computer/device.{NC}")
139
+ print(f"{YELLOW}Please connect to the internet, then run: {BLUE}fdev install-scrcpy{NC}")
140
+ _print_scrcpy_manual_install_help()
141
+ return False
142
+
143
+ install_plans = _get_scrcpy_install_plan()
144
+ if not install_plans:
145
+ print(f"{RED}No supported package manager found for automatic scrcpy installation.{NC}")
146
+ _print_scrcpy_manual_install_help()
147
+ return False
148
+
149
+ for plan in install_plans:
150
+ plan_ok = True
151
+ for command in plan:
152
+ if not _run_install_command(command):
153
+ plan_ok = False
154
+ break
155
+
156
+ if plan_ok:
157
+ scrcpy_path = shutil.which("scrcpy")
158
+ if scrcpy_path:
159
+ print(f"\n{GREEN}✓ scrcpy installed successfully: {scrcpy_path}{NC}")
160
+ return True
161
+
162
+ print(f"\n{YELLOW}Install command completed, but scrcpy is not visible in PATH yet.{NC}")
163
+ if is_windows():
164
+ print(f"{YELLOW}Restart your terminal and try: {BLUE}fdev mirror{NC}")
165
+ else:
166
+ print(f"{YELLOW}Open a new terminal, or make sure the package manager bin directory is in PATH.{NC}")
167
+ return False
168
+
169
+ print(f"\n{RED}Could not install scrcpy automatically.{NC}")
170
+ print(f"{YELLOW}Possible reasons:{NC}")
171
+ print(" - No internet connection")
172
+ print(" - Package manager is missing or failed")
173
+ print(" - Admin/sudo permission is required")
174
+ print(" - scrcpy package is unavailable for this OS/version")
175
+ _print_scrcpy_manual_install_help()
176
+ return False
177
+
178
+
179
+ def ensure_scrcpy_available(allow_prompt=True):
180
+ """Check scrcpy availability and optionally offer to install it."""
181
+ scrcpy_path = shutil.which("scrcpy")
182
+ if scrcpy_path:
183
+ return True
184
+
185
+ print(f"{RED}scrcpy not found.{NC}")
186
+
187
+ if allow_prompt and _ask_yes_no("Install now?", default_yes=True):
188
+ return install_scrcpy()
189
+
190
+ print(f"{YELLOW}Run: {BLUE}fdev install-scrcpy{NC}")
191
+ _print_scrcpy_manual_install_help()
192
+ return False
193
+
194
+
22
195
  def select_usb_device_for_wireless():
23
196
  """
24
197
  Prompt user to select a USB device if multiple are connected.
@@ -157,16 +330,7 @@ def launch_scrcpy(always_on_top=True):
157
330
  """
158
331
  print(f"{YELLOW}Launching scrcpy...{NC}\n")
159
332
 
160
- # Check if scrcpy is installed (cross-platform)
161
- scrcpy_path = shutil.which("scrcpy")
162
- if not scrcpy_path:
163
- print(f"{RED}Error: scrcpy not found!{NC}")
164
- if is_windows():
165
- print(f"{YELLOW}Install: scoop install scrcpy OR choco install scrcpy{NC}")
166
- elif is_macos():
167
- print(f"{YELLOW}Install: brew install scrcpy{NC}")
168
- else:
169
- print(f"{YELLOW}Install: sudo apt install scrcpy OR sudo snap install scrcpy{NC}")
333
+ if not ensure_scrcpy_available(allow_prompt=True):
170
334
  return False
171
335
 
172
336
  # Check for connected device and select if multiple
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "flutter-dev"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  description = "A cross-platform CLI toolkit for Flutter development workflows."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
11
11
  license = "MIT"
12
12
  license-files = ["LICENSE"]
13
13
  authors = [
14
- { name = "Maxcode" }
14
+ { name = "Royal Court BD" }
15
15
  ]
16
16
  keywords = ["flutter", "cli", "developer-tools", "automation"]
17
17
  classifiers = [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes