codegpt-ai 2.28.0 → 2.31.0
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.
- package/chat.py +39 -0
- package/package.json +1 -1
- package/tui.py +55 -1
package/chat.py
CHANGED
|
@@ -439,6 +439,7 @@ COMMANDS = {
|
|
|
439
439
|
"/security": "Security status dashboard",
|
|
440
440
|
"/permissions": "View/reset action permissions",
|
|
441
441
|
"/desktop": "Launch CodeGPT desktop app",
|
|
442
|
+
"/tui": "Launch CodeGPT TUI mode",
|
|
442
443
|
"/skill": "Create a custom command (/skill name prompt)",
|
|
443
444
|
"/skills": "List custom skills",
|
|
444
445
|
"/browse": "Browse a URL and summarize (/browse url)",
|
|
@@ -7259,6 +7260,44 @@ def main():
|
|
|
7259
7260
|
print_sys("Desktop app opened in a new window.")
|
|
7260
7261
|
continue
|
|
7261
7262
|
|
|
7263
|
+
elif cmd == "/tui":
|
|
7264
|
+
# TUI is for Termux/mobile only — PC uses /desktop or full CLI
|
|
7265
|
+
if not os.path.exists("/data/data/com.termux"):
|
|
7266
|
+
console.print()
|
|
7267
|
+
console.print(Text.from_markup(" [yellow]⚠ /tui is for Termux (Android) only[/]"))
|
|
7268
|
+
console.print()
|
|
7269
|
+
console.print(Text.from_markup(" [dim]Why:[/] TUI mode is a lightweight version for mobile terminals."))
|
|
7270
|
+
console.print(Text.from_markup(" [dim]On PC you already have the full CLI with 123 commands.[/]"))
|
|
7271
|
+
console.print()
|
|
7272
|
+
console.print(Text.from_markup(" [bold]Use instead:[/]"))
|
|
7273
|
+
console.print(Text.from_markup(" [bright_blue]/desktop[/] — open the desktop GUI app"))
|
|
7274
|
+
console.print(Text.from_markup(" [bright_blue]/help[/] — see all 123 commands"))
|
|
7275
|
+
console.print()
|
|
7276
|
+
continue
|
|
7277
|
+
|
|
7278
|
+
tui_paths = [
|
|
7279
|
+
os.path.join(str(Path(__file__).parent), "tui.py"),
|
|
7280
|
+
os.path.join(str(Path.home()), "codegpt", "tui.py"),
|
|
7281
|
+
]
|
|
7282
|
+
tui_py = None
|
|
7283
|
+
for tp in tui_paths:
|
|
7284
|
+
if os.path.isfile(tp):
|
|
7285
|
+
tui_py = tp
|
|
7286
|
+
break
|
|
7287
|
+
if not tui_py:
|
|
7288
|
+
try:
|
|
7289
|
+
tui_py = os.path.join(str(Path.home()), ".codegpt", "tui.py")
|
|
7290
|
+
r = requests.get("https://raw.githubusercontent.com/CCguvycu/codegpt/master/tui.py", timeout=15)
|
|
7291
|
+
Path(tui_py).parent.mkdir(parents=True, exist_ok=True)
|
|
7292
|
+
Path(tui_py).write_text(r.text, encoding="utf-8")
|
|
7293
|
+
except Exception:
|
|
7294
|
+
print_err("Cannot download TUI.")
|
|
7295
|
+
continue
|
|
7296
|
+
print_sys("Launching TUI mode...")
|
|
7297
|
+
subprocess.run([sys.executable, tui_py])
|
|
7298
|
+
print_header(model)
|
|
7299
|
+
continue
|
|
7300
|
+
|
|
7262
7301
|
elif cmd == "/permissions":
|
|
7263
7302
|
sub = user_input[len("/permissions "):].strip().lower()
|
|
7264
7303
|
if sub == "reset":
|
package/package.json
CHANGED
package/tui.py
CHANGED
|
@@ -661,8 +661,62 @@ def handle_command(text):
|
|
|
661
661
|
console.print(Text.from_markup(f" [bright_blue]{c:<14}[/] [dim]{desc}[/]"))
|
|
662
662
|
console.print()
|
|
663
663
|
|
|
664
|
+
# Command exists in autocomplete but not handled in TUI
|
|
665
|
+
elif cmd[1:] and any(cmd == c for c in TUI_COMMANDS):
|
|
666
|
+
cli_only = {
|
|
667
|
+
"/vote": "Runs all agents to vote — needs full agent system",
|
|
668
|
+
"/swarm": "6-agent pipeline — needs full agent system",
|
|
669
|
+
"/team": "Group chat with 2 AIs — needs team chat engine",
|
|
670
|
+
"/room": "Chat room with 3+ AIs — needs room engine",
|
|
671
|
+
"/spectate": "Watch AIs debate — needs spectate engine",
|
|
672
|
+
"/dm": "Direct message agent — needs message bus",
|
|
673
|
+
"/race": "Race all models — needs multi-model runner",
|
|
674
|
+
"/compare": "Compare 2 models — needs compare engine",
|
|
675
|
+
"/chain": "Chain prompts — needs chain engine",
|
|
676
|
+
"/lab": "AI Lab experiments — needs lab module",
|
|
677
|
+
"/train": "AI Training Lab — needs training system",
|
|
678
|
+
"/mem": "AI memory — needs memory system",
|
|
679
|
+
"/skill": "Create custom command — needs skill system",
|
|
680
|
+
"/skills": "List custom skills — needs skill system",
|
|
681
|
+
"/auto": "AI creates a skill — needs skill + AI system",
|
|
682
|
+
"/cron": "Schedule tasks — needs cron system",
|
|
683
|
+
"/tools": "AI tool integrations — needs tool launcher",
|
|
684
|
+
"/github": "GitHub tools — needs gh CLI integration",
|
|
685
|
+
"/spotify": "Spotify controls — needs media key system",
|
|
686
|
+
"/volume": "System volume — needs OS integration",
|
|
687
|
+
"/sysinfo": "System info — needs OS queries",
|
|
688
|
+
"/security": "Security dashboard — needs security module",
|
|
689
|
+
"/permissions": "Permissions — needs permission system",
|
|
690
|
+
"/audit": "Audit log — needs security module",
|
|
691
|
+
"/pin-set": "Set PIN — needs PIN system",
|
|
692
|
+
"/lock": "Lock session — needs PIN system",
|
|
693
|
+
"/qr": "QR code — needs qrcode library",
|
|
694
|
+
"/broadcast": "Message all tools — needs message bus",
|
|
695
|
+
"/inbox": "Check messages — needs message bus",
|
|
696
|
+
"/feed": "Message feed — needs message bus",
|
|
697
|
+
"/monitor": "Live dashboard — needs monitor system",
|
|
698
|
+
"/hub": "Command center — needs hub system",
|
|
699
|
+
"/shortcuts": "Keyboard shortcuts — needs shortcut system",
|
|
700
|
+
"/prompts": "Prompt templates — needs template library",
|
|
701
|
+
"/desktop": "Desktop app — needs GUI (pywebview)",
|
|
702
|
+
"/tui": "Already in TUI mode",
|
|
703
|
+
"/search": "Search conversation — needs search engine",
|
|
704
|
+
"/diff": "Compare responses — needs diff engine",
|
|
705
|
+
"/pin": "Pin message — needs pin system",
|
|
706
|
+
"/pins": "Show pins — needs pin system",
|
|
707
|
+
"/fork": "Fork conversation — needs fork system",
|
|
708
|
+
"/compact": "Compact conversation — needs compact system",
|
|
709
|
+
"/setname": "Set name — needs profile system",
|
|
710
|
+
"/setbio": "Set bio — needs profile system",
|
|
711
|
+
}
|
|
712
|
+
reason = cli_only.get(cmd, "This command needs the full CLI")
|
|
713
|
+
console.print()
|
|
714
|
+
console.print(Text.from_markup(f" [yellow]⚠ {cmd}[/] — [dim]TUI mode only[/]"))
|
|
715
|
+
console.print(Text.from_markup(f" [dim]{reason}[/]"))
|
|
716
|
+
console.print(Text.from_markup(f" [bright_blue]Run the full CLI:[/] [dim]python chat.py[/]"))
|
|
717
|
+
console.print()
|
|
664
718
|
else:
|
|
665
|
-
return None #
|
|
719
|
+
return None # Unknown command
|
|
666
720
|
|
|
667
721
|
return True
|
|
668
722
|
|