By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: Mastering Gemini CLI – Top Tips for Better AI Coding | HackerNoon
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > Computing > Mastering Gemini CLI – Top Tips for Better AI Coding | HackerNoon
Computing

Mastering Gemini CLI – Top Tips for Better AI Coding | HackerNoon

News Room
Last updated: 2025/11/07 at 3:33 AM
News Room Published 7 November 2025
Share
Mastering Gemini CLI – Top Tips for Better AI Coding | HackerNoon
SHARE

I’ve been using the Gemini CLI a lot lately for my coding projects. I really like how it helps me work faster right inside my terminal. But when I first started, I didn’t always get the best results. Over time, I’ve learned some simple tricks that make a huge difference. If you use the Gemini CLI, I want to share my top 10 pro tips. If you are ready, then let’s get started.

My Top 10 Pro Tips for Using the Gemini CLI

1. Always Open Your Project Folder First

This is a super important step I always do! Before I run the gemini command, I make sure I am already inside my project folder. This helps Gemini get the right view of my code and load the right GEMINI.md file. It saves me time and helps keep other files, which are not part of the project, private.

2. Craft Clear, Specific Prompts

Gemini itself tells you to be specific for the best results, and I agree. Poor prompts often fail because they lack context. For example:

# Vague prompt (not recommended)  
help me fix my UI

Instead, be explicit about what you want and break the task into steps. You can even instruct Gemini to wait for your confirmation:

# Better prompt with context and checklist request  
When I tap on a chat message, save that portion of the UI as an image. Provide TypeScript code to implement this feature. Create a step‑by‑step checklist and ask for my approval before editing any files.

3. Ask for a Plan Before Changes

If I’m worried about using too many tokens (or just want to be careful), I ask Gemini to “generate the plan” first. This gives me a clear list of what it’s going to change. If I see a mistake in the plan, I can ask Gemini to fix the plan before it starts changing my files. This saves a lot of time!

4. Provide Persistent Context with GEMINI.md

To give Gemini CLI background knowledge about your project, create a .gemini folder in your repository and add a GEMINI.md file.

I use the /init command to create a GEMINI.md. In this file, I document all the important aspects of my project, such as style guides, audience details, and instructions for running tests. Gemini uses this info from the very first time it launches.

If I change the file, I just use the /memory refresh command to update Gemini’s knowledge about the project.

/memory refresh  

# verify it’s saved  
/memory show

5. Use Shell Mode for Quick Terminal Commands

In the interactive session, you can toggle shell mode by pressing !. For example:

gemini  
# inside Gemini CLI  
!        # enters shell mode  
pwd      # prints the current directory  
ls   # lists files  
!        # exits shell mode (or press Esc)

Shell mode executes commands locally and feeds the output back into the conversation context.

6. Use /memory add for Quick Context Update

For fast notes, like a database port number or an API URL, I use the /memory add command. This is a quick way to add specific details to Gemini’s memory, and it’s faster than opening and editing the GEMINI.md file every time.

# store a decision  
/memory add "The database port is 123 and we decided to use Boostrap CSS."  

# verify it’s saved  
/memory show

7. Search the web with @search

The built‑in @search tool fetches information from the web or external sources. For instance, if you need to investigate a known issue on GitHub:

@search "https://github.com/google-gemini/gemini-cli/"

Gemini fetches the issue and uses it as context to answer your question. You can also search by keyword:

@search "How to fix 'Cannot find module' error in Node.js?"

Or I just tell the assistant to “search the web,” and it’s smart enough to handle the rest!

8. Custom Slash Commands

If you often ask the same type of question, define a custom slash command. Suppose you regularly need a planning template. Create a directory and TOML file:

# create the commands folder  
mkdir .gemini/commands  
# create a toml file  
touch .gemini/commands/plan.toml

Inside the file, add the description and prompt.

description = "Generate a concise plan from requirements"  
prompt = """  
You are a project planner. Based on the following requirements, generate a numbered plan with deliverables, time estimates and testing tasks.  

Requirements: {{args}}  
"""

Now, you can use the /plan command inside Gemini.

/plan "Add user authentication and registration to the TODO app."

9. Use Non-Interactive Mode for Single Questions

Use Non-Interactive Mode for Single Questions

When I need a quick answer and don’t want to start the full chat mode, I use the gemini -p command. I just passed my question with the command and got a single, fast response right in my terminal. For example:

gemini -p "summarize the main points of gemini.md"

10. Enable Checkpoints (My Undo Button!)

This is my favorite safety feature. I enable checkpointing in my settings.json file. This is like a “save button” or a small Git commit before Gemini makes any changes. If the project breaks after a change, I can just use the /restore command to see the list of saved snapshots and roll back to a previous, working version of my files.

Video Tutorial: Gemini CLI Top 10 Tips

If you want to see these commands in action, please watch my video tutorial.

Watch on YouTube: Gemini CLI Tips

Conclusion

The CLI is a powerful tool, but these small steps are what really make it fast and reliable for me. I hope these tips help you get the most out of it, too!

Cheers! 😉

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article iPhones And MacBooks May Become More Expensive Thanks To Rising Production Costs – BGR iPhones And MacBooks May Become More Expensive Thanks To Rising Production Costs – BGR
Next Article Ring’s ‘Familiar Faces’ AI tool allegedly violates state privacy laws Ring’s ‘Familiar Faces’ AI tool allegedly violates state privacy laws
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

The TechBeat: AWS Outage 2025: What Really Happened on October 20 and What It Teaches Us About the Cloud (11/9/2025) | HackerNoon
The TechBeat: AWS Outage 2025: What Really Happened on October 20 and What It Teaches Us About the Cloud (11/9/2025) | HackerNoon
Computing
NFL Week 10: How to Watch Pats vs. Bucs, Giants vs. Bears and Other Games From Anywhere
NFL Week 10: How to Watch Pats vs. Bucs, Giants vs. Bears and Other Games From Anywhere
News
Should You Match or Contrast Your Countertops with Tiles?
Should You Match or Contrast Your Countertops with Tiles?
Gadget
AMD Preps More Graphics Driver Changes For Linux 6.19
AMD Preps More Graphics Driver Changes For Linux 6.19
Computing

You Might also Like

The TechBeat: AWS Outage 2025: What Really Happened on October 20 and What It Teaches Us About the Cloud (11/9/2025) | HackerNoon
Computing

The TechBeat: AWS Outage 2025: What Really Happened on October 20 and What It Teaches Us About the Cloud (11/9/2025) | HackerNoon

7 Min Read
AMD Preps More Graphics Driver Changes For Linux 6.19
Computing

AMD Preps More Graphics Driver Changes For Linux 6.19

2 Min Read
Cloud Hypervisor 49 Released With AArch64 + Microsoft Hyper-V Improvements
Computing

Cloud Hypervisor 49 Released With AArch64 + Microsoft Hyper-V Improvements

2 Min Read
SquashFS Tools 4.7.3 Brings Optimizations For As Much As “1500 Times” Speed Improvement
Computing

SquashFS Tools 4.7.3 Brings Optimizations For As Much As “1500 Times” Speed Improvement

2 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?