|
141 | 141 |
|
142 | 142 | # Platform-specific final instructions
|
143 | 143 | if [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then
|
144 |
| - info "Installation complete! You can now use 'open-interpreter' from a new terminal window." |
| 144 | + info "Installation complete! You can now use 'interpreter' from a new terminal window." |
145 | 145 | elif [[ "$OSTYPE" == "darwin"* ]]; then
|
146 |
| - info "Installation complete! You can now use the 'open-interpreter' command." |
147 |
| - info "Make sure $BIN_DIR is in your PATH by adding this to your ~/.zshrc or ~/.bash_profile:" |
148 |
| - info " export PATH=\"\$PATH:$BIN_DIR\"" |
| 146 | + info "Installation complete! You can now use the 'interpreter' command." |
| 147 | + info "Would you like to add $BIN_DIR to your PATH? [y/N] " |
| 148 | + read -r add_to_path |
| 149 | + if [[ "$add_to_path" =~ ^[Yy]$ ]]; then |
| 150 | + if [[ -f "$HOME/.zshrc" ]]; then |
| 151 | + echo "export PATH=\"\$PATH:$BIN_DIR\"" >> "$HOME/.zshrc" |
| 152 | + info "Added to ~/.zshrc. Please restart your terminal or run: source ~/.zshrc" |
| 153 | + elif [[ -f "$HOME/.bash_profile" ]]; then |
| 154 | + echo "export PATH=\"\$PATH:$BIN_DIR\"" >> "$HOME/.bash_profile" |
| 155 | + info "Added to ~/.bash_profile. Please restart your terminal or run: source ~/.bash_profile" |
| 156 | + else |
| 157 | + info "Could not find ~/.zshrc or ~/.bash_profile. Please manually add to your shell's config:" |
| 158 | + info " export PATH=\"\$PATH:$BIN_DIR\"" |
| 159 | + fi |
| 160 | + else |
| 161 | + info "You can manually add $BIN_DIR to your PATH by adding this to ~/.zshrc or ~/.bash_profile:" |
| 162 | + info " export PATH=\"\$PATH:$BIN_DIR\"" |
| 163 | + fi |
149 | 164 | else
|
150 |
| - info "Installation complete! You can now use the 'open-interpreter' command." |
151 |
| - info "Make sure $BIN_DIR is in your PATH." |
| 165 | + info "Installation complete! You can now use the 'interpreter' command." |
| 166 | + info "Would you like to add $BIN_DIR to your PATH? [y/N] " |
| 167 | + read -r add_to_path |
| 168 | + if [[ "$add_to_path" =~ ^[Yy]$ ]]; then |
| 169 | + if [[ -f "$HOME/.bashrc" ]]; then |
| 170 | + echo "export PATH=\"\$PATH:$BIN_DIR\"" >> "$HOME/.bashrc" |
| 171 | + info "Added to ~/.bashrc. Please restart your terminal or run: source ~/.bashrc" |
| 172 | + else |
| 173 | + info "Could not find ~/.bashrc. Please manually add to your shell's config:" |
| 174 | + info " export PATH=\"\$PATH:$BIN_DIR\"" |
| 175 | + fi |
| 176 | + else |
| 177 | + info "You can manually add $BIN_DIR to your PATH by adding this to ~/.bashrc:" |
| 178 | + info " export PATH=\"\$PATH:$BIN_DIR\"" |
| 179 | + fi |
| 180 | +fi |
| 181 | + |
| 182 | +# Offer shell integration |
| 183 | +info "Would you like to install shell integration? This allows you to use Open Interpreter directly from your shell - if you type an unrecognized command, it will be passed to Open Interpreter with context about your recent shell history. [y/N] " |
| 184 | +read -r install_shell_integration |
| 185 | +if [[ "$install_shell_integration" =~ ^[Yy]$ ]]; then |
| 186 | + if command_exists interpreter-shell; then |
| 187 | + interpreter-shell |
| 188 | + info "Shell integration installed successfully! Restart your shell to activate it." |
| 189 | + else |
| 190 | + error "Could not find interpreter-shell command. Please ensure Open Interpreter was installed correctly." |
| 191 | + fi |
152 | 192 | fi
|
0 commit comments