WSL, VSCode, and Gemini Setup Guide
Setting up a robust development environment is the first step toward a productive coding journey. For Windows users, the combination of WSL2 and VSCode offers a near-native Linux experience with the comfort of a familiar desktop. In this guide, I'll walk you through my personal setup process, including the installation of the Gemini CLI for AI-assisted development.
WSL, VSCode, and Gemini Setup Guide
This guide will walk you through setting up a development environment using Windows Subsystem for Linux (WSL), Visual Studio Code, and the Gemini CLI.
1. Install WSL with Ubuntu LTS
First, we'll install WSL with the latest Ubuntu LTS distribution.
-
Open PowerShell as Administrator:
- Press
Win + Xand select "Windows PowerShell (Admin)".
- Press
-
Install WSL:
- Run the following command to install WSL and the default Ubuntu distribution:
wsl --install
- Run the following command to install WSL and the default Ubuntu distribution:
-
Restart Your Computer:
- After the installation is complete, restart your computer to finalize the setup.
-
Set Up Your Ubuntu User:
- Once your computer has restarted, Ubuntu will start and prompt you to create a new user account and password. This will be your default user for the Linux environment.
2. Install Zsh, Oh My Zsh, and Plugins
Next, we'll replace the default Bash shell with Zsh and enhance it with Oh My Zsh.
-
Update Your Package List:
sudo apt update -
Install Zsh:
sudo apt install zsh -y -
Install Oh My Zsh:
- Install
curlfirst if you don't have it:sudo apt install curl -y - Run the Oh My Zsh installation script:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" - If prompted, set Zsh as your default shell.
- Install
-
Set the "gmzh" Theme:
- Open your Zsh configuration file in a text editor like
nano:nano ~/.zshrc - Find the line that starts with
ZSH_THEMEand change it to:ZSH_THEME="gmzh" - Save the file (
Ctrl + O,Enter) and exit (Ctrl + X).
- Open your Zsh configuration file in a text editor like
-
Install the Autocomplete Plugin:
- We'll use the
zsh-autosuggestionsplugin. Clone the repository into your Oh My Zsh plugins directory:git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions - Open your
.zshrcfile again:nano ~/.zshrc - Find the
pluginsline and addzsh-autosuggestionsto the list:plugins=(git zsh-autosuggestions) - Save and exit the file.
- We'll use the
-
Apply the Changes:
- Restart your shell or run the following command to apply the changes:
source ~/.zshrc
- Restart your shell or run the following command to apply the changes:
3. Install NVM, Node.js, and npm
Now, let's install Node.js and npm using the Node Version Manager (NVM).
-
Install NVM:
- Run the NVM installation script. Check the official NVM repository for the latest version number.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
- Run the NVM installation script. Check the official NVM repository for the latest version number.
-
Update Your Shell Configuration for NVM:
- Close and reopen your terminal, or run the following commands to add NVM to your shell's path:
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
- Close and reopen your terminal, or run the following commands to add NVM to your shell's path:
-
Install the Latest LTS Version of Node.js:
- Run the following command to install the latest Long-Term Support (LTS) version of Node.js:
nvm install --lts
- Run the following command to install the latest Long-Term Support (LTS) version of Node.js:
-
Verify the Installation:
- Check that Node.js and npm are installed correctly:
node -v npm -v
- Check that Node.js and npm are installed correctly:
4. Install the Gemini CLI
Finally, let's install the Gemini Command Line Interface (CLI).
-
Install the Gemini CLI via npm:
- Run the following npm command to install the Gemini CLI globally:
npm install -g @google/gemini-cli
- Run the following npm command to install the Gemini CLI globally:
-
Verify the Installation:
- Check that the Gemini CLI is installed:
gemini --version
- Check that the Gemini CLI is installed:
Congratulations! You have successfully set up your development environment.