| 1 | %define debug_package %{nil} |
| 2 | |
| 3 | Name: parrot |
| 4 | Version: 1.7.2 |
| 5 | Release: 1%{?dist} |
| 6 | Summary: Intelligent roasts of failed commands |
| 7 | |
| 8 | License: MIT |
| 9 | URL: https://github.com/tenseleyFlow/parrot |
| 10 | Source0: %{name}-%{version}.tar.gz |
| 11 | |
| 12 | BuildArch: x86_64 |
| 13 | BuildRequires: golang >= 1.21 |
| 14 | BuildRequires: make |
| 15 | Requires: bash |
| 16 | Suggests: ollama |
| 17 | Suggests: curl |
| 18 | |
| 19 | %description |
| 20 | Parrot is an intelligent CLI assistant that listens for failed command executions |
| 21 | and provides witty, AI-powered responses with helpful suggestions. It supports |
| 22 | multiple backend modes including API integration (OpenAI-compatible), local |
| 23 | LLM models via Ollama, and fallback responses for guaranteed functionality. |
| 24 | |
| 25 | Features: |
| 26 | - Multi-backend architecture (API → Local → Fallback) |
| 27 | - Three personality levels (mild, sarcastic, savage) |
| 28 | - Shell integration for bash, zsh, and fish |
| 29 | - Interactive configuration wizard |
| 30 | - Comprehensive setup automation |
| 31 | - Terminal color theming |
| 32 | - Zero external dependencies required for basic operation |
| 33 | |
| 34 | %prep |
| 35 | %autosetup |
| 36 | |
| 37 | %build |
| 38 | # Build Go binary with release optimizations |
| 39 | go mod download |
| 40 | go build -ldflags="-w -s" -o parrot . |
| 41 | |
| 42 | %install |
| 43 | # Install main binary |
| 44 | install -d %{buildroot}%{_bindir} |
| 45 | install -m 755 parrot %{buildroot}%{_bindir}/parrot |
| 46 | |
| 47 | # Install shell integration hooks |
| 48 | install -d %{buildroot}%{_datadir}/%{name} |
| 49 | install -m 644 parrot-hook.sh %{buildroot}%{_datadir}/%{name}/parrot-hook.sh |
| 50 | install -m 644 parrot-hook.fish %{buildroot}%{_datadir}/%{name}/parrot-hook.fish |
| 51 | |
| 52 | # Install configuration templates |
| 53 | install -d %{buildroot}%{_sysconfdir}/%{name} |
| 54 | install -m 644 config/parrot.toml.example %{buildroot}%{_sysconfdir}/%{name}/parrot.toml.example |
| 55 | |
| 56 | # Install documentation |
| 57 | install -d %{buildroot}%{_docdir}/%{name} |
| 58 | [ -f README.md ] && install -m 644 README.md %{buildroot}%{_docdir}/%{name}/ || true |
| 59 | [ -f INSTALLATION_FLOWS.md ] && install -m 644 INSTALLATION_FLOWS.md %{buildroot}%{_docdir}/%{name}/ || true |
| 60 | |
| 61 | %post |
| 62 | # Post-install automatic setup |
| 63 | echo "🦜 Parrot has been installed successfully!" |
| 64 | echo "" |
| 65 | |
| 66 | # Check if Ollama is available for automatic setup |
| 67 | if command -v ollama >/dev/null 2>&1; then |
| 68 | echo "🤖 Ollama detected - setting up local AI backend..." |
| 69 | |
| 70 | # Pull the model in background if not already present |
| 71 | if ! ollama list | grep -q "llama3.2:3b"; then |
| 72 | echo "📥 Downloading AI model (this may take a few minutes)..." |
| 73 | echo " You can continue using your terminal - parrot will work when ready" |
| 74 | (ollama pull llama3.2:3b >/dev/null 2>&1 && echo "✅ AI model ready!" || echo "❌ Model download failed") & |
| 75 | else |
| 76 | echo "✅ AI model already available" |
| 77 | fi |
| 78 | echo "" |
| 79 | else |
| 80 | echo "🔄 Using built-in responses (no setup required)" |
| 81 | echo "" |
| 82 | echo "For AI-powered responses, install Ollama:" |
| 83 | echo " https://ollama.com/download" |
| 84 | echo "" |
| 85 | fi |
| 86 | |
| 87 | echo "🚀 NEXT STEP: Run this command to enable shell integration:" |
| 88 | echo " parrot install" |
| 89 | echo "" |
| 90 | echo "💡 This adds smart command failure detection to your shell" |
| 91 | echo " After running it, failed commands will trigger helpful responses!" |
| 92 | echo "" |
| 93 | echo "📖 For more options, run: parrot --help" |
| 94 | |
| 95 | %preun |
| 96 | # Clean up shell integrations on uninstall |
| 97 | if [ "$1" = "0" ]; then |
| 98 | # Only on complete removal, not upgrade |
| 99 | echo "Removing Parrot shell integrations..." |
| 100 | # Note: Users should run 'parrot setup --remove' before uninstalling |
| 101 | echo "If you have shell integration enabled, please restart your terminal sessions." |
| 102 | fi |
| 103 | |
| 104 | %files |
| 105 | %{_bindir}/parrot |
| 106 | %{_datadir}/%{name}/parrot-hook.sh |
| 107 | %{_datadir}/%{name}/parrot-hook.fish |
| 108 | %{_sysconfdir}/%{name}/parrot.toml.example |
| 109 | %{_docdir}/%{name}/ |
| 110 | |
| 111 | %changelog |
| 112 | * Thu Nov 07 2025 mfw <espadonne@outlook.com> - 1.7.2-1 |
| 113 | - Version bump to 1.7.2 |
| 114 | |
| 115 | * Thu Nov 07 2025 mfw <espadonne@outlook.com> - 1.7.1-1 |
| 116 | - Version bump to 1.7.1 |
| 117 | |
| 118 | * Fri Nov 07 2025 mfw <espadonne@outlook.com> - 1.6.1-1 |
| 119 | - Fix: Install parrot-hook.fish for fish shell support |
| 120 | - Fix: Hook script not found error on fish shell |
| 121 | - Add Homebrew caveats for better installation experience |
| 122 | |
| 123 | * Wed Nov 06 2024 mfw <espadonne@outlook.com> - 1.6.0-1 |
| 124 | - Add native fish shell support |
| 125 | - Shell integration now works with bash, zsh, and fish |
| 126 | |
| 127 | * Wed Nov 06 2024 mfw <espadonne@outlook.com> - 1.5.1-1 |
| 128 | - Expansion V6: UNSTOPPABLE 8-category blitz - 314 NEW insults! |
| 129 | - Expansion V5: EPIC 10-category expansion - 385 NEW insults! |
| 130 | - Expansion V4: MASSIVE category expansion - 285 NEW insults! |
| 131 | - Expansion V3: 260 NEW brutal insults targeting weak points |
| 132 | - Total: 1,244 new insults added! Database now at 4,883 total insults |
| 133 | |
| 134 | * Wed Nov 06 2024 mfw <espadonne@outlook.com> - 1.5.0-1 |
| 135 | - Expansion V2: 1000 MORE INSULTS! Total: 3,639 insults |
| 136 | - Ultimate Roast Database: 1,220+ new insults across 26 categories |
| 137 | - Massively expanded fallback intelligence with contextual awareness |
| 138 | |
| 139 | * Wed Nov 06 2024 mfw <espadonne@outlook.com> - 1.4.0-1 |
| 140 | - Tier 4 Intelligence: ML-like learning and dynamic generation capabilities |
| 141 | - Tier 3 Intelligence: LLM-like context awareness for smarter responses |
| 142 | - Tier 2 Intelligence: Project and git context awareness |
| 143 | - Tier 1 Intelligence: Advanced context-aware fallback system |
| 144 | - Expanded fallback database with 600+ contextual insults |
| 145 | - Fixed double output and backend fallback issues |
| 146 | - Enhanced local backend model handling |
| 147 | |
| 148 | * Fri Sep 13 2024 mfw <espadonne@outlook.com> - 1.3.0-2 |
| 149 | - Enhanced post-install messaging to clearly guide users to run 'parrot install' |
| 150 | - Improved shell integration setup instructions and user experience |
| 151 | |
| 152 | * Wed Sep 03 2024 mfw <espadonne@outlook.com> - 1.3.0-1 |
| 153 | - Implemented transparent AI model management for seamless user experience |
| 154 | - Switched default model to llama3.2:3b (25% faster loading than phi3.5:3.8b) |
| 155 | - Added automatic OLLAMA_KEEP_ALIVE=1h configuration via parrot install |
| 156 | - Enhanced post-install scripts to automatically download AI models in background |
| 157 | - Optimized timeouts for graceful degradation (45s default, 30s minimum) |
| 158 | - Improved installation UX: users can install and forget, no manual model management needed |
| 159 | |
| 160 | * Tue Aug 26 2025 mfw <espadonne@outlook.com> - 1.2.0-1 |
| 161 | - Added automated release workflow with scripts/release.sh |
| 162 | - Created comprehensive RELEASE.md documentation |
| 163 | - Enhanced Makefile with release management targets |
| 164 | - Improved version management across repositories |
| 165 | |
| 166 | * Sun Aug 25 2024 mfw <espadonne@outlook.com> - 1.0.4-1 |
| 167 | - Enhanced sanitization to remove character count annotations like "(97 characters)" |
| 168 | - Added removal of "Note:" commentary and asterisk annotations |
| 169 | - Improved tokenization to eliminate all LLM metadata from responses |
| 170 | |
| 171 | * Sun Aug 25 2024 mfw <espadonne@outlook.com> - 1.0.3-1 |
| 172 | - Reduced terminal hangs with aggressive 2-second timeout strategy |
| 173 | - Added immediate visual feedback and thinking indicators |
| 174 | - Implemented async shell hook option (PARROT_ASYNC=true) |
| 175 | - Reduced default timeouts: API 3s, Local 5s (previously 10s/30s) |
| 176 | - Added progressive timeout with fallback to instant responses |
| 177 | |
| 178 | * Sun Aug 25 2024 mfw <espadonne@outlook.com> - 1.0.2-1 |
| 179 | - Enhanced output sanitization to remove all commentary after newlines |
| 180 | - Improved response quality by tokenizing at newlines and discarding annotations |
| 181 | |
| 182 | * Sun Aug 25 2024 mfw <espadonne@outlook.com> - 1.0.1-1 |
| 183 | - Add LLM output sanitization to remove tertiary "(Note:" content |
| 184 | - Improve response quality by filtering unwanted AI justifications |
| 185 | |
| 186 | * Sun Aug 25 2024 mfw <espadonne@outlook.com> - 1.0.0-1 |
| 187 | - Initial RPM release |
| 188 | - Multi-backend architecture with API, Local, and Fallback support |
| 189 | - Interactive setup wizard with automated backend configuration |
| 190 | - Shell integration for bash and zsh |
| 191 | - Three personality levels with terminal color theming |
| 192 | - Comprehensive installation flows and setup automation |