Prompt Guide
A semi-exhaustive list of what you can ask Greptile, and how to get it to do what you want.
Introduction
Like with many LLM-powered tools, it can be hard to know exactly what you can do with Greptile. This page goes over some usecases that we have seen developers enjoy. While this guide is mainly meant for our codebase Q&A web app it applies to all other interfaces as well, including the API.
Understanding complex codebases
Greptile can help developers understand how a repo works, or how a specific part of it works by providing simple explanations and specific code reference links.
Examples
- “How does auth work in this codebase?”
- “Where is the code that cleans user inputs sent via the API?”
- “What does the
api/proc.ts
file do?”
Debugging
Given an error message, stack trace, or simply a description of unexpected behavior, Greptile can diagnose the cause and suggest a fix with corrected code.
Examples
- “Why am I getting a
FileNotFound: Object has no attribute c://
error when I callsignal.parse()
?” - “When I click on the profile drop-down, the page refreshes. Why?”
- ”
[...Stack trace/error messages]
- why is this happening?”
Mapping out complex code changes
Given a description of a task or ticket, Greptile can use its understanding of the codebase to map out the steps needed to fulfill the task. It can generate the required code and tell you exactly where in the codebase to put it.
Examples
- “How do I make it so the sidebar toggle state is stored in local storage?”
- “How do I modify the chat history so users can rename their old chats?”
- “Help me modify the express router to add suport for session tokens?”
Integrating with 3rd party libraries
You can add multiple repos to the same Greptile session. For example, you can add your-org/your-backend
and nextauthjs/next-auth
to the same session and ask “How do I add sign-in with google to your-backend
using nextauth
?
Examples
- Add
stripe/stripe-node
and ask “How do I add usage-based billing toyour-backend
?” - Add
twilio/twilio-ruby
and ask “How do I stream my LLM output fromyour-frontend
to the twilio SDK?
Evaluating code for performance and security
Greptile can help find opportunities for performance and security improvements. Simply point it to a file or directory, and ask!
Examples
- “Are there any security concerns in
api/auth
?” - “How can I make the parser faster?”
- “How do I modify
db_connector
to be more scalable?”
Prompting with purpose
Generally speaking, Greptile performs better when the instructions are more specific and as much information is provided as possible.
Here are some tips:
Like with all LLM prompting, you will discover subtleties over time about how to make Greptile work best with your codebase and your usecase. If you would like to report a prompting quirk, tell us! It helps us make Greptile better.