codegpt-ai 1.0.0 → 1.2.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/build.ps1 DELETED
@@ -1,22 +0,0 @@
1
- # Build ai.exe locally
2
- # Run: powershell -File build.ps1
3
-
4
- $ErrorActionPreference = "Stop"
5
-
6
- Write-Host "Building CodeGPT -> ai.exe" -ForegroundColor Cyan
7
-
8
- # Install build deps
9
- pip install pyinstaller requests rich prompt-toolkit
10
-
11
- # Build
12
- pyinstaller ai.spec --noconfirm
13
-
14
- # Verify
15
- if (Test-Path "dist\ai.exe") {
16
- $size = [math]::Round((Get-Item "dist\ai.exe").Length / 1MB, 1)
17
- Write-Host "Build complete: dist\ai.exe ($size MB)" -ForegroundColor Green
18
- & dist\ai.exe --version
19
- } else {
20
- Write-Host "Build failed!" -ForegroundColor Red
21
- exit 1
22
- }
@@ -1,11 +0,0 @@
1
- # Codex Instructions
2
-
3
- You are working on **CodeGPT** — a local AI assistant hub built in Python. See CLAUDE.md for full project context.
4
-
5
- Main file is `chat.py` (~3500 lines). Be careful with edits — it has 60+ commands wired together.
6
-
7
- When making changes:
8
- - Read the existing code first
9
- - Don't break the command routing (elif chain in main loop)
10
- - Keep Rich formatting consistent
11
- - Test with: `python chat.py`
package/install-termux.sh DELETED
@@ -1,158 +0,0 @@
1
- #!/data/data/com.termux/files/usr/bin/bash
2
- # CodeGPT Installer for Termux
3
- # Run: curl -sL https://raw.githubusercontent.com/CCguvycu/codegpt/main/install-termux.sh | bash
4
-
5
- set -e
6
-
7
- echo ""
8
- echo " ╔══════════════════════════════════════╗"
9
- echo " ║ CodeGPT — Termux Installer ║"
10
- echo " ╚══════════════════════════════════════╝"
11
- echo ""
12
-
13
- # Step 1: Install system deps
14
- echo " [1/6] Installing system packages..."
15
- pkg update -y -q 2>/dev/null
16
- pkg install -y python git cmake golang curl 2>/dev/null
17
-
18
- pip install --quiet requests rich prompt-toolkit 2>/dev/null
19
-
20
- # Step 2: Install Ollama
21
- echo " [2/6] Installing Ollama..."
22
- if command -v ollama &>/dev/null; then
23
- echo " Ollama already installed."
24
- else
25
- echo " Building Ollama from source (this takes a few minutes)..."
26
-
27
- # Method 1: Try the official install script
28
- curl -fsSL https://ollama.com/install.sh | sh 2>/dev/null && {
29
- echo " Ollama installed via official script."
30
- } || {
31
- # Method 2: Build from Go source
32
- echo " Official script failed. Building from Go..."
33
- pkg install -y golang 2>/dev/null
34
-
35
- OLLAMA_BUILD="$HOME/.ollama-build"
36
- rm -rf "$OLLAMA_BUILD"
37
- git clone --depth 1 https://github.com/ollama/ollama.git "$OLLAMA_BUILD" 2>/dev/null
38
-
39
- cd "$OLLAMA_BUILD"
40
- go build -o "$PREFIX/bin/ollama" . 2>/dev/null && {
41
- echo " Ollama built from source."
42
- } || {
43
- # Method 3: Download pre-built ARM binary
44
- echo " Go build failed. Trying pre-built binary..."
45
- ARCH=$(uname -m)
46
- if [ "$ARCH" = "aarch64" ]; then
47
- curl -sL "https://github.com/ollama/ollama/releases/latest/download/ollama-linux-arm64" -o "$PREFIX/bin/ollama" 2>/dev/null && {
48
- chmod +x "$PREFIX/bin/ollama"
49
- echo " Ollama binary downloaded."
50
- } || {
51
- echo " WARNING: Could not install Ollama."
52
- echo " You can connect to your PC's Ollama instead."
53
- }
54
- else
55
- echo " WARNING: Unsupported arch ($ARCH). Connect to PC Ollama."
56
- fi
57
- }
58
-
59
- rm -rf "$OLLAMA_BUILD"
60
- cd "$HOME"
61
- }
62
- fi
63
-
64
- # Step 3: Start Ollama and pull model
65
- echo " [3/6] Setting up Ollama..."
66
- if command -v ollama &>/dev/null; then
67
- # Start Ollama in background
68
- if ! curl -s http://localhost:11434/api/tags &>/dev/null 2>&1; then
69
- echo " Starting Ollama server..."
70
- ollama serve &>/dev/null &
71
- sleep 5
72
- fi
73
-
74
- # Pull smallest model if none exist
75
- if ! ollama list 2>/dev/null | grep -q ":"; then
76
- echo " Pulling llama3.2:1b (smallest model, ~1.3GB)..."
77
- echo " This may take a few minutes on mobile data."
78
- ollama pull llama3.2:1b 2>/dev/null && {
79
- echo " Model ready."
80
- } || {
81
- echo " WARNING: Model pull failed. Try manually: ollama pull llama3.2:1b"
82
- }
83
- else
84
- echo " Models already available."
85
- fi
86
-
87
- # Auto-start Ollama on Termux boot
88
- mkdir -p "$HOME/.termux/boot"
89
- echo '#!/data/data/com.termux/files/usr/bin/bash' > "$HOME/.termux/boot/ollama.sh"
90
- echo 'ollama serve &>/dev/null &' >> "$HOME/.termux/boot/ollama.sh"
91
- chmod +x "$HOME/.termux/boot/ollama.sh"
92
- echo " Ollama auto-start enabled."
93
- else
94
- echo " Ollama not available. You can connect to your PC:"
95
- echo " When ai asks, enter: http://YOUR_PC_IP:11434/api/chat"
96
- fi
97
-
98
- # Step 4: Clone or update CodeGPT
99
- INSTALL_DIR="$HOME/codegpt"
100
- echo " [4/6] Setting up CodeGPT..."
101
-
102
- if [ -d "$INSTALL_DIR/.git" ]; then
103
- cd "$INSTALL_DIR"
104
- git pull --quiet 2>/dev/null || true
105
- else
106
- rm -rf "$INSTALL_DIR"
107
- git clone https://github.com/CCguvycu/codegpt.git "$INSTALL_DIR" 2>/dev/null
108
- fi
109
-
110
- # Step 5: Install ai command
111
- echo " [5/6] Installing ai command..."
112
- cd "$INSTALL_DIR"
113
- pip install -e . --quiet 2>/dev/null || {
114
- # Fallback: create wrapper script
115
- cat > "$PREFIX/bin/ai" << 'WRAPPER'
116
- #!/data/data/com.termux/files/usr/bin/bash
117
- cd ~/codegpt && python -m ai_cli "$@"
118
- WRAPPER
119
- chmod +x "$PREFIX/bin/ai"
120
- }
121
-
122
- # Step 6: Create shortcuts
123
- echo " [6/6] Creating shortcuts..."
124
- mkdir -p "$HOME/.shortcuts"
125
- cat > "$HOME/.shortcuts/CodeGPT" << 'SHORTCUT'
126
- #!/data/data/com.termux/files/usr/bin/bash
127
- # Start Ollama if not running
128
- command -v ollama &>/dev/null && ! curl -s http://localhost:11434/api/tags &>/dev/null 2>&1 && ollama serve &>/dev/null &
129
- sleep 1
130
- ai
131
- SHORTCUT
132
- chmod +x "$HOME/.shortcuts/CodeGPT"
133
-
134
- # Also add alias to bashrc
135
- if ! grep -q "alias ai=" "$HOME/.bashrc" 2>/dev/null; then
136
- echo '# CodeGPT' >> "$HOME/.bashrc"
137
- echo 'command -v ollama &>/dev/null && ! curl -s http://localhost:11434/api/tags &>/dev/null 2>&1 && ollama serve &>/dev/null &' >> "$HOME/.bashrc"
138
- echo "" >> "$HOME/.bashrc"
139
- fi
140
-
141
- echo ""
142
- echo " ╔══════════════════════════════════════╗"
143
- echo " ║ Installation complete! ║"
144
- echo " ║ ║"
145
- echo " ║ Type: ai ║"
146
- echo " ║ ║"
147
- if command -v ollama &>/dev/null; then
148
- echo " ║ Ollama: installed ║"
149
- echo " ║ Model: llama3.2:1b ║"
150
- else
151
- echo " ║ Ollama: not available ║"
152
- echo " ║ Connect to PC when prompted ║"
153
- fi
154
- echo " ║ ║"
155
- echo " ║ Termux Widget shortcut created ║"
156
- echo " ║ Ollama auto-starts on boot ║"
157
- echo " ╚══════════════════════════════════════╝"
158
- echo ""
package/install.ps1 DELETED
@@ -1,89 +0,0 @@
1
- # CodeGPT Installer — run with: irm https://raw.githubusercontent.com/ArukuX/codegpt/main/install.ps1 | iex
2
- # Installs ai.exe to %LOCALAPPDATA%\codegpt\ and adds to PATH
3
-
4
- $ErrorActionPreference = "Stop"
5
-
6
- $repo = "ArukuX/codegpt"
7
- $installDir = "$env:LOCALAPPDATA\codegpt"
8
- $exeName = "ai.exe"
9
- $exePath = "$installDir\$exeName"
10
-
11
- Write-Host ""
12
- Write-Host " ╔══════════════════════════════════════╗" -ForegroundColor Cyan
13
- Write-Host " ║ CodeGPT Installer ║" -ForegroundColor Cyan
14
- Write-Host " ╚══════════════════════════════════════╝" -ForegroundColor Cyan
15
- Write-Host ""
16
-
17
- # Step 1: Get latest release
18
- Write-Host " [1/4] Fetching latest release..." -ForegroundColor Yellow
19
- try {
20
- $release = Invoke-RestMethod -Uri "https://api.github.com/repos/$repo/releases/latest" -Headers @{ "User-Agent" = "CodeGPT-Installer" }
21
- $version = $release.tag_name
22
- $asset = $release.assets | Where-Object { $_.name -eq $exeName } | Select-Object -First 1
23
-
24
- if (-not $asset) {
25
- Write-Host " ERROR: No ai.exe found in release $version" -ForegroundColor Red
26
- exit 1
27
- }
28
-
29
- Write-Host " Found version $version" -ForegroundColor Green
30
- } catch {
31
- Write-Host " ERROR: Cannot reach GitHub. Check internet." -ForegroundColor Red
32
- exit 1
33
- }
34
-
35
- # Step 2: Download
36
- Write-Host " [2/4] Downloading ai.exe..." -ForegroundColor Yellow
37
- New-Item -ItemType Directory -Force -Path $installDir | Out-Null
38
-
39
- try {
40
- $downloadUrl = $asset.browser_download_url
41
- Invoke-WebRequest -Uri $downloadUrl -OutFile $exePath -UseBasicParsing
42
- Write-Host " Downloaded to $exePath" -ForegroundColor Green
43
- } catch {
44
- Write-Host " ERROR: Download failed: $_" -ForegroundColor Red
45
- exit 1
46
- }
47
-
48
- # Step 3: Add to PATH
49
- Write-Host " [3/4] Adding to PATH..." -ForegroundColor Yellow
50
- $userPath = [Environment]::GetEnvironmentVariable("Path", "User")
51
-
52
- if ($userPath -notlike "*$installDir*") {
53
- [Environment]::SetEnvironmentVariable("Path", "$userPath;$installDir", "User")
54
- $env:Path = "$env:Path;$installDir"
55
- Write-Host " Added $installDir to user PATH" -ForegroundColor Green
56
- } else {
57
- Write-Host " Already in PATH" -ForegroundColor Green
58
- }
59
-
60
- # Step 4: Verify
61
- Write-Host " [4/4] Verifying..." -ForegroundColor Yellow
62
- try {
63
- $ver = & $exePath --version 2>&1
64
- Write-Host " Installed: $ver" -ForegroundColor Green
65
- } catch {
66
- Write-Host " WARNING: Verify failed, but binary is installed" -ForegroundColor Yellow
67
- }
68
-
69
- # Check Ollama
70
- Write-Host ""
71
- if (Get-Command "ollama" -ErrorAction SilentlyContinue) {
72
- Write-Host " Ollama: found" -ForegroundColor Green
73
- } else {
74
- Write-Host " Ollama: not found — install from https://ollama.com" -ForegroundColor Yellow
75
- Write-Host " Then run: ollama pull llama3.2" -ForegroundColor Yellow
76
- }
77
-
78
- Write-Host ""
79
- Write-Host " ╔══════════════════════════════════════╗" -ForegroundColor Green
80
- Write-Host " ║ Installation complete! ║" -ForegroundColor Green
81
- Write-Host " ║ ║" -ForegroundColor Green
82
- Write-Host " ║ Open a new terminal and type: ai ║" -ForegroundColor Green
83
- Write-Host " ║ ║" -ForegroundColor Green
84
- Write-Host " ║ Commands: ║" -ForegroundColor Green
85
- Write-Host " ║ ai — start chat ║" -ForegroundColor Green
86
- Write-Host " ║ ai update — update to latest ║" -ForegroundColor Green
87
- Write-Host " ║ ai doctor — check dependencies ║" -ForegroundColor Green
88
- Write-Host " ╚══════════════════════════════════════╝" -ForegroundColor Green
89
- Write-Host ""