# Your first Gemini CLI session

Course: Gemini CLI from Zero — https://zero2vibecode.com/learn/gemini-cli
Canonical URL: https://zero2vibecode.com/learn/gemini-cli/0-2-first-gemini-cli-session
Verified against: Gemini CLI v0.65.0 (2026-10-22)
Last updated: 2026-10-22

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.

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

## Start in the project

```bash
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.

```text
@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:

```text
@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 diff — not after. The last lesson of this level is about those modes.

## 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.
