gitdiagram icon indicating copy to clipboard operation
gitdiagram copied to clipboard

Option to use it as a cli for local repo

Open user753 opened this issue 1 year ago • 14 comments

I think it would be useful to have this tool as a cli

user753 avatar Dec 28 '24 07:12 user753

I would love to be able to point local repo in fact!

matbgn avatar Dec 28 '24 09:12 matbgn

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

ahmedkhaleel2004 avatar Dec 28 '24 11:12 ahmedkhaleel2004

Hey! I am down to work on this

SaqAsh avatar Dec 29 '24 18:12 SaqAsh

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.

martinrojas avatar Jan 16 '25 23:01 martinrojas

I second this and docker compose to host gitdiagram om my own server as well

Trubador avatar Feb 02 '25 14:02 Trubador

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.

mcascone avatar Mar 05 '25 19:03 mcascone

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?

tracure1337 avatar Mar 30 '25 13:03 tracure1337

I agree, I really want to use it as a CLI tool for my local repo.

yufansong avatar Mar 31 '25 22:03 yufansong

That'd be really cool.

chronikum avatar Apr 02 '25 07:04 chronikum

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.

yufansong avatar Apr 02 '25 07:04 yufansong

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.

yufansong avatar Apr 02 '25 10:04 yufansong

For local you can use this tool: https://github.com/XERO47/Agentic-Reviewer/

XERO47 avatar Apr 14 '25 13:04 XERO47

@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]

DanielRZapataS avatar Jun 11 '25 13:06 DanielRZapataS

@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

BruceChenZebra avatar Sep 07 '25 05:09 BruceChenZebra