## Git Diagrammer - Eraser

### How to generate a diagram from a git codebase

### Step-by-step guide on generating diagrams from a git codebase

1. **Copy the repository URL**  
1. Ensure the repository is **public** on GitHub.  
2. For **private repos**, sign up for a free Eraser account to enable access.
2. **Select a diagram type**  
1. Supported diagrams: **Architecture diagrams, Sequence diagrams, Entity-Relationship diagrams, and Flowcharts**.
3. **Write a clear prompt**  
1. A simple one-liner can work, but **detailed prompts** usually yield better results.  
2. Follow this framework for an effective prompt:  
      1. **Specify file or folder paths** (e.g., `/deployments/dev`) for context.  
      2. **Describe the topic** you want to visualize (e.g., signup flow, service architecture, user data model).  
      3. **Include visualization instructions** (e.g., what to include/exclude, grouping preferences).
4. **Generate the diagram** using the completed prompt.
5. **Refine the diagram**  
1. Use Eraser's **diagram-as-code DSL** for manual changes.  
2. Adjust the layout manually with **GUI controls** (requires signing into Eraser).

### Tips on generating diagrams from a git codebase

- **Be specific with paths**  
  - Example: `"Draw a cloud architecture diagram from .tf files in /deployments/dev"` is clearer than `"Draw a cloud architecture diagram from this repo"`.

**Break down complex diagrams**  
  - Instead of `"Draw an architecture diagram of this repo"`, try `"Draw a service architecture diagram of the payment process"`.

### Examples of effective prompts

- "Create an architecture diagram showing the API services in `/src/api/` and how they interact with database models in `/src/models/`"  
- "Generate a sequence diagram for the user checkout process from the files in `/src/services/checkout/` and `/src/controllers/payment/`"  
- "Draw an entity relationship diagram of the user, order, and product models from the files in `/src/database/schemas/`"

## FAQs

**How do I get started?**  
Try one of our presets. Select an option under "Load a preset" and click "Generate Diagram". You can also browse our [use case video library](https://vimeo.com/showcase/10471573) for more inspiration.

**Can I edit my diagram?**  
Yes, the diagrams can be edited in Eraser, a docs and diagram tools built for engineering teams. Click on "Save and Edit Diagram". In Eraser, the diagrams can be edited using Eraser's [diagram-as-code syntax](https://docs.eraser.io/docs/).

**Who made this and what is Eraser?**  
DiagramGPT was created by the team at Eraser, leveraging OpenAI's models. Eraser ( [eraser.io](/content/site-root.html)) is an AI tool for technical design and documentation. You can edit your DiagramGPT generated diagrams using Eraser.

**How can I share feedback?**  
We'd love to hear from you. Reach out to us at hello@eraser.io, on [Twitter (@eraserlabs),](https://twitter.com/eraserlabs) or [join our Slack community](https://join.slack.com/t/eraser-community/shared_invite/zt-1sm1o2d5e-cw6g7a~sSDapGGhJYNLrQw).

**What types of diagrams can it draw?**  
5 types are currently available – flow charts, entity relationship diagrams, cloud architecture diagrams, sequence diagrams, and BPMN diagrams.

**Is there an API?**  
Yes, you can read our [API documentation here](https://docs.eraser.io/reference). The API is only available to Starter, Business, and Enterprise Plan teams.

**Will my data be used for LLM training?**  
No. OpenAI nor Eraser will use your data to train AI models. Eraser may analyze your usage to improve and enhance our AI feature.

**What's next?**  
It only gets better from here. We're working to improve accuracy and layout customization. If there's something you'd really like to see, drop us a note at hello@eraser.io.
