{"id":31074191,"url":"https://github.com/code-samples-galore/terminal-auto-update-programs","last_synced_at":"2025-09-16T02:05:37.470Z","repository":{"id":312427393,"uuid":"1043206491","full_name":"Code-Samples-Galore/Terminal-Auto-Update-Programs","owner":"Code-Samples-Galore","description":"Auto update terminal programs.","archived":false,"fork":false,"pushed_at":"2025-08-30T13:25:03.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-30T15:28:00.500Z","etag":null,"topics":["shell","termial"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Code-Samples-Galore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-23T11:09:30.000Z","updated_at":"2025-08-30T13:25:06.000Z","dependencies_parsed_at":"2025-08-30T15:28:02.080Z","dependency_job_id":"5af030bd-34dc-4b3f-b54f-e159e5b4964e","html_url":"https://github.com/Code-Samples-Galore/Terminal-Auto-Update-Programs","commit_stats":null,"previous_names":["code-samples-galore/terminal-auto-update-programs"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Code-Samples-Galore/Terminal-Auto-Update-Programs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Samples-Galore%2FTerminal-Auto-Update-Programs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Samples-Galore%2FTerminal-Auto-Update-Programs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Samples-Galore%2FTerminal-Auto-Update-Programs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Samples-Galore%2FTerminal-Auto-Update-Programs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Code-Samples-Galore","download_url":"https://codeload.github.com/Code-Samples-Galore/Terminal-Auto-Update-Programs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Samples-Galore%2FTerminal-Auto-Update-Programs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275348511,"owners_count":25448626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-16T02:00:10.229Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["shell","termial"],"created_at":"2025-09-16T02:05:34.221Z","updated_at":"2025-09-16T02:05:37.441Z","avatar_url":"https://github.com/Code-Samples-Galore.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔄 Auto Update Programs\n\nA shell script that automatically runs update commands at specified intervals when you start a new terminal session. Perfect for keeping your development tools up-to-date without manual intervention.\n\n## ✨ Features\n\n- ⏰ **Time-based execution**: Only runs updates after a specified number of days\n- 🔧 **Configurable commands**: Define your own list of update commands\n- 📝 **Timestamp tracking**: Remembers when updates were last run\n- ⚡ **Command validation**: Skips commands if the program isn't installed\n- 🔍 **Status checking**: View when updates were last executed\n- 🔄 **Manual reset**: Force updates to run on next terminal start\n\n## ⚙️ Installation\n\n1. **Download the script:**\n   ```bash\n   curl -o ~/Scripts/auto_update_programs/auto_update_programs.sh https://raw.githubusercontent.com/your-repo/auto_update_programs.sh\n   ```\n\n2. **Make it executable:**\n   ```bash\n   chmod +x ~/Scripts/auto_update_programs/auto_update_programs.sh\n   ```\n\n3. **Source it in your shell config:**\n   \n   Add to your `~/.zshrc` or `~/.bashrc`:\n   ```bash\n   source ~/Scripts/auto_update_programs/auto_update_programs.sh\n   ```\n\n## 🚀 Usage\n\n### 🔰 Basic Usage\n\nAdd this to your `~/.zshrc` or `~/.bashrc` to run updates every 7 days:\n\n```bash\nauto_update_check 7 \"brew update \u0026\u0026 brew upgrade\" \"npm update -g\" \"pip install --upgrade pip\"\n```\n\n### 🧑‍💻 Advanced Usage with Array\n\nFor better organization, use an array:\n\n```bash\n# Define your update commands\nMY_UPDATE_COMMANDS=(\n    \"conda update -n base -c defaults conda -y\"\n    \"brew update \u0026\u0026 brew upgrade\"\n    \"npm update -g\"\n    \"pip install --upgrade pip\"\n    \"rustup update\"\n    \"gem update --system\"\n)\n\n# Run every 3 days\nauto_update_check 3 \"${MY_UPDATE_COMMANDS[@]}\"\n```\n\n### 🛠️ Available Functions\n\n- `auto_update_check [days] [commands...]` - Main function to check and run updates\n- `auto_update_status` - Show when updates were last run\n- `auto_update_reset` - Reset timestamp to force updates on next terminal start\n\n### 💡 Examples\n\n```bash\n# Check every 5 days with specific commands\nauto_update_check 5 \"brew update \u0026\u0026 brew upgrade\" \"npm update -g\"\n\n# Use default commands (conda, brew, npm) every 7 days\nauto_update_check 7\n\n# Check status\nauto_update_status\n\n# Force updates on next terminal start\nauto_update_reset\n```\n\n## 📝 Configuration\n\nThe script stores its timestamp in `~/.auto_update_timestamp`. You can safely delete this file to reset the timer.\n\n### 🏗️ Default Commands\n\nIf no commands are provided, these defaults are used:\n- `conda update -n base -c defaults conda -y`\n- `brew update \u0026\u0026 brew upgrade`\n- `npm update -g`\n\n### 🎨 Customization\n\nYou can customize the commands for your specific setup:\n\n```bash\n# For Python developers\nPYTHON_UPDATES=(\n    \"pip install --upgrade pip\"\n    \"conda update --all -y\"\n    \"pipx upgrade-all\"\n)\n\n# For Node.js developers\nNODE_UPDATES=(\n    \"npm update -g\"\n    \"yarn global upgrade\"\n    \"pnpm update -g\"\n)\n\n# For Rust developers\nRUST_UPDATES=(\n    \"rustup update\"\n    \"cargo install-update -a\"\n)\n\n# Combine and run\nauto_update_check 7 \"${PYTHON_UPDATES[@]}\" \"${NODE_UPDATES[@]}\" \"${RUST_UPDATES[@]}\"\n```\n\n## 🧩 How It Works\n\n1. When you start a terminal, the function checks if enough time has passed since the last update\n2. If yes, it runs each command in sequence\n3. Commands are validated before execution (skipped if the program isn't installed)\n4. A timestamp is saved after successful completion\n5. The next check won't run until the specified interval has passed\n\n## 🛠️ Troubleshooting\n\n**Updates not running?**\n- Check `auto_update_status` to see when they last ran\n- Use `auto_update_reset` to force them to run\n\n**Command not found errors?**\n- The script automatically skips commands for programs that aren't installed\n- Make sure your PATH is set correctly in your shell config\n\n**Want to test without waiting?**\n- Use `auto_update_reset` then restart your terminal\n- Or call `auto_update_check 0 \"your commands\"` to bypass the time check\n\n## 📄 License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-samples-galore%2Fterminal-auto-update-programs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-samples-galore%2Fterminal-auto-update-programs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-samples-galore%2Fterminal-auto-update-programs/lists"}