
How to Use AI to Script a New Dev Machine Setup
Setting up a new dev machine used to take hours — sometimes days. You’d reinstall packages, copy over dotfiles, tweak your shell, and Google forgotten config flags.
But now? You can hand the blueprint to AI and let it do the boring parts.
This isn’t about giving control away. It’s about speeding up the parts you already know how to do, but don’t want to do again.
1. Describe Your Stack, Not the Commands
Start by telling your AI tool (like ChatGPT, Gemini, or a local LLM) what you use, not what to type.
Example prompt:
I want to set up a new Ubuntu laptop for web development. I use fish shell, VS Code, Docker, and Node.js. I prefer git via CLI. I want zoxide, bat, and exa for better terminal tools.
Keep it natural. Mention your language stack, dev tools, aliases, preferred themes — even font settings. The more complete, the better the script.
2. Let AI Build the Bootstrap Script
With a good prompt, you’ll get something like:
#!/bin/bash
sudo apt update && sudo apt upgrade -y
sudo apt install -y git curl fish zoxide bat exa docker.io nodejs npm
chsh -s /usr/bin/fish
Sanity check the result. Look out for:
- Missing packages
- Old repo links
- Broken PPA references
- Anything that requires GUI interaction (VS Code installs, font tweaks)
Then tweak and save it as setup.sh
.
3. Add Dotfile Sync + Config
AI can help you automate dotfile setup too. Include in your prompt:
I store my dotfiles on GitHub. I want the script to clone them to ~/.dotfiles and run a setup script inside.
Your script might now include:
git clone https://github.com/youruser/dotfiles ~/.dotfiles
cd ~/.dotfiles && ./setup
If your dotfiles repo uses GNU Stow or symlinks, tell it that too. The goal is: zero manual steps after running setup.sh
.
4. Extend with Custom Prompts
Don’t stop at packages.
- Want a PostgreSQL-ready local DB with default users?
- Need
nvm
and multiple Node versions? - Want it to install Vim plugins?
Prompt for it.
AI is better at scripting real-world configs than most Stack Overflow threads.
5. Run It On Your Next Machine
Save setup.sh
to a private repo, USB stick, or dotfiles repo.
On a fresh install, just:
curl -O https://yourrepo.com/setup.sh
chmod +x setup.sh
./setup.sh
With one script, your machine becomes your machine again.
One More Thing: Security + Common Sense
Don’t blindly run AI-generated shell scripts. Ever.
Always read them. Always run them line by line before trusting automation with sudo
.
AI is your assistant, not your sysadmin.
Your future self will thank you. Next time you wipe your disk, you’ll be rebooting into your full setup in minutes — not rebuilding it from memory.
Last updated: 2025-04-09 21:19 UTC