Option to use it as a cli for local repo
I think it would be useful to have this tool as a cli
I would love to be able to point local repo in fact!
after i stabilize the deployment costs, this looks like it would be the top feature people are asking, to run it on local / private repos
the cli makes the most sense, since locally is the most secure and unratelimited way people would use this
Hey! I am down to work on this
This is the right solution for the codebases that truly need this tool. Most corporate ones are unlikely to allow an online tool to connect to the code, but if it operates on a CLI with their own keys, it could definitely become a much more widely adopted tool. I would prioritize this over hosting.
I second this and docker compose to host gitdiagram om my own server as well
CLI could be cool, or you could add the option to point to a local repo in the UI. The docs to run it locally are good*, I've got it running.
* = The ReadMe says to enter Anthropic (Claude) API Key, but the .env has an OpenAI entry, and the Anthropic entry is commented out.
Yes this would be so cool. Not sure what I am missing but what is missing to be able to point it to a local repo?
I agree, I really want to use it as a CLI tool for my local repo.
That'd be really cool.
I agree, I really want to use it as a CLI tool for my local repo.
I just write a draft version to convert the local repository directory to a diagram. It is not hard, take around 1 hours to do the refactor. But the code is too hacky. Hope I can have time to clean it in this weekend and open a PR for it.
Hey guys, I open a PR here #66. Not sure when will be merged. If anyone want to try local directory generation, please check my current branch here: https://github.com/yufansong/gitdiagram/tree/feat/local-service?tab=readme-ov-file#how-to-run-it-on-local-direcotry
I don't know front-end things. I only change the backend logic and do some tricky to by pass the frontend logic.
It may require you deploy it in your own machine which need install docker. It may take some time if you are not familiar with docker, but worth to try.
For local you can use this tool: https://github.com/XERO47/Agentic-Reviewer/
@yufansong I cloned your brach local-service and followed your instructions, although I got these errors:
Cost estimation failed: "Failed to get cost estimate."
Source src/hooks/useDiagram.ts (289:17) @ useDiagram.useCallback[getDiagram]
287 | 288 | if (costEstimate.error) {
289 | console.error("Cost estimation failed:", costEstimate.error); | ^ 290 | // if (costEstimate.requires_api_key) { 291 | // setTokenCount(costEstimate.token_count ?? 0); 292 | // }
Console Error
TypeError: Failed to fetch
Source src/lib/fetch-backend.ts (142:28) @ getCostOfGeneration
140 | const url = new URL(${baseUrl}/generate/cost);
141 |
142 | const response = await fetch(url, { | ^ 143 | method: "POST", 144 | headers: { 145 | "Content-Type": "application/json", useDiagram.useCallback[getDiagram]
@yufansong I cloned your brach local-service and followed your instructions, although I got these errors:
Cost estimation failed: "Failed to get cost estimate."
Source src/hooks/useDiagram.ts (289:17) @ useDiagram.useCallback[getDiagram]
287 | 288 | if (costEstimate.error) {
289 | console.error("Cost estimation failed:", costEstimate.error); | ^ 290 | // if (costEstimate.requires_api_key) { 291 | // setTokenCount(costEstimate.token_count ?? 0); 292 | // }
Console Error
TypeError: Failed to fetch
Source src/lib/fetch-backend.ts (142:28) @ getCostOfGeneration
140 | const url = new URL(
${baseUrl}/generate/cost); 141 |142 | const response = await fetch(url, { | ^ 143 | method: "POST", 144 | headers: { 145 | "Content-Type": "application/json", useDiagram.useCallback[getDiagram]
I encounter this issue as well