├── README.md └── linux ├── linux_install.sh └── linux_uninstall.sh /README.md: -------------------------------------------------------------------------------- 1 | # binaries 2 | -------------------------------------------------------------------------------- /linux/linux_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Define variables 6 | PKGNAME="aide" 7 | PKGDIR="/opt/${PKGNAME}" 8 | ARCH=$(uname -m) 9 | 10 | # Function to fetch the latest release information from Aide Updates API 11 | fetch_latest_version() { 12 | echo "Fetching the latest Aide release information..." 13 | release_info=$(curl -s https://aide-updates.codestory.ai/api/all/stable) 14 | 15 | # Extract URLs based on architecture 16 | case "$ARCH" in 17 | x86_64) 18 | BIN_URL=$(echo "$release_info" | sed -n 's/.*"linux_x64":"\([^"]*\)".*/\1/p') 19 | ;; 20 | aarch64) 21 | BIN_URL=$(echo "$release_info" | sed -n 's/.*"linux_arm64":"\([^"]*\)".*/\1/p') 22 | ;; 23 | *) 24 | echo "Unsupported architecture: $ARCH" 25 | exit 1 26 | ;; 27 | esac 28 | 29 | if [[ -z "$BIN_URL" ]]; then 30 | echo "Error: Unable to fetch the download URL for your architecture." 31 | exit 1 32 | fi 33 | 34 | # Extract version from the URL 35 | PKGVER=$(echo "$BIN_URL" | sed -n 's|.*/\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)/.*|\1|p') 36 | if [[ -z "$PKGVER" ]]; then 37 | echo "Error: Unable to extract version information." 38 | exit 1 39 | fi 40 | echo "Latest version: $PKGVER" 41 | } 42 | 43 | # Check for and install required dependencies 44 | check_dependencies() { 45 | echo "Checking for required dependencies..." 46 | 47 | dependencies=( 48 | "fontconfig" 49 | "libxtst" 50 | "gtk3" 51 | "python3" 52 | "cairo" 53 | "alsa-lib" 54 | "nss" 55 | "gcc" 56 | "libnotify" 57 | "libxss" 58 | "glibc" 59 | "bash" 60 | ) 61 | 62 | missing_dependencies=() 63 | 64 | # Check each dependency with more targeted checks 65 | for dep in "${dependencies[@]}"; do 66 | case $dep in 67 | "glibc") 68 | # Check if `ldd` is available (often provided by glibc) 69 | if ! command -v ldd &>/dev/null; then 70 | missing_dependencies+=("$dep") 71 | fi 72 | ;; 73 | "python3") 74 | # Check if `python3` command exists 75 | if ! command -v python3 &>/dev/null; then 76 | missing_dependencies+=("$dep") 77 | fi 78 | ;; 79 | "gcc") 80 | # Check if `gcc` is available 81 | if ! command -v gcc &>/dev/null; then 82 | missing_dependencies+=("$dep") 83 | fi 84 | ;; 85 | "bash") 86 | # Check if `bash` is available 87 | if ! command -v bash &>/dev/null; then 88 | missing_dependencies+=("$dep") 89 | fi 90 | ;; 91 | *) 92 | # General check for libraries (e.g., fontconfig, libxtst) 93 | if ! ldconfig -p | grep -q "$dep"; then 94 | missing_dependencies+=("$dep") 95 | fi 96 | ;; 97 | esac 98 | done 99 | 100 | # Report results 101 | if [ ${#missing_dependencies[@]} -eq 0 ]; then 102 | echo "All dependencies are satisfied. You're good to go!" 103 | else 104 | echo "The following dependencies are missing:" 105 | for dep in "${missing_dependencies[@]}"; do 106 | echo " - $dep" 107 | done 108 | echo "" 109 | echo "Please install the missing dependencies and try again." 110 | echo "Note: Package names may differ across distributions, so you may need to look up the exact names for your system." 111 | exit 1 112 | fi 113 | } 114 | 115 | # Download and extract Aide 116 | install_aide() { 117 | echo "Downloading Aide..." 118 | sudo mkdir -p "${PKGDIR}" 119 | sudo mkdir -p /usr/bin /usr/share/applications /usr/share/pixmaps 120 | curl -L "$BIN_URL" | sudo tar -xz -C "${PKGDIR}" --strip-components=1 121 | } 122 | 123 | # Create the aide launch script 124 | create_launch_script() { 125 | sudo tee /usr/bin/aide > /dev/null << 'EOF' 126 | #!/bin/bash 127 | XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config} 128 | 129 | if [[ -f $XDG_CONFIG_HOME/aide-flags.conf ]]; then 130 | readarray -t lines <"$XDG_CONFIG_HOME/aide-flags.conf" 131 | for line in "${lines[@]}"; do 132 | if ! [[ "$line" =~ ^[[:space:]]*# ]]; then 133 | CODE_USER_FLAGS+=($line) 134 | fi 135 | done 136 | fi 137 | 138 | exec /opt/aide/bin/aide "$@" "${CODE_USER_FLAGS[@]}" 139 | EOF 140 | sudo chmod +x /usr/bin/aide 141 | } 142 | 143 | # Install the icon 144 | install_icon() { 145 | sudo install -Dm644 "${PKGDIR}/resources/app/resources/linux/code.png" /usr/share/pixmaps/aide.png 146 | } 147 | 148 | # Create desktop entries 149 | create_desktop_entries() { 150 | sudo tee /usr/share/applications/aide.desktop > /dev/null << 'EOF' 151 | [Desktop Entry] 152 | Name=Aide 153 | Comment=The Open-Source AI-native IDE. 154 | GenericName=Text Editor 155 | Exec=/usr/bin/aide %F 156 | Icon=aide 157 | Type=Application 158 | StartupNotify=false 159 | StartupWMClass=Aide 160 | Categories=Utility;Development;IDE; 161 | MimeType=text/plain;inode/directory; 162 | Actions=new-empty-window; 163 | Keywords=vscode;aide; 164 | 165 | [Desktop Action new-empty-window] 166 | Name=New Empty Window 167 | Exec=/usr/bin/aide --new-window %F 168 | Icon=aide 169 | EOF 170 | 171 | sudo tee /usr/share/applications/aide-wayland.desktop > /dev/null << 'EOF' 172 | [Desktop Entry] 173 | Name=Aide - Wayland 174 | Comment=The Open-Source AI-native IDE. 175 | GenericName=Text Editor 176 | Exec=/usr/bin/aide --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland %F 177 | Icon=aide 178 | Type=Application 179 | StartupNotify=false 180 | StartupWMClass=aide-url-handler 181 | Categories=Utility;Development;IDE; 182 | MimeType=text/plain;inode/directory; 183 | Actions=new-empty-window; 184 | Keywords=vscode;aide; 185 | 186 | [Desktop Action new-empty-window] 187 | Name=New Empty Window 188 | Exec=/usr/bin/aide --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland --new-window %F 189 | Icon=aide 190 | EOF 191 | 192 | sudo tee /usr/share/applications/aide-url-handler.desktop > /dev/null << 'EOF' 193 | [Desktop Entry] 194 | Name=Aide - URL Handler 195 | Comment=The Open-Source AI-native IDE. 196 | GenericName=Text Editor 197 | Exec=/usr/bin/aide --open-url %U 198 | Icon=aide 199 | Type=Application 200 | NoDisplay=true 201 | StartupNotify=false 202 | Categories=Utility;TextEditor;Development;IDE; 203 | MimeType=x-scheme-handler/aide; 204 | Keywords=vscode;aide; 205 | EOF 206 | 207 | xdg-mime default aide-url-handler.desktop x-scheme-handler/aide 208 | } 209 | 210 | # Set permissions for chrome-sandbox and the sidecar binary 211 | set_permissions() { 212 | sudo chown root "${PKGDIR}/chrome-sandbox" 213 | sudo chmod 4755 "${PKGDIR}/chrome-sandbox" 214 | sudo chmod 755 "${PKGDIR}/resources/app/extensions/codestory/sidecar_bin/target/release/webserver" 215 | } 216 | 217 | # Set up shell completions 218 | setup_completions() { 219 | sudo mkdir -p /usr/share/zsh/site-functions /usr/share/bash-completion/completions 220 | sudo ln -sf "${PKGDIR}/resources/completions/zsh/_aide" /usr/share/zsh/site-functions/_aide 221 | sudo ln -sf "${PKGDIR}/resources/completions/bash/aide" /usr/share/bash-completion/completions/aide 222 | } 223 | 224 | # Main installation sequence 225 | main() { 226 | fetch_latest_version 227 | # check_dependencies 228 | install_aide 229 | create_launch_script 230 | install_icon 231 | create_desktop_entries 232 | set_permissions 233 | setup_completions 234 | 235 | echo "Aide installation complete." 236 | echo "Custom flags can be added to ~/.config/aide-flags.conf" 237 | } 238 | 239 | # Run the main function 240 | main 241 | -------------------------------------------------------------------------------- /linux/linux_uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Define variables 6 | PKGNAME="aide" 7 | PKGDIR="/opt/${PKGNAME}" 8 | 9 | # Remove Aide files and directories 10 | remove_aide_files() { 11 | echo "Removing Aide files..." 12 | sudo rm -rf "${PKGDIR}" 13 | } 14 | 15 | # Remove the launch script 16 | remove_launch_script() { 17 | echo "Removing the launch script..." 18 | sudo rm -f /usr/bin/aide 19 | } 20 | 21 | # Remove the application icon 22 | remove_icon() { 23 | echo "Removing the application icon..." 24 | sudo rm -f /usr/share/pixmaps/aide.png 25 | } 26 | 27 | # Remove the desktop entries 28 | remove_desktop_entries() { 29 | echo "Removing desktop entries..." 30 | sudo rm -f /usr/share/applications/aide.desktop 31 | sudo rm -f /usr/share/applications/aide-wayland.desktop 32 | sudo rm -f /usr/share/applications/aide-url-handler.desktop 33 | } 34 | 35 | # Remove the chrome-sandbox permissions 36 | remove_permissions() { 37 | echo "Removing chrome-sandbox permissions..." 38 | sudo rm -f "${PKGDIR}/chrome-sandbox" 39 | } 40 | 41 | # Remove shell completions 42 | remove_completions() { 43 | echo "Removing shell completions..." 44 | sudo rm -f /usr/share/zsh/site-functions/_aide 45 | sudo rm -f /usr/share/bash-completion/completions/aide 46 | } 47 | 48 | # Main uninstallation sequence 49 | main() { 50 | remove_aide_files 51 | remove_launch_script 52 | remove_icon 53 | remove_desktop_entries 54 | remove_permissions 55 | remove_completions 56 | 57 | echo "Aide uninstallation complete." 58 | echo "The dependencies were not removed." 59 | } 60 | 61 | # Run the main function 62 | main 63 | --------------------------------------------------------------------------------