π 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)