# ngit-cli

> A collection of commands to add interactivity to git in the command line.

Latest version **1.4.0** (published 2025-12-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngit-cli
pnpm add ngit-cli
yarn add ngit-cli
bun add ngit-cli
```

Provides the command `ngit-cli`.

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2025-12-14 |
| First published | 2022-05-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >18.0.0 |
| Dependencies | 3 |
| Unpacked size | 32 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Thibaud Szymczak |
| Maintainers | thibaudszy |
| Keywords | git, cli, workflow |

## Links

- npm: https://www.npmjs.com/package/ngit-cli
- Repository: https://github.com/thibaudszy/ngit-cli
- Homepage: https://github.com/thibaudszy/ngit-cli#readme
- Issues: https://github.com/thibaudszy/ngit-cli/issues
- npm.io page: https://npm.io/package/ngit-cli

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^5.3.0
- [inquirer](https://npm.io/package/inquirer.md) ^9.1.4
- [clipboardy](https://npm.io/package/clipboardy.md) ^3.0.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.4.0 (latest) — 2025-12-14
- 1.3.1 — 2023-09-30
- 1.3.0 — 2023-09-30
- 1.2.0 — 2023-04-20
- 1.1.0 — 2022-05-26
- 1.0.5 — 2022-05-21
- 1.0.4 — 2022-05-17
- 1.0.3 — 2022-05-15
- 1.0.2 — 2022-05-14
- 1.0.1 — 2022-05-14
- 1.0.0 — 2022-05-14

## README

# NodeJS Git utilities

## Purpose

Enhance the usage of git in the command line. In general this is achieved by providing a list of options when not giving the required arguments to git commands. The scripts in this repo do not aim to do anything that can be achieved through git aliases.

Scripts that replace git commands (such as `checkout`) attempt to act like _superset_ commands, meaning that the `checkout` command can be used as the git equivalent. This is still not the case for all commands though.

## Install

Run:

`npm install -g ngit-cli`

in your terminal to install the package globally. You can then use the program using the `ngit-cli` in the terminal. As this can be a bit verbose, it is recommended to [create an alias](https://linuxhint.com/configure-use-aliases-zsh/) for it, such as `ngit`.

You will then be able to use the `ngit` command similarly to git for the supported commands (see below) in any repo.

## Usage

Running `ngit` without any arguments will display an interactive menu to select a command:

```
? Select a command
❯ add - Stage files interactively
  checkout - Switch branches interactively
  erase - Delete branches interactively
  rebase - Rebase onto a branch interactively
  stash - Stash changes interactively
  select-branch - Copy branch names to clipboard
  select-status - Copy file names to clipboard
```

## Commands

### checkout

Works like checkout but prints out a selectable list if no parameters are passed.

![ngit checkout screenshot](https://i.imgur.com/qnNyK3s.png)

Branches are sorted by the date of the last commit.

### erase

Shows a selectable list of branches you can delete. By default, it only deletes local branches but you can pass the `--all` or `-a` flag to also delete the branch(es) in the remote. This list is a multiselect, which allows deleting multiple branches at once.

![ngit erase](https://i.imgur.com/OIycm9j.png)

Branches are sorted by the creation date of the branch.

#### Flags

-   `--all` or `-a`: to also delete the branch in the remote.
-   `--gone` or `-g`: to only show branches with a remote status of `Gone` (meaning the remote branch was deleted)

**Warning**: currently the script can't erase the remote branch if it has a different name than the local branch

### rebase

Shows a selectable list of branches to rebase the current branch onto. The current branch is excluded from the list.

Branches are sorted by the date of the last commit.

### stash

Differs from the usual `git stash` command as not passing any arguments will print out the modified files (`git status`). You can then select the files that you want to stash.

![ngit stash](https://i.imgur.com/7GEW77X.png)

**Note:** Renamed/copied files cannot be selectively stashed due to git limitations. When renames are detected, you will be prompted to stash all changes instead.

#### Flags

-   `-m`: similar to `git stash push`, you can label your stash entry with `ngit stash -m <some-message>`

### add

Similar to `ngit stash`. Will print out a selectable list of files to stage.

![ngit add](https://i.imgur.com/ol6s6Bj.png)

### select-branch

Prints out a multi-select list of branches to copy to you clipboard. This allows to select a branch and then paste it in another git command.

### select-status

Similar to select-branch but with files in the working tree. Select the branches you want to copy to your clipboard and paste them in another git command.

## To do

I plan on adding more commands such as:

-   restore
-   cherry-pick

The scripts I make here are the ones I feel I'm missing when using git through the CLI.

## Contribution and feedback

Still very early days, so no contribution guide. But if you want to contribute or share some [feedback](https://www.youtube.com/watch?v=zi8ShAosqzI), feel free to reach out via [email](mailto:thibaud.szymczak+npm@gmail.com) or [github](https://github.com/thibaudszy/ngit-cli/discussions);

---
_Source: https://npm.io/package/ngit-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
