git-cli a rust package for auto-gen of git commands using ollama llm
Learn to generate Git and GitHub commands from natural language using a local LLM. This tool translates your plain-English requests into executable commands, saving you time and guesswork.
Overview
A CLI tool that translates natural-language task descriptions into git commands using a local Ollama LLM. It is a command-line tool that turns plain-English task descriptions into exact git and gh commands using a local LLM. You run something like git-cli “show status” or git-cli “create a branch called feature/auth” and it gathers context from your repo (branch, status, log, remotes, open PRs), sends that to a model on Ollama, mistral.rs, or an OpenAI-compatible server like llama-server, and prints commented, syntax-highlighted commands you can copy or run with –execute. It routes simple tasks to a fast model and harder ones (rebase, squash, multi-PR workflows) to a smarter model, uses a built-in shortcut for basic create a pr (no LLM), blocks destructive or injected commands unless you pass –force, and is configurable via ~/.git-cli.toml. It works in any terminal and is aimed at developers who want git/gh help without leaving the shell or guessing flags.
Video
Transcript
Generated about 2 months ago
Summary
Generating a talk summary...
View full transcript
Speaker 0: So, I'm glad tool as soon Asha presenter because I don't really have much Event. Like, I mean, it's gonna be 15 minutes and that's it. But, what I'm presenting here today is, something known as KidCLI. It's a Rust based CLI tool that allows you to generate Git workflows with, natural language, literally natural language text, connecting tool Ollama, which is your back end local, LLM that you would connect to on your laptop. Why would I use this instead of an LLM directly?
Speaker 0: I think that was the 1st question that I was trying to answer myself. Why would I build a tool? So I think the idea is that Enelagram excels at, taking your language, bringing out it doesn't understand your repository Date. And, without structured input and output, it's very hard to give it context every time that you're trying to get information in and out of it. And sometimes Fair are some commands which are, I call them dangerous commands, but these are basically when you try to force push or, you know, you rust hard or something like that, which is not something that you wanna do.
Speaker 0: So and and and and and and LLM can execute these commands without any if you give it all authority to do so, just like an, whether a Cursor agent or any other agent would do, it will automatically execute this without, you know, checking with human input. And every time you wanna give something to Git in terms of Doors your requirement can change. Your, you CarNow, what you're trying to, run as a Git command cannot I mean, for the standard DEMOS status, June know, a set of 3 more commands you can run the git CLI yourself, the git command. And but when it gets a little more complicated, when you're trying to make releases, when you're trying to, have a little bit of intelligence added to that git command. This is what I'm trying to solve with this git-cli.
Speaker 0: It's it's based of Rust. It's uses Jun. It is, it uses some other libraries to connect to the, LLM git-cli, and also uses connects CLI interprets. It determines the output, and then it publishes the result. So what I was trying to say here is that, so why not an LLM only?
Speaker 0: It doesn't have a schema. It doesn't have any it it comes up with hallucinations, which is it was very annoying, especially the local models that you would use Event if they are the smaller models. There's no reprocess. There's no schema for input and output. There's no accountability, and there's no repeatability of the same output, per se.
Speaker 0: Even if your temperature is set to a certain degree, it it still doesn't give you deterministic results. AI I'm looking for is when I use the CLI as a tool, instead of manually pasting each 1 of your content messages, which, which is okay. But the idea is to kind of Date do the patch directly with the CLI tool. You have a standard schema. You have a set of subcommands, which have been tested and which actually work.
Speaker 0: There's less hallucination. And then you you can use the git-cli to even run gh commands, and a repeatable automated way of performing, git commands, which is which is useful if you're trying to build author mergers within your pipeline or your CICD AI, in a way that is automated way Jun can execute Rust commands directly from, you know, programmatic, in a programmatic way. So it's it's a package that's that's really available for use for anybody. It's on, it's a crate. It's, and you can download it from there.
Speaker 0: So, basically, you stage your changes. You let CLI commit to your file, for example, and then LLM drafts the commit message, the PR text, and then it and it and you just Concludes it, through the, the CLI command. So then, this is my presentation. I don't know.
Speaker 1: And then the resources
Speaker 0: were on creates.io. If you're looking for it, I'll just give you a quick demo of what I'm trying to say here. I'm I'm sorry. I didn't prepare much for this presentation. I just kinda put it on a slide.
Speaker 0: But can you see my screen? Do you know? So, so
Speaker 1: you install it with Kavo,
Speaker 0: just like you would normally do. And there's a GitHub page, as well if you wanted to browse. So you can install it with, Cargo. You can add it as a library in your, whatever binary that you're trying to build. It builds over llama as well as llama cpp, which is basically, like, the, the c plus plus server.
Speaker 0: And then you have a couple of, git-cli commands that help you with, check if your, your CLI is ready to receive its l CLI checks your git. Git, your git binary. It checks your GH binary, and it also checks whether the alarm can be reachable at a particular the default port. And then the installation is pretty straightforward. You can run directly with this, giving it the tool path.
Speaker 0: And then the usage again is also very simple. I have something like show status. I can give it the model directly AI I can configure the, config properties to use a default model. So I can run this as show status, and it's and it takes the context of the repository that you have checked Jun. And then it gives you the list of all the commands that you can run towards finding, the when I say show status.
Speaker 0: And if you Asha execute it, you just give it the AI, execute flag, and then it just runs it. And if it errors out and you wanna force it, you would do a Folder talk. Do that.
Speaker 1: Yep. I don't know if it's better or worse. Any better?
Speaker 0: Okay. So, yeah, I, so Fair example, if I wanna see give me the last 10 minutes. Now why would I use, this versus the LLM again is, you're reducing the number of tokens, that you would use either with, Cursor or whichever product that you wanna buy. But this is this is an alternative. AI I I wouldn't recommend that you go off CarNow or you go off any of the, clawed kind Development, but this is just you, if you have enough hardware to support Ollama, you should be able use a low binary.
Speaker 0: You know, the QEM is 2.5 is pretty low in binary. I think it's about a few gigs. And you just install it just like you would run so if I have Ollama, and then you would see the list of models that you can use, and you can use as many models as you want. I mean, whatever your laptop supports, or your hardware supports. And then you can just uses that as a config for the model that you wanna run it against.
Speaker 0: St, yeah, I mean, there are a few, I mean, there are options. You basically for people who don't wanna really remember the commands and don't wanna spend the time to kind of understand what the structure is and figure out how many 10 commands you have to run to make make an auto merge or have, you know, handle the rebase. And I don't know. As a developer, I think it was a little complicated every time to kind of figure that out and tool sure everything works correctly. So the idea was to kind of build something that, that works consistently.
Speaker 0: And, so I don't wanna do this, but, let's switch.
Speaker 1: So
Speaker 0: there's a list of branches. I can create my own branch. And and the idea is to
Speaker 1: just
Speaker 0: take away the leave the intelligence for the LLM to figure out what what it needs to do to kind of to complete your task. And, so if I were to say, Jun make your life a little easier, So in order might be, you can also create a pull request using the geish tool. There's a whole bunch of commits you can try or,
Speaker 1: yeah, just try something.
Speaker 0: You can go at
Speaker 1: it
Speaker 0: because the LLM is your intelligence bot really Fair, and your commands are basically just plain English. Give it its, give it tool task, and it doesn't work. That's really what I had. AI something like this. Yeah.
Speaker 0: Yeah. I mean, I didn't have any connection with 0. So, yeah, that's what I built. I can walk through the code if anybody's interested in learning Rust or Join Rust. Yeah.
Speaker 0: So, there's a CLI, the main file, which, the which really is the CLI input. It takes all the arguments. Each 1 is a subcommand. It identifies whether it's a git command or a g h command. This is just reading the shell.
Speaker 0: Config is where I'm giving the properties for the LLM. AI default is 2.5 WIM, on the local, LLM port. And then, it kind of identifies what the config is if you give it a specific config command. Config, and then you can give it the model, And then, context is where it identifies what the context is with the command that you're giving. It also identifies if if j h is not available or if your Doors binary is not available.
Speaker 0: And then it figures out, the the executor is the 1 that actually figures out the commands, the talk commands, which ones are, I I wouldn't say bad, but, destructive enough. And then it it feeds it to the LLM where it sanitizes the response, and then it figures out, how to print it. And it does it on a, you know, just like a chat interface. There's a lot of code here, but then the LLM is where Louis, there's a prompt that I've designed, which, which has certain rules of how each command so you should not be able to run, you know, just got the CarNow rails and everything are plugged into this prompt. Safety rules, vulnerabilities, making sure, you know, certain, words, certain characters, and certain things are blocked.
Speaker 0: Jun then Event examples of each 1 of the tasks, so that it Doors it knows exactly what to do. The LLM is the 1 which has the Louis, which, which connect to the file, the AI interface over the APIs, and it gives the back and forth Community, input and out. And then, the main is, AI I uses for, the the server, LLM server. I haven't tested this very well, but it it apparently works as somebody else was trying it on, somebody I know has appeared, was trying git, and he told me that it wasn't working when he had, the the LLM server running. So I had to make a model for that, a model.
Speaker 0: Sorry. But it works. Last time off on Time. And I think that's it. It's as simple as that.
Speaker 0: The repository is available online. I think I have
Speaker 1: it somewhere here. Yeah.
Speaker 0: Date content. If you're willing to contribute, please create PRs. If you find bugs, if you wanna take a whirl at it, please feel free to use it.
Speaker 1: Thank you AI.