{"id":37148636,"url":"https://github.com/troypoulter/entmaid","last_synced_at":"2026-01-14T17:33:25.888Z","repository":{"id":181512649,"uuid":"665019565","full_name":"troypoulter/entmaid","owner":"troypoulter","description":"A CLI for generating entity-relationship (ER) diagrams for ent","archived":false,"fork":false,"pushed_at":"2024-02-05T13:46:06.000Z","size":156,"stargazers_count":2,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-12T14:00:58.791Z","etag":null,"topics":["ent","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/troypoulter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-07-11T09:02:40.000Z","updated_at":"2023-11-10T18:54:45.000Z","dependencies_parsed_at":"2024-01-16T10:29:28.908Z","dependency_job_id":"883a2ad0-8e8c-4bfb-b210-517b0b1139f2","html_url":"https://github.com/troypoulter/entmaid","commit_stats":null,"previous_names":["troypoulter/entmaid"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/troypoulter/entmaid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troypoulter%2Fentmaid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troypoulter%2Fentmaid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troypoulter%2Fentmaid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troypoulter%2Fentmaid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/troypoulter","download_url":"https://codeload.github.com/troypoulter/entmaid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troypoulter%2Fentmaid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28428454,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ent","go","golang"],"created_at":"2026-01-14T17:33:25.208Z","updated_at":"2026-01-14T17:33:25.884Z","avatar_url":"https://github.com/troypoulter.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# entmaid\n\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/troypoulter/entmaid)](https://github.com/troypoulter/entmaid/releases)\n[![Go Reference](https://pkg.go.dev/badge/github.com/troypoulter/entmaid.svg)](https://pkg.go.dev/github.com/troypoulter/entmaid)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/troypoulter/entmaid/go.yaml?logo=github%20actions\u0026label=Test)\n[![codecov](https://codecov.io/gh/troypoulter/entmaid/branch/main/graph/badge.svg?token=RM9PD4LKZ8)](https://codecov.io/gh/troypoulter/entmaid)\n[![Go Report Card](https://goreportcard.com/badge/github.com/troypoulter/entmaid)](https://goreportcard.com/report/github.com/troypoulter/entmaid)\n\nA CLI for generating [entity-relationship](https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model) diagrams in [mermaid.js](https://mermaid.js.org/#/) for the Go entity framework [ent](https://entgo.io/).\n\n## Install\n\nTo otherwise install it:\n\n```bash\ngo install github.com/troypoulter/entmaid@latest\n```\n\n## Features\n\nThe generated diagram aims to be as SQL like as possible, so it will define:\n\n- **Primary (PK) and Foreign (FK) Keys**: This helps to see how the different relationships are made, especially for foreign keys where if using the standard edges in ent will specify in the schema the actual field name.\n- **Display Actual Many-to-Many (M2M) Table**: How ent shows M2M through the default edges approach doesn't make clear that it creates a separate table, so we show you what it actually looks like!\n\nAdditional useful features outside of the generated diagram itself:\n\n- **Automatically insert your diagram code into your `README`**: You can support living design documents by having `entmaid` to place the generated diagram inside an existing `README` or any markdown file, so it always stays up-to-date!\n\nHere's an example diagram generated, checkout the [Usage](#usage) section on how it was generated!.\n\n\u003c!-- #start:entmaidReadme1 --\u003e\n```mermaid\nerDiagram\n Car {\n  int id PK\n  string model\n  time-Time registered_at\n  int user_cars FK\n }\n\n Group {\n  int id PK\n  string name\n }\n\n group_users {\n  int group_id PK,FK\n  int user_id PK,FK\n }\n\n User {\n  int id PK\n  int age\n  string name\n }\n\n Group |o--o{ group_users : users-groups\n User |o--o{ Car : cars-owner\n User |o--o{ group_users : groups-users\n\n```\n\u003c!-- #end:entmaidReadme1 --\u003e\n\n## Usage\n\n\u003e **Note**\n\u003e\n\u003e There are numerous examples you can inspect through the [examples](./examples/) folder and also by inspecting the [Makefile](./Makefile).\n\n```text\nA CLI for generating a mermaid.js Entity Relationship (ER) diagram for an Ent Schema, without needing a live database!\n\nUsage:\n  entmaid [flags]\n\nFlags:\n      --endPattern string       target directory for schemas (default \"\u003c!-- #end:entmaid --\u003e\")\n  -h, --help                    help for entmaid\n  -o, --outputType outputType   set the desired output type: can be 'markdown' (useful for GitHub), 'plain' (default markdown)\n  -s, --schema string           directory containing the schemas (default \"./ent/schema\")\n      --startPattern string     target directory for schemas (default \"\u003c!-- #start:entmaid --\u003e\")\n  -t, --target string           target file to output diagram (default \"./ent/erd.md\")\n```\n\n1. Start by putting the desired `startPattern` and `endPattern` values into your `target` file so `entmaid` knows where to insert the diagram.\n\n2. Run the command passing through all the relevant parameters, this example will be using the command from the [Makefie](./Makefile), `example.readme`:\n\n    ```bash\n    entmaid -s ./examples/start/schema -t ./README.md -o markdown --startPattern \"\u003c!-- #start:entmaidReadme --\u003e\" --endPattern \"\u003c!-- #end:entmaidReadme --\u003e\"\n    ```\n\n3. You should now see the generated diagram in the `target` file, you can check out the diagram below as the above command generated it!\n\n## Inspiration \u0026 Acknowledgements\n\nI was inspired by both [a8m/enter](https://github.com/a8m/enter) and [hedwigz/entviz](https://github.com/hedwigz/entviz) for generating mermaid diagrams from reading in just the ent schema folder.\n\nI created this as I wanted to support additional features (as listed in the [Features](#features) section!), especially being able to insert the generated diagram code _directly_ into my markdown files has been awesome!\n\nThis is also my first publihsed Go module and I wanted to give it a shot!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroypoulter%2Fentmaid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftroypoulter%2Fentmaid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroypoulter%2Fentmaid/lists"}