Skip to content

KongGithubDev/kgit-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kgit-cli

A fast, human-friendly Git CLI helper

npm version npm downloads license

Add, commit, push — all in one command.


Installation

npm install -g kgit-cli
# or
yarn global add kgit-cli

Requires Node.js ≥ 14 and git installed on your system.


Quick Start

# Stage everything, commit, and push
kgit -a -m "feat: add dark mode"

# Stage specific files, commit, and push
kgit src/index.js styles/app.css -m "fix: responsive layout"

# Pull latest changes
kgit --pull

# Check status
kgit -s

Commands

Commit & Push

Command Description
kgit -a -m "msg" Stage all → commit → push
kgit file1 file2 -m "msg" Stage files → commit → push
kgit --add-only -a Stage all, then stop
kgit --commit-only -a -m "msg" Stage + commit, skip push
kgit --push Push current branch
kgit --push --force Force push
kgit --pull Pull current branch

Info

Command Description
kgit -s Git status
kgit -l Git log — last 20 commits (graph)
kgit diff Show unstaged diff
kgit diff --cached Show staged diff
kgit diff <file> Diff a specific file
kgit -v Show kgit-cli version

Branch

Command Description
kgit branch List all branches
kgit branch <name> Create and switch to new branch
kgit switch <name> Switch to an existing branch
kgit merge <branch> Merge branch into current
kgit --delete-branch <name> Delete a local branch

Stash

Command Description
kgit stash Stash working changes
kgit stash pop Apply the latest stash
kgit stash list List all stashes

Tags

Command Description
kgit tag List all tags
kgit tag <name> Create a lightweight tag

Repo Setup

Command Description
kgit --init Initialize a git repository
kgit --clone <url> Clone a repository
kgit --remote Show remote URLs
kgit --set-remote [url] Add or update origin
kgit --remove-git [--force] Remove .git folder

Undo / Rollback

Command Description
kgit --unstage [file] Unstage a file (or all)
kgit --untrack <file> Remove file from git tracking
kgit --undo-last Soft reset HEAD~1 (keep changes)
kgit --undo-hard Hard reset HEAD~1 (discard changes)
kgit --revert-last Create a revert commit for HEAD
kgit --reset <ref> Soft reset to a commit or ref
kgit --reset-hard <ref> Hard reset to a commit or ref
kgit --restore <file> Discard working file changes
kgit --restore <file> --from <ref> Restore a file from a specific commit

Meta

Command Description
kgit update Self-update kgit-cli (auto-detects npm/yarn)
kgit --help Show help

Examples

# Full workflow: branch → code → commit → push
kgit branch feature/login
# ... write code ...
kgit -a -m "feat: add login page"

# Switch to main and merge
kgit switch main
kgit merge feature/login
kgit --push

# Temporarily stash, fix something, then restore
kgit stash
kgit switch hotfix/crash
# ... fix the bug ...
kgit -a -m "fix: crash on startup"
kgit switch feature/login
kgit stash pop

# View staged changes before committing
kgit diff --cached

# Undo the last commit (keep changes)
kgit --undo-last

# Restore a file to its state 2 commits ago
kgit --restore src/api.js --from HEAD~2

# Tag a release
kgit tag v1.0.0
kgit --push

# Self-update
kgit update

Why kgit?

  • Zero dependencies — uses only Node.js built-ins
  • Fast startup — no transpilation, no heavy frameworks
  • Works everywhere — Windows, macOS, Linux
  • Smart defaults — sets upstream on first push automatically
  • One command — no more chaining git add && git commit && git push

License

MIT © Watcharapong Namsaeng

About

Fast git helper CLI — add, commit, push in one command

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors