๐ A Production-Ready Shell Lifecycle Manager with Starship Integration
๐ GitHub Repository
๐ https://github.com/DipadityaDas/InstallZsh.git
๐ What is ZSH (and Why Use It?)
ZSH (Z Shell) is an advanced Unix shell designed to be a more powerful and user-friendly alternative to Bash.
It provides:
- Smarter tab completion
- Command auto-suggestions
- Better globbing and scripting capabilities
- Plugin ecosystem (via frameworks or standalone plugins)
- Improved developer ergonomics
For power users and engineers, ZSH significantly enhances productivity compared to traditional shells.
โก What is Starship?
Starship is a fast, minimal, and highly customizable cross-shell prompt.
Instead of heavy frameworks, Starship delivers:
- Blazing-fast prompt rendering (written in Rust)
- Git-aware status indicators
- Language/runtime detection (Node, Python, etc.)
- Clean and consistent prompt across shells
It integrates seamlessly with ZSH and replaces traditional prompt customization approaches.
๐ Why This Project Exists
In real-world environments (especially shared systems, lab setups, or enterprise fleets), manually configuring ZSH per user introduces:
- Configuration drift
- Broken environments
- No rollback strategy
- Inconsistent developer experience
This tool solves those problems with a state-driven and reversible approach.
๐ฆ Key Features
- โ Per-user installation and rollback
- โ Deterministic state tracking
- โ
Safe
.zshrcdeployment (non-destructive) - โ Starship prompt integration
-
โ Plugin management:
- autosuggestions
- syntax highlighting
โ Full cleanup mode
โ Centralized logging
โ๏ธ Supported Systems
- Fedora
- RHEL
- AlmaLinux
- Rocky Linux
๐ Quick Start
1. Download the Script
git clone https://github.com/DipadityaDas/InstallZsh.git
cd InstallZsh
chmod +x zsh_manager.sh
2. Install ZSH for a User
sudo ./zsh_manager.sh install <username>
Example:
sudo ./zsh_manager.sh install dipaditya
๐ง What the Script Does
Behind the scenes, the script:
- Saves the current shell state
- Installs dependencies:
- zsh, git, fzf, curl
- Enables Starship via COPR
- Installs plugins:
- zsh-autosuggestions
- zsh-syntax-highlighting
- Deploys configs:
/etc/starship/starship.toml~/.zshrc
- Switches the user shell to ZSH
๐ Check Status
sudo ./zsh_manager.sh status <username>
๐ Revert Anytime (Safely)
Standard Revert
sudo ./zsh_manager.sh revert <username>
Full Cleanup Mode
sudo ./zsh_manager.sh revert <username> --full-cleanup
๐ File Structure
| Path | Purpose |
|---|---|
/var/lib/zsh_manager/ |
State tracking |
/var/log/zsh_manager.log |
Logs |
/etc/starship/starship.toml |
Global config |
~/.zshrc |
User config |
๐ก๏ธ Safety First
- State-based rollback (no guesswork)
- Existing
.zshrcis preserved - System users are skipped
- Designed for idempotent execution
๐งช Example Workflow
sudo ./zsh_manager.sh install dipaditya
sudo ./zsh_manager.sh status dipaditya
sudo ./zsh_manager.sh revert dipaditya
sudo ./zsh_manager.sh revert dipaditya --full-cleanup
๐ก Future Enhancements
- Dry-run mode (
--dry-run) - Bulk user operations (
--all-users) - RPM packaging
- Ansible role integration
- Version flag support
๐ License
MIT License
๐จโ๐ป Author
Dipaditya Das
If youโre managing multiple Linux users and want a clean, reversible, and automated ZSH setup with a modern Starship prompt, this approach will significantly reduce manual effort and eliminate configuration drift.
Feedback, issues, and contributions are welcome on GitHub.
Top comments (0)