UNPKG

git-lite-cli

Version:

A lightweight CLI tool for seamless GitHub automationβ€”create, initialize, and push repositories with a single command.

240 lines (178 loc) β€’ 7.77 kB
# git-lite CLI, Simplifying GitHub from Your Terminal [![npm version](https://img.shields.io/npm/v/git-lite-cli.svg)](https://www.npmjs.com/package/git-lite-cli) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) # Hi, I'm Nikhil, Creator of git-lite CLI 🌟 GitLite CLI is a lightweight command-line automation tool built to simplify common Git and GitHub workflows. It removes repetitive steps by offering a clean, interactive interface for creating repositories, pushing code, and managing branches β€” all from your terminal. - No complex Git commands - No setup headaches - Just a clean, intuitive experience, perfect for beginners and experts alike. > Built with Node.js, this tool is made for developers who want to learn Git in a straightforward way. # Features - GitHub token-based authentication, stored securely on your device - GitHub user profile validation - **Push any local project to GitHub in seconds** - **Clone repositories using an interactive UI** - **Create GitHub repository (public/private) directly from the CLI** - **Branch management** - Create, switch, and manage Git branches - **Commit management** - Handle commits with ease - **Pull updates** - Fetch and merge the latest changes from remote repositories - Auto-generates `.gitignore` files - **Framework Detection** with smart `.gitignore` support - Clean, colorful CLI with loaders and prompts - Modular structure, easy to extend # New in v2.0.0 -- Latest - **Enhanced Repository Creation** (public/private) - **Improved Framework Detection** (Node.js, React, Python, Java...) - Auto `.gitignore` fallback for unknown projects - **Better Branch Management** - **Enhanced CLI Experience** with @clack/prompts # Installation & Usage ### Run Locally ```bash npx git-lite-cli ``` ### Or install globally: ```bash npm install -g git-lite-cli ``` Then run: ```bash git-lite-cli ``` ### Command Line Options ```bash git-lite-cli # Run the interactive CLI git-lite-cli --version # Show version number git-lite-cli -v # Show version number (short) git-lite-cli --help # Show help information git-lite-cli -h # Show help information (short) ``` ### First-Time Setup - You'll be prompted to enter a GitHub Personal Access Token. Generate your token here: [https://github.com/settings/tokens](https://github.com/settings/tokens) - Your token and GitHub profile will be safely saved. # Sample Workflow ```bash Welcome to Git-Lite CLI βœ” Welcome NikhilKatkuri! βœ” Choose what you want to do: Create a new Git repository βœ” Enter repository name: my-awesome-project βœ” Visibility: Public βœ… Repo created: https://github.com/NikhilKatkuri/my-awesome-project βœ” Choose what you want to do: Push code to the repository βœ” Enter the local project path: . βœ” Enter commit message: Initial commit from git-lite-cli βœ… Successfully pushed to GitHub: https://github.com/NikhilKatkuri/my-awesome-project.git ``` # Available Commands | Feature | Description | | ------------------ | ----------------------------------------------------- | | Create Repository | Initialize new Git repositories locally and on GitHub | | Push Code | Push local project to GitHub | | Pull Updates | Fetch and merge changes from remote repository | | Clone Repository | Clone a GitHub repo interactively | | Manage Commits | Handle commit operations | | Manage Branches | Create, switch, and manage Git branches | | Generate Gitignore | Generate `.gitignore` for your project | | Manage Profile | Configure and manage your GitHub profile | # Tech Stack - **Node.js** - Runtime environment - **TypeScript** - Type-safe JavaScript - **@clack/prompts** - Beautiful command-line prompts - **ESLint** - Code linting - **Prettier** - Code formatting # Development ### Prerequisites - Node.js (v14 or higher) - npm or yarn - Git - GitHub account ### Local Development Setup 1. **Clone the repository:** ```bash git clone https://github.com/NikhilKatkuri/git-lite-cli.git cd git-lite-cli ``` 2. **Install dependencies:** ```bash npm install ``` 3. **Build the project:** ```bash npm run build ``` 4. **Run in development mode:** ```bash npm run cli ``` ### Available Scripts - `npm run build` - Compile TypeScript to JavaScript - `npm run dev` - Watch mode for development - `npm start` - Run the compiled CLI - `npm run cli` - Run the CLI in development mode - `npm run format` - Format code with Prettier - `npm run format:check` - Check code formatting - `npm run lint` - Lint code with ESLint ## Project Structure ``` src/ β”œβ”€β”€ index.ts # Main entry point β”œβ”€β”€ auth/ # Authentication modules β”‚ β”œβ”€β”€ isAuth.ts # Authentication checker β”‚ └── profile.ts # User profile management β”œβ”€β”€ dir/ # Directory configuration β”‚ β”œβ”€β”€ config_dir.ts # Directory configuration β”‚ └── config_root.ts # Root configuration β”œβ”€β”€ services/ # Core services β”‚ β”œβ”€β”€ branch.ts # Branch operations β”‚ β”œβ”€β”€ cli.ts # CLI interface β”‚ β”œβ”€β”€ create.ts # Repository creation β”‚ β”œβ”€β”€ gitIgnoreGen.ts # .gitignore generation β”‚ └── push.ts # Push operations β”œβ”€β”€ tasks/ # Task handlers β”‚ β”œβ”€β”€ branchTask.ts # Branch task handler β”‚ β”œβ”€β”€ clone.ts # Clone task handler β”‚ β”œβ”€β”€ commit.ts # Commit task handler β”‚ β”œβ”€β”€ profileTask.ts # Profile task handler β”‚ └── pull.ts # Pull task handler β”œβ”€β”€ types/ # TypeScript type definitions β”‚ β”œβ”€β”€ RepoConfig.ts # Repository configuration types β”‚ └── userProfile.ts # User profile types └── utils/ # Utility functions β”œβ”€β”€ avatar.ts # Avatar utilities β”œβ”€β”€ crog.ts # Logging utilities β”œβ”€β”€ excuter.ts # Command execution β”œβ”€β”€ fetchUser.ts # User fetching β”œβ”€β”€ gcp.ts # Git command processor β”œβ”€β”€ greetings.ts # User greetings β”œβ”€β”€ ICN.ts # Internet connectivity β”œβ”€β”€ isGit.ts # Git repository checker └── repo.ts # Repository utilities ``` # Contributions Welcome! Git-Lite CLI is open-source and beginner-friendly. Contributions are welcome, whether it's: - Adding new features - Improving user experience - Fixing bugs - Suggesting ideas ### How to Contribute 1. Fork the repository 2. Create your feature branch (`git checkout -b feature/AmazingFeature`) 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`) 4. Push to the branch (`git push origin feature/AmazingFeature`) 5. Open a Pull Request Let's make Git easier and friendlier for everyone! ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. ## Author **NIKHIL KATKURI** - GitHub: [@NikhilKatkuri](https://github.com/NikhilKatkuri) ## Issues If you encounter any issues or have suggestions, please [open an issue](https://github.com/NikhilKatkuri/git-lite-cli/issues) on GitHub. --- **Links** [GitHub Repo](https://github.com/NikhilKatkuri/git-lite-cli) [npm Git-Lite CLI package](https://www.npmjs.com/package/git-lite-cli) [Demo Video - Coming Soon](#) --- If you find this project helpful, please consider giving it a star on GitHub!