Skip to content
zero2vibecodelearn vibe coding
Level 0 · Install and first run 7 min Reviewed by the author · Oct 22, 2026 Verified against Gemini CLI v0.65.0 · Oct 22, 2026Official docs: CLI: CLI reference, Reference: commands

Your first Gemini CLI session

Start gemini inside the project folder, point it at the exact file with @, and ask a question before you ask for a change. Sessions are saved, so you can pick one back up instead of starting over.

Level 0 · 0 / 4 lessons0%
In this lesson

Where you type gemini decides what it works on. The folder you start it in becomes its workspace.

Start in the project

cd todo-app
gemini

Before you do, it is worth looking at the folder yourself — the same files the agent is about to see. Do that in the terminal below: move into the project, list it, and read the README.

If you start in the wrong place, there is no clever recovery. Type /quit, cd into the project, and start again.

Name the file with @

Gemini CLI has at commands: @ followed by a path puts that file’s content into your prompt.

@app.js Explain what this file does.

@src/ hands the agent the folder’s path, so it can list and read what it needs instead of every nested file landing in the prompt (Git-ignored files stay out). Naming the file beats describing it: there is no guessing which one you meant, and the agent works from what is actually in it.

Ask before you change

Make the first request a question:

@README.md What is this project, and which file builds the counter?

It costs nothing and changes nothing, and if the answer is wrong, a change request would have been wrong too. When you do ask for a change, keep it to one thing in one place.

In the default approval mode, Gemini CLI asks for your approval before its tools write a file or replace text in one. That prompt is the moment to read what it is about to change — the — not after. The last lesson of this level is about those modes.

Quick check

Which first prompt gives Gemini CLI the least room to guess?

Leaving and coming back

/quit (or /exit) leaves the session. It is saved, so you can return to it:

  • gemini -r "latest" continues the most recent session from the command line.
  • /resume inside Gemini CLI opens a browser of saved sessions to pick from.
  • /clear starts a fresh session when the current one has wandered.

Two more commands worth knowing early: /help lists every command, and /stats shows statistics for the current session, such as its duration and tool calls.

Try it yourself

Can I give Gemini CLI more than one folder?

Yes. Start it with gemini --include-directories followed by a comma-separated list, as the README shows, and it treats those folders as part of the workspace too.

Can I run a single prompt without opening a session?

Yes. gemini -p followed by the prompt in quotes runs it non-interactively and prints the answer, which is how it goes into scripts.

Check your understanding

Answered 0/3
Mode:

What does @app.js do at the start of a Gemini CLI prompt?

You started gemini in your home folder by mistake. What is the fix?

How do you continue yesterday's session from the command line?

Finish the task in the terminal and answer the questions to complete the lesson.

📝 My notes

Saved automatically in this browser · shows up on the Notes page.

Task

Move into the project and look at what the agent will see, the way you would before typing gemini.

Tab complete · ↑ history · Ctrl+L clear · help commands

  • Not done: Stand inside the project folder
  • Not done: List what is in the project
  • Not done: Read the README, the file you would point the agent at first
  • Not done: Know what the project is before you ask about it

Lesson Q&A

What does @app.js do at the start of a Gemini CLI prompt?

It puts the content of app.js into your prompt — An at command with a file path reads that file into the current prompt. With a folder path it passes the folder's path instead, so the agent can list and read what it needs, and Git-ignored files stay out either way.

You started gemini in your home folder by mistake. What is the fix?

Type /quit, cd into the project, and start gemini again — The folder you start in is the workspace. Restarting in the project gives it the right one, and keeps it from reading files that have nothing to do with the task.

How do you continue yesterday's session from the command line?

gemini -r "latest" — gemini -r "latest" continues the most recent session, and /resume inside a session opens a browser of saved ones.

Which first prompt gives Gemini CLI the least room to guess?

It names the file and the symptom. The other two make the agent decide what the task is.

Commands in this lesson

Terms in this lesson

Move between lessons with ← → · search with ⌘K

Written and reviewed by Mikhail Kuzmitskii