appforge-cli 1.2.4__tar.gz → 1.5.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.
- appforge_cli-1.5.0/PKG-INFO +16 -0
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/appforge/ai.py +21 -24
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/appforge/cli.py +88 -35
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/appforge/create.py +5 -2
- appforge_cli-1.5.0/appforge/default_icon.png +0 -0
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/appforge/github.py +114 -34
- appforge_cli-1.5.0/appforge/injector.py +125 -0
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/appforge/utils.py +45 -1
- appforge_cli-1.5.0/appforge_cli.egg-info/PKG-INFO +16 -0
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/appforge_cli.egg-info/SOURCES.txt +2 -1
- appforge_cli-1.5.0/appforge_cli.egg-info/requires.txt +2 -0
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/pyproject.toml +2 -1
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/setup.py +7 -6
- appforge_cli-1.2.4/PKG-INFO +0 -280
- appforge_cli-1.2.4/README.md +0 -264
- appforge_cli-1.2.4/appforge_cli.egg-info/PKG-INFO +0 -280
- appforge_cli-1.2.4/appforge_cli.egg-info/requires.txt +0 -1
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/appforge/__init__.py +0 -0
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/appforge/capacitor.py +0 -0
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/appforge/config.py +0 -0
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/appforge/detector.py +0 -0
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/appforge/knowledge_base.json +0 -0
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/appforge_cli.egg-info/dependency_links.txt +0 -0
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/appforge_cli.egg-info/entry_points.txt +0 -0
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/appforge_cli.egg-info/top_level.txt +0 -0
- {appforge_cli-1.2.4 → appforge_cli-1.5.0}/setup.cfg +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: appforge-cli
|
|
3
|
+
Version: 1.5.0
|
|
4
|
+
Summary: Convert web, Flutter, and native apps into Android/iOS apps automatically using cloud builds.
|
|
5
|
+
Author: AppForge Team
|
|
6
|
+
Author-email: AppForge Team <juniorsir.bot@gmail.com>
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
Requires-Dist: requests
|
|
15
|
+
Requires-Dist: packaging
|
|
16
|
+
Dynamic: author
|
|
@@ -1,69 +1,66 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import json
|
|
3
|
-
import re
|
|
3
|
+
import re
|
|
4
4
|
from .utils import print_info, print_success, print_error, CYAN, RESET, GRAY
|
|
5
5
|
|
|
6
6
|
def load_knowledge_base():
|
|
7
7
|
"""Loads the AI keyword-to-plugin mappings from the JSON file."""
|
|
8
8
|
try:
|
|
9
|
+
# __file__ gives the path to the current python script (ai.py)
|
|
9
10
|
current_dir = os.path.dirname(os.path.abspath(__file__))
|
|
10
11
|
json_path = os.path.join(current_dir, 'knowledge_base.json')
|
|
11
12
|
with open(json_path, 'r') as f:
|
|
12
13
|
return json.load(f)
|
|
13
14
|
except Exception as e:
|
|
15
|
+
# Note: print_error must be imported from utils
|
|
14
16
|
print_error(f"Critical Error: Could not load AI knowledge base: {e}")
|
|
15
17
|
return {}
|
|
16
18
|
|
|
17
19
|
def scan_codebase_for_permissions():
|
|
18
20
|
"""
|
|
19
21
|
Universally scans project files. It now uses regex to robustly parse
|
|
20
|
-
Flutter pubspec.yaml files
|
|
22
|
+
Flutter pubspec.yaml files and scans web directories like 'www'.
|
|
21
23
|
"""
|
|
22
24
|
ai_knowledge_base = load_knowledge_base()
|
|
23
|
-
|
|
25
|
+
|
|
24
26
|
print_info(f"{CYAN}🤖 AI Agent scanning codebase for native features...{RESET}")
|
|
25
|
-
|
|
27
|
+
|
|
26
28
|
found_plugins = {}
|
|
27
29
|
pubspec_already_scanned = False
|
|
28
|
-
|
|
30
|
+
|
|
29
31
|
for root, dirs, files in os.walk('.'):
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
# FIXED: Removed 'www' from the ignore list so your HTML files are scanned!
|
|
33
|
+
dirs[:] = [d for d in dirs if d not in ['node_modules', '.git', 'android', 'ios', 'dist', 'build', '.next', '.nuxt', '.dart_tool']]
|
|
34
|
+
|
|
32
35
|
for file in files:
|
|
33
36
|
file_path = os.path.join(root, file)
|
|
34
37
|
|
|
35
|
-
# --- FLUTTER SCANNER
|
|
38
|
+
# --- FLUTTER SCANNER ---
|
|
36
39
|
if file == 'pubspec.yaml' and not pubspec_already_scanned:
|
|
37
40
|
try:
|
|
38
41
|
with open(file_path, 'r', encoding='utf-8', errors='ignore') as f:
|
|
39
42
|
content = f.read()
|
|
40
|
-
|
|
43
|
+
|
|
41
44
|
if 'workspace:' in content:
|
|
42
45
|
print_info(f"Ignoring Flutter workspace file: {GRAY}{file_path}{RESET}")
|
|
43
46
|
continue
|
|
44
|
-
|
|
47
|
+
|
|
45
48
|
print_info(f"Analyzing dependencies in {GRAY}{file_path}{RESET}")
|
|
46
49
|
for keyword, data in ai_knowledge_base.items():
|
|
47
50
|
if keyword.startswith("pubspec:"):
|
|
48
51
|
package_name = keyword.split(":")[1]
|
|
49
|
-
|
|
50
|
-
#
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
# \s* - any amount of whitespace (spaces, tabs)
|
|
54
|
-
# {name} - the package name
|
|
55
|
-
# : - a colon
|
|
56
|
-
pattern = re.compile(f"^\s*{re.escape(package_name)}:", re.MULTILINE)
|
|
57
|
-
|
|
52
|
+
|
|
53
|
+
# FIXED: Using fr"" (Raw F-String) to stop the SyntaxWarning
|
|
54
|
+
pattern = re.compile(fr"^\s*{re.escape(package_name)}:", re.MULTILINE)
|
|
55
|
+
|
|
58
56
|
if pattern.search(content):
|
|
59
57
|
found_plugins[data["plugin"]] = data
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
pubspec_already_scanned = True
|
|
58
|
+
|
|
59
|
+
pubspec_already_scanned = True
|
|
63
60
|
except Exception:
|
|
64
61
|
pass
|
|
65
62
|
|
|
66
|
-
# --- WEB SCANNER (
|
|
63
|
+
# --- WEB SCANNER (index.html, etc.) ---
|
|
67
64
|
elif file.endswith(('.js', '.ts', '.jsx', '.tsx', '.vue', '.svelte', '.html')):
|
|
68
65
|
try:
|
|
69
66
|
with open(file_path, 'r', encoding='utf-8', errors='ignore') as f:
|
|
@@ -74,5 +71,5 @@ def scan_codebase_for_permissions():
|
|
|
74
71
|
found_plugins[data["plugin"]] = data
|
|
75
72
|
except Exception:
|
|
76
73
|
pass
|
|
77
|
-
|
|
74
|
+
|
|
78
75
|
return found_plugins
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import sys
|
|
3
3
|
import argparse
|
|
4
|
+
import shutil
|
|
4
5
|
from .utils import (print_header, print_footer, print_info, print_success, prompt, print_error, print_warning,
|
|
5
|
-
GRAY, RESET, BOLD, CYAN, YELLOW, GREEN, RED,
|
|
6
|
+
GRAY, RESET, BOLD, CYAN, YELLOW, GREEN, RED, CLI_VERSION,
|
|
6
7
|
cursor_up, clear_from_cursor)
|
|
7
8
|
from .detector import detect_project
|
|
8
9
|
from .capacitor import setup_capacitor, apply_configuration
|
|
@@ -17,7 +18,21 @@ def init_project():
|
|
|
17
18
|
project_info = detect_project()
|
|
18
19
|
category = project_info.get("category", "web")
|
|
19
20
|
proj_type = project_info.get("type", "unknown")
|
|
20
|
-
|
|
21
|
+
default_icon_dest = os.path.join(os.getcwd(), "appforge_icon.png")
|
|
22
|
+
|
|
23
|
+
current_config = load_local_config()
|
|
24
|
+
if not current_config.get("iconPath") or not os.path.exists(current_config.get("iconPath")):
|
|
25
|
+
try:
|
|
26
|
+
cli_dir = os.path.dirname(os.path.abspath(__file__))
|
|
27
|
+
bundled_icon = os.path.join(cli_dir, "default_icon.png")
|
|
28
|
+
|
|
29
|
+
if os.path.exists(bundled_icon):
|
|
30
|
+
shutil.copy2(bundled_icon, default_icon_dest)
|
|
31
|
+
save_local_config({"iconPath": default_icon_dest})
|
|
32
|
+
print_info("Installed default AppForge app icon.")
|
|
33
|
+
except Exception as e:
|
|
34
|
+
pass
|
|
35
|
+
|
|
21
36
|
save_local_config({"category": category, "project_type": proj_type})
|
|
22
37
|
|
|
23
38
|
if category == "web":
|
|
@@ -34,9 +49,7 @@ def init_project():
|
|
|
34
49
|
platform_choice = prompt("Select platform to build in cloud (android, ios, both)", "android").lower()
|
|
35
50
|
save_local_config({"platform": platform_choice})
|
|
36
51
|
|
|
37
|
-
# --- UNIVERSAL AI PERMISSION SYSTEM ---
|
|
38
52
|
print("")
|
|
39
|
-
# Pass the category to the AI!
|
|
40
53
|
detected_features = scan_codebase_for_permissions()
|
|
41
54
|
|
|
42
55
|
if detected_features:
|
|
@@ -48,22 +61,21 @@ def init_project():
|
|
|
48
61
|
print_info("The AppForge Cloud Server will automatically inject these permissions during the build process.")
|
|
49
62
|
else:
|
|
50
63
|
print_info("AI scan complete. No special native permissions detected.")
|
|
51
|
-
# --------------------------------------
|
|
52
64
|
try:
|
|
53
65
|
import subprocess
|
|
54
|
-
|
|
55
|
-
|
|
66
|
+
git_root = subprocess.check_output(
|
|
67
|
+
['git', 'rev-parse', '--show-toplevel'],
|
|
68
|
+
text=True,
|
|
69
|
+
stderr=subprocess.DEVNULL
|
|
70
|
+
).strip()
|
|
56
71
|
|
|
57
|
-
# Get the relative path from the git root to the current directory
|
|
58
72
|
sub_path = os.path.relpath(os.getcwd(), git_root)
|
|
59
73
|
|
|
60
|
-
# If we are in a sub-directory, save it
|
|
61
74
|
if sub_path and sub_path != '.':
|
|
62
75
|
print_info(f"Detected sub-project path: {GRAY}{sub_path}{RESET}")
|
|
63
76
|
save_local_config({"sub_path": sub_path})
|
|
64
77
|
|
|
65
78
|
except (subprocess.CalledProcessError, FileNotFoundError):
|
|
66
|
-
# Not a git repo, or git not installed. Assume it's a standalone project.
|
|
67
79
|
save_local_config({"sub_path": "."})
|
|
68
80
|
print_success("Ready to send to the AppForge Cloud Builder.")
|
|
69
81
|
|
|
@@ -72,13 +84,22 @@ def configure_project():
|
|
|
72
84
|
print_info("Interactive Configuration")
|
|
73
85
|
app_name = prompt("App name", config.get("appName", "My App"))
|
|
74
86
|
package_id = prompt("Package ID", config.get("packageId", "com.example.app"))
|
|
75
|
-
|
|
87
|
+
build_mode = prompt("Default Build Mode (debug/release)", config.get("buildMode", "debug")).lower()
|
|
88
|
+
if build_mode not in ['debug', 'release']: build_mode = 'debug'
|
|
89
|
+
current_icon = config.get("iconPath", "")
|
|
90
|
+
icon_prompt = prompt("Icon path (local PNG)", current_icon)
|
|
91
|
+
|
|
92
|
+
# If they typed a new path, use it. Otherwise, keep the old one.
|
|
93
|
+
final_icon_path = icon_prompt if icon_prompt else current_icon
|
|
94
|
+
|
|
76
95
|
splash_img = prompt("Splash image (local PNG)", config.get("splashImg", ""))
|
|
77
96
|
splash_bg = prompt("Splash background color (HEX)", config.get("splashBg", "#ffffff"))
|
|
78
97
|
|
|
79
98
|
new_config = {
|
|
80
99
|
"appName": app_name,
|
|
81
100
|
"packageId": package_id,
|
|
101
|
+
"buildMode": build_mode,
|
|
102
|
+
"iconPath": final_icon_path,
|
|
82
103
|
"iconPath": icon_path,
|
|
83
104
|
"splashImg": splash_img,
|
|
84
105
|
"splashBg": splash_bg
|
|
@@ -86,13 +107,15 @@ def configure_project():
|
|
|
86
107
|
save_local_config(new_config)
|
|
87
108
|
|
|
88
109
|
web_dir = config.get("webDir", "dist")
|
|
89
|
-
|
|
110
|
+
if config.get("category") == "web":
|
|
111
|
+
apply_configuration(app_name, package_id, final_icon_path, splash_img, splash_bg, web_dir)
|
|
90
112
|
return new_config
|
|
91
113
|
|
|
92
114
|
def display_app_details(config):
|
|
93
115
|
print(f"{BOLD}App Configuration:{RESET}")
|
|
94
116
|
print(f" {GRAY}Name:{RESET} {config.get('appName', 'Not set')}")
|
|
95
117
|
print(f" {GRAY}Package ID:{RESET} {config.get('packageId', 'Not set')}")
|
|
118
|
+
print(f" {GRAY}Default Mode:{RESET} {config.get('buildMode', 'debug').upper()}")
|
|
96
119
|
print(f" {GRAY}Web Directory:{RESET} {config.get('webDir', 'Not set')}")
|
|
97
120
|
print(f" {GRAY}Icon:{RESET} {config.get('iconPath', 'Not set')}")
|
|
98
121
|
print(f" {GRAY}Splash Image:{RESET} {config.get('splashImg', 'Not set')}")
|
|
@@ -120,7 +143,6 @@ def build_app():
|
|
|
120
143
|
config['platform'] = new_platform.lower()
|
|
121
144
|
config_was_updated = True
|
|
122
145
|
|
|
123
|
-
# --- VERSION INCREMENT LOGIC ---
|
|
124
146
|
current_version_str = config.get("version", "1.0.0")
|
|
125
147
|
try:
|
|
126
148
|
parts = current_version_str.split('.')
|
|
@@ -130,6 +152,16 @@ def build_app():
|
|
|
130
152
|
new_version_str = "1.0.1"
|
|
131
153
|
|
|
132
154
|
print_info(f"Preparing build for version: {CYAN}{new_version_str}{RESET}")
|
|
155
|
+
build_type = config.get("buildMode")
|
|
156
|
+
|
|
157
|
+
if not build_type:
|
|
158
|
+
choice = prompt("Build for Production Release? (Y/n - 'n' builds Debug)", default="y").lower()
|
|
159
|
+
build_type = "release" if choice in ['y', 'yes', ''] else "debug"
|
|
160
|
+
# Save this choice so we don't have to ask again next time
|
|
161
|
+
save_local_config({"buildMode": build_type})
|
|
162
|
+
|
|
163
|
+
# Update the working config object
|
|
164
|
+
config['build_type'] = build_type
|
|
133
165
|
config['version'] = new_version_str
|
|
134
166
|
|
|
135
167
|
if config_was_updated:
|
|
@@ -139,7 +171,10 @@ def build_app():
|
|
|
139
171
|
print_info("Ready to build with the following configuration:")
|
|
140
172
|
display_app_details(config)
|
|
141
173
|
print(f" {GRAY}Target Platform:{RESET} {config.get('platform', 'android')}")
|
|
142
|
-
print(f" {GRAY}Next Version:{RESET} {new_version_str}
|
|
174
|
+
print(f" {GRAY}Next Version:{RESET} {new_version_str}")
|
|
175
|
+
# Show the user what they selected
|
|
176
|
+
color = GREEN if build_type == "release" else YELLOW
|
|
177
|
+
print(f" {GRAY}Build Mode:{RESET} {color}{build_type.upper()}{RESET}\n")
|
|
143
178
|
|
|
144
179
|
# Ask ONLY ONCE if they want to build
|
|
145
180
|
action = prompt("Proceed with build? (Y/n)", default="y").lower()
|
|
@@ -148,7 +183,7 @@ def build_app():
|
|
|
148
183
|
# 1. Save new version to local memory
|
|
149
184
|
save_local_config({"version": new_version_str})
|
|
150
185
|
|
|
151
|
-
# 2. Sync CLI memory to Capacitor native config
|
|
186
|
+
# 2. Sync CLI memory to Capacitor native config (if applicable)
|
|
152
187
|
if config.get("category") == "web":
|
|
153
188
|
apply_configuration(
|
|
154
189
|
config.get('appName', 'My App'),
|
|
@@ -174,6 +209,7 @@ def build_app():
|
|
|
174
209
|
print(f"\n{GREEN}Run 'appforge configure' to edit App configuration{RESET}")
|
|
175
210
|
print("\n")
|
|
176
211
|
print_info("Build cancelled.")
|
|
212
|
+
|
|
177
213
|
def show_history():
|
|
178
214
|
"""Displays a list of past builds with their current cloud status."""
|
|
179
215
|
history = load_history()
|
|
@@ -192,19 +228,14 @@ def show_history():
|
|
|
192
228
|
for entry in entries_to_display:
|
|
193
229
|
from datetime import datetime
|
|
194
230
|
|
|
195
|
-
# Format the timestamp
|
|
196
231
|
dt_obj = datetime.fromisoformat(entry['triggered_at'].replace('Z', '+00:00'))
|
|
197
232
|
formatted_time = dt_obj.strftime('%Y-%m-%d %H:%M:%S')
|
|
198
233
|
|
|
199
|
-
# Fetch real-time status from GitHub
|
|
200
234
|
run_id = entry.get("run_id")
|
|
201
235
|
if run_id:
|
|
202
236
|
status, conclusion = get_build_status_by_id(run_id)
|
|
203
237
|
else:
|
|
204
|
-
# Fallback for old history items
|
|
205
238
|
status, conclusion = entry.get("status", "unknown"), entry.get("conclusion", None)
|
|
206
|
-
|
|
207
|
-
# --- STATIC STATUS DISPLAY LOGIC ---
|
|
208
239
|
status_text = ""
|
|
209
240
|
if status in ["in_progress", "queued"]:
|
|
210
241
|
# Static yellow text instead of animation
|
|
@@ -222,23 +253,17 @@ def show_history():
|
|
|
222
253
|
|
|
223
254
|
print("-" * 80)
|
|
224
255
|
|
|
225
|
-
# Update the prompt text to be perfectly clear
|
|
226
256
|
choice = prompt("Enter a number or App ID to re-download, or press Enter to exit").strip().lower()
|
|
227
257
|
|
|
228
|
-
selected_entry = None
|
|
258
|
+
selected_entry = None
|
|
229
259
|
|
|
230
|
-
# Case 1: User entered a number from the list
|
|
231
260
|
if choice.isdigit() and 0 < int(choice) <= len(entries_to_display):
|
|
232
261
|
selected_index = int(choice) - 1
|
|
233
262
|
selected_entry = entries_to_display[selected_index]
|
|
234
263
|
|
|
235
|
-
# Case 2: User entered text (could be an App ID)
|
|
236
264
|
elif choice:
|
|
237
|
-
# Find the *first* (most recent) entry in the full history that matches the ID.
|
|
238
|
-
# We use startswith so users can just type the first few characters (e.g., '9a6b').
|
|
239
265
|
selected_entry = next((entry for entry in history if entry['app_id'].lower().startswith(choice)), None)
|
|
240
266
|
|
|
241
|
-
# Now, if we found an entry by either method, proceed with the download
|
|
242
267
|
if selected_entry:
|
|
243
268
|
run_id_to_download = selected_entry.get("run_id")
|
|
244
269
|
|
|
@@ -258,10 +283,45 @@ def status_check():
|
|
|
258
283
|
def download_app():
|
|
259
284
|
download_apk()
|
|
260
285
|
|
|
286
|
+
def show_info():
|
|
287
|
+
print(f"\n{BOLD}▲ AppForge CLI Information{RESET}")
|
|
288
|
+
print("=" * 55)
|
|
289
|
+
|
|
290
|
+
print(f"\n{CYAN}SYSTEM STATUS{RESET}")
|
|
291
|
+
print(f" {GRAY}Current Version:{RESET} v{CLI_VERSION}")
|
|
292
|
+
print(f" {GRAY}Cloud Target:{RESET} Private GitHub Actions Runner")
|
|
293
|
+
print(f" {GRAY}Connection:{RESET} Authenticated & Active")
|
|
294
|
+
print(f"\n{CYAN}UNIVERSAL ARCHITECTURE{RESET}")
|
|
295
|
+
print(f" {GREEN}✔{RESET} {BOLD}Web to Native{RESET} (React, Vite, Next.js, HTML)")
|
|
296
|
+
print(f" {GREEN}✔{RESET} {BOLD}Flutter{RESET} (Full Native Compilation)")
|
|
297
|
+
print(f" {GREEN}✔{RESET} {BOLD}Kotlin/Java{RESET} (Standard Android Studio Projects)")
|
|
298
|
+
print(f" {GREEN}✔{RESET} {BOLD}Monorepo Support{RESET} (Sub-directory execution)")
|
|
299
|
+
|
|
300
|
+
print(f"\n{CYAN}ADVANCED FEATURES{RESET}")
|
|
301
|
+
print(f" {YELLOW}✦{RESET} {BOLD}AI Permission Scanner:{RESET} Automatically detects required")
|
|
302
|
+
print(f" hardware (Camera, GPS, Bluetooth) from source code.")
|
|
303
|
+
print(f" {YELLOW}✦{RESET} {BOLD}Cloud Injector Engine:{RESET} Dynamically writes strict")
|
|
304
|
+
print(f" Android 13+ permissions and Java 8 Desugaring rules.")
|
|
305
|
+
print(f" {YELLOW}✦{RESET} {BOLD}Permanent Keystore:{RESET} Signs Release APKs securely via")
|
|
306
|
+
print(f" cloud secrets to enable seamless OTA updates.")
|
|
307
|
+
print(f" {YELLOW}✦{RESET} {BOLD}Live Telemetry:{RESET} Streams real-time GitHub Actions")
|
|
308
|
+
print(f" build logs directly to your local terminal.")
|
|
309
|
+
|
|
310
|
+
print(f"\n{CYAN}LATEST RELEASE NOTES (v{CLI_VERSION}){RESET}")
|
|
311
|
+
print(" • Added Native App Icon & Splash Screen generation.")
|
|
312
|
+
print(" • Added intelligent 'history' command with live statuses.")
|
|
313
|
+
print(" • Fixed Flutter 'app_plugin_loader' compatibility bugs.")
|
|
314
|
+
print(" • Upgraded to robust Node.js Cloud Injection script.")
|
|
315
|
+
print(" • Added 'create' command for instant project scaffolding.")
|
|
316
|
+
|
|
317
|
+
print("\n" + "=" * 55)
|
|
318
|
+
print(f" {GRAY}Run 'appforge help' to see available commands.{RESET}\n")
|
|
319
|
+
|
|
261
320
|
def show_argu():
|
|
262
321
|
print("Commands:")
|
|
263
322
|
print(" appforge init - Initialize an AppForge project")
|
|
264
323
|
print(" appforge configure - Open interactive settings")
|
|
324
|
+
print(f" {CYAN}info{RESET} - View CLI version and release notes")
|
|
265
325
|
print(f" {CYAN}create <framework> <name>{RESET} Scaffold a new app (vite, flutter, html)")
|
|
266
326
|
print(" appforge build - Package project and send to build repo")
|
|
267
327
|
print(" appforge status - Check build status")
|
|
@@ -273,7 +333,6 @@ def show_help():
|
|
|
273
333
|
"""The animated welcome sequence for the very first run."""
|
|
274
334
|
welcome_message = f"{BOLD}▲ AppForge{RESET} - The Universal App Builder"
|
|
275
335
|
|
|
276
|
-
# Typing animation
|
|
277
336
|
for char in welcome_message:
|
|
278
337
|
sys.stdout.write(char)
|
|
279
338
|
sys.stdout.flush()
|
|
@@ -295,24 +354,17 @@ def main():
|
|
|
295
354
|
|
|
296
355
|
print_header()
|
|
297
356
|
|
|
298
|
-
# --- FIXED ARGPARSE LOGIC ---
|
|
299
357
|
parser = argparse.ArgumentParser(add_help=False)
|
|
300
|
-
# The first word is the command (defaulting to "help")
|
|
301
358
|
parser.add_argument("command", nargs="?", default="help", help="Command to run")
|
|
302
|
-
# All remaining words get bundled into a list called "args"
|
|
303
359
|
parser.add_argument("args", nargs=argparse.REMAINDER, help="Additional arguments")
|
|
304
360
|
|
|
305
|
-
# parse_known_args is safer here than parse_args
|
|
306
361
|
args, unknown = parser.parse_known_args()
|
|
307
362
|
|
|
308
|
-
# If there were extra arguments that slipped past, add them to our list
|
|
309
363
|
if unknown:
|
|
310
364
|
args.args.extend(unknown)
|
|
311
|
-
# ----------------------------
|
|
312
365
|
|
|
313
366
|
try:
|
|
314
367
|
if args.command == "create":
|
|
315
|
-
# Check if they provided the framework and name
|
|
316
368
|
if not args.args or len(args.args) < 2:
|
|
317
369
|
print_error("Usage: appforge create <framework> <project-name>\nExample: appforge create flutter my_new_app")
|
|
318
370
|
|
|
@@ -324,6 +376,7 @@ def main():
|
|
|
324
376
|
elif args.command == "build": build_app()
|
|
325
377
|
elif args.command == "configure": configure_project()
|
|
326
378
|
elif args.command == "history": show_history()
|
|
379
|
+
elif args.command == "info": show_info()
|
|
327
380
|
elif args.command == "status": status_check()
|
|
328
381
|
elif args.command == "download": download_apk()
|
|
329
382
|
else: show_help()
|
|
@@ -4,16 +4,19 @@ import subprocess
|
|
|
4
4
|
import re
|
|
5
5
|
from .utils import print_success, print_info, print_error, prompt, print_progress_bar, CYAN, RESET, BOLD
|
|
6
6
|
|
|
7
|
-
# The TEMPLATES dictionary stays the same
|
|
8
7
|
TEMPLATES = {
|
|
9
8
|
"vite": {
|
|
10
9
|
"cmd": "npm create vite@latest {name} -- --template react-ts",
|
|
11
10
|
"desc": "React + TypeScript + Vite (Fast Web App)"
|
|
12
11
|
},
|
|
13
12
|
"flutter": {
|
|
14
|
-
"cmd": "git clone --progress https://github.com/flutter/samples.git _temp_samples",
|
|
13
|
+
"cmd": "git clone --progress https://github.com/flutter/samples.git _temp_samples && mv _temp_samples/provider_counter {name} && rm -rf _temp_samples",
|
|
15
14
|
"desc": "Official Flutter Starter App (Native)"
|
|
16
15
|
},
|
|
16
|
+
"kotlin": {
|
|
17
|
+
"cmd": "git clone --progress https://github.com/android/architecture-samples.git _temp_kt && mv _temp_kt {name} && rm -rf _temp_kt",
|
|
18
|
+
"desc": "Native Android Kotlin (Jetpack Compose)"
|
|
19
|
+
},
|
|
17
20
|
"html": {
|
|
18
21
|
"cmd": None,
|
|
19
22
|
"desc": "Plain HTML/CSS/JS (Simple Web App)"
|
|
Binary file
|