Setup & Your First Suggestion
In G00 you saw the map. Now we put the tool on your machine. By the end of this module a faded "ghost text" suggestion will appear in your editor and you'll accept it with one keypress.
Before You Start
- A Google account. A personal Gmail account works for the free Individuals tier (active through June 17, 2026 — see G00). If your company gave you a Standard/Enterprise seat, use that work account.
- VS Code 1.85+ (Lab A) or a JetBrains IDE 2023.2+ such as IntelliJ IDEA or PyCharm (Lab B). Android Studio users: the plugin ships built in — jump to the note at the end of Lab B.
- Python 3.10+ so the verification snippet actually runs. Check with
python --version. - An internet connection — suggestions are generated by Gemini models in the cloud, not locally.
Installing Gemini Code Assist is like hiring that brilliant teammate from G00: there's a tiny bit of paperwork before they can start. The "interview" is installing the extension, the "badge photo" is signing in with Google, and the "desk assignment" is granting the extension permission to talk to Google's servers on your behalf. Skip any step and the teammate shows up but can't get past reception — which is exactly what's happening when people complain "I installed it but nothing appears." The whole onboarding takes about five minutes when you do the steps in order.
Lab A: VS Code Setup
Install the extension
Open VS Code. Press Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (macOS) to open the Extensions panel. Search for "Gemini Code Assist" — the publisher must be Google. Click Install.
Prefer the command line? This does the same thing:
code --install-extension Google.geminicodeassist
Sign in with Google
Click the Gemini Code Assist icon in the Activity Bar, then click Sign in with Google. Your browser opens a Google sign-in page. Choose the account you decided on above and click Allow when asked to authorize the extension.
Create the lab folder
We'll use one folder for the whole course. Create it and open it in VS Code:
New-Item -ItemType Directory -Force "$HOME\gca-course\recipe-box"
code "$HOME\gca-course\recipe-box"
mkdir -p ~/gca-course/recipe-box
code ~/gca-course/recipe-box
Your First Suggestion
Ghost text is the faded, italic inline preview of a suggested completion. It is not yet part of your file — it becomes real code only when you accept it with Tab. Press Esc to dismiss, or just keep typing to ignore it. When several alternatives exist, hover the suggestion to page through them.
Trigger a completion
In your new recipe-box folder, create a file named units.py and type this comment plus the first line of the function — type it, don't paste it, so the model sees you writing:
# Convert a quantity in grams to ounces, rounded to 2 decimal places.
# Raise a ValueError if grams is negative.
def grams_to_ounces(
Pause after the open parenthesis. Within a second or two, ghost text proposes the rest of the function. Press Tab to accept it.
Verify the generated code actually runs
AI suggestions are drafts, not gospel — always run them. Add this to the bottom of units.py and run the file:
if __name__ == "__main__":
try:
print(grams_to_ounces(100)) # expected: 3.53
print(grams_to_ounces(0)) # expected: 0.0 or 0
print(grams_to_ounces(-5)) # expected: ValueError
except ValueError as err:
print(f"Correctly rejected negative input: {err}")
python units.py
3.53, then 0.0, then Correctly rejected negative input: grams must be non-negative (your exact message may differ — the model writes its own wording). If the math or the error handling differs, that's your first real lesson: read what you accept.You wrote a two-line comment describing intent (including an error-handling requirement) and the model produced a complete, typed, validated function. Notice what drove quality: the comment mentioned rounding and the negative-input rule, so the suggestion included both. Vague comment in, vague code out — this becomes a core skill in G02.
Lab B: JetBrains Setup (IntelliJ / PyCharm)
Skip this section if you're staying in VS Code — or do both and decide which home you prefer. The features are nearly identical; the labs in this course call out the differences when they matter.
Install the plugin
Open Settings → Plugins → Marketplace (Ctrl+Alt+S on Windows/Linux, Cmd+, on macOS). Search for "Gemini Code Assist" (publisher: Google), click Install, and restart the IDE when prompted.
Sign in and open the tool window
After restart, a Gemini icon appears in the right-hand tool window strip. Click it, choose Sign in with Google, and complete the browser flow — same as VS Code. Open any Python file and type the grams_to_ounces comment from Lab A to confirm ghost text appears.
VS Code
JetBrains IDEs
Android Studio (Narwhal and later) ships Gemini built in — no marketplace install. Open the Gemini tool window, sign in, and you get completion, chat, and agent mode tuned for Android projects. Everything you learn in this course transfers directly.
Standard / Enterprise Setup (Teams)
The free tier is like using a personal library card: you sign up yourself and you're in. A Standard or Enterprise seat is a corporate library card: the company opens an account with the library (a Google Cloud project), buys a block of memberships (license seats), and hands one to each employee (license assignment). The painful failure mode is an employee holding a card the company never activated — you can sign in but every request is rejected. The three steps below are exactly: open the account, buy the seats, hand them out.
Standard and Enterprise are licensed through a Google Cloud projectThe basic organizational unit in Google Cloud. Billing, APIs, and permissions all attach to a project. You identify one by its globally unique project ID.. An admin must, once per organization:
- Enable the Gemini for Google Cloud API (
cloudaicompanion.googleapis.com) in the project. - Purchase a Standard or Enterprise subscription in the Gemini admin console and assign license seats to users.
- Grant each developer the "Gemini for Google Cloud User" IAM role (
roles/cloudaicompanion.user) on that project.
Admins can do all three from the console UI, or script it:
# 1. Enable the API (replace my-team-project with your project ID)
gcloud services enable cloudaicompanion.googleapis.com --project my-team-project
# 2. Grant a developer the required role
gcloud projects add-iam-policy-binding my-team-project `
--member="user:dev@example.com" `
--role="roles/cloudaicompanion.user"
# (License seats are assigned in Console: Gemini admin page -> Subscriptions)
Then each developer does one extra step in the IDE: after signing in, select the licensed Google Cloud project when the extension asks (VS Code: click the project name in the status bar or run the command "Gemini: Select Google Cloud project" from the palette).
"It works at home but not on my work account" is almost always one of: the API isn't enabled on the selected project, the IAM role is missing, or the IDE is pointed at the wrong project (e.g., your personal sandbox instead of the licensed one). Check those three in that order — it resolves the vast majority of cases.
Troubleshooting
- No ghost text appears. Confirm the file type is a recognized language (e.g.,
.py, not.txt); check the status bar Gemini icon for an error badge; make sure inline suggestions aren't disabled (editor.inlineSuggest.enabledin VS Code settings); and verify another AI assistant (e.g., Copilot) isn't capturing completions first — run one assistant at a time. - Sign-in loop / browser never returns. Corporate proxies and SSO can block the localhost callback. Try signing in from the browser the IDE opened (not a copied URL), and whitelist
accounts.google.com. - "Quota exceeded" messages. Free-tier daily limits reset every 24h. Teams: confirm the license seat is actually assigned, not just the IAM role.
- Suggestions are slow. Completions are cloud-generated; check your connection. JetBrains users: disable other completion-heavy plugins for a fair test.
- Behind a firewall. The extension needs HTTPS access to
*.googleapis.com. Ask IT to allow it; there is no offline mode.
You installed the extension, signed in, generated and verified your first AI-written function, and (if you're on a team) learned the three-step admin flow that powers licensed seats. The tool is live — from here on, every module is about using it well.
Knowledge Check
1. Ghost text just appeared in your editor. What is it, right now?
2. Which THREE things must an admin set up for a Standard/Enterprise developer seat to work?
3. The comment you write before triggering a generation matters because…
4. After accepting a generated function, the recommended next step is to…
5. Your work IDE shows "quota exceeded" but your IAM role is correct. The most likely cause is…
Quiz Complete!
Ready for G02: Code Completion & Generation →