1.0.2 • Published 3 months ago

gitweaver v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months ago

GitWeaver 📚✨

GitWeaver is a robust and versatile CLI tool designed to simplify and enhance Git workflows. With an emphasis on productivity and developer experience, GitWeaver helps automate common Git tasks such as branch creation, remote management, and streamlined commits, making your version control operations faster, cleaner, and more efficient. 🚀

Key Features 🌟

  • Branch Management: Effortlessly create and switch between branches with validation and standardized naming conventions.
  • Commit Automation: Validate commit messages and stage changes interactively.
  • Remote Management: Add, verify, and manage Git remotes seamlessly.
  • Customizable Options: Define branch types and remotes with flexibility.
  • Interactive Prompts: Guides you through operations with clear, user-friendly prompts.
  • Error Handling: Provides detailed error messages for common Git pitfalls.

Installation 🛠️

To install GitWeaver globally as an npm package:

npm install -g gitweaver

Usage 🎯

GitWeaver provides a CLI interface with a range of commands to manage your Git workflow efficiently.

1. Branch Command 🏷️

The gitweaver-branch command allows you to create and switch to a new branch with the specified name and type.

Syntax:

gitweaver-branch -n <branch-name> -t <branch-type>

Options:

  • -n, --name <name>: Specify the branch name.
  • -t, --type <type>: Specify the branch type. Accepted values:
    • feature
    • bugFix
    • hotFix
    • release

Examples:

gitweaver-branch -n feature-login -t feature
gitweaver-branch -n bugfix-issue123 -t bugFix
gitweaver-branch -n hotfix-critical-bug -t hotFix
gitweaver-branch -n release-v1.0.0 -t release

Help Command:

gitweaver-branch --help

Outputs:

Usage: gitweaver-branch -n <branch-name> -t <branch-type>
Example: gitweaver-branch -n feature-branch -t feature
Example: gitweaver-branch -n bugfix-branch -t bugfix
Example: gitweaver-branch -n hotfix-branch -t hotfix
Example: gitweaver-branch -n release-branch -t release

2. Remote Command 🌐

Manage and add remote repositories with ease using the gitweaver-remote command.

Syntax:

gitweaver-remote -n <remote-name> -u <remote-url>

Options:

  • -n, --name <name>: Specify the remote name.
  • -u, --url <url>: Specify the remote URL.

Examples:

gitweaver-remote -n origin -u https://github.com/your-repo.git

3. Push Command 🔼

Push changes to a specified remote and branch interactively using the gitweaver-push command.

Syntax:

gitweaver-push -r <remote>

Options:

  • -r, --remote <remote>: Specify the remote URL.

Examples:

gitweaver-push -r "https://github.com/your-repo.git"
gitweaver-push  # Uses the default remote

Help Command:

gitweaver-push --help

Outputs:

Usage: gitweaver-push [options]

Push changes to remote branch

Options:
  -r, --remote <remote>  Remote URL
  -h, --help             display help for command

Examples:
  $ gitweaver-push -r "git url", "Using a git url directly",
  $ gitweaver-push , "Using already saved urls in the local repo"

4. Commit Command 📝

Commit staged changes with a validated commit message using the gitweaver-commit command.

Syntax:

gitweaver-commit -m <commit-message>

Options:

  • -m, --message <message>: Specify the commit message.

Examples:

gitweaver-commit -m "fix: corrected a bug in user authentication"

File Structure 🗂️

.gitweaver/
├── commands/
│   ├── branch.ts       # Handles branch creation and switching
│   ├── commit.ts       # Automates commit processes
│   ├── push.ts         # Pushes changes interactively
│   └── remote.origin.ts # Manages Git remotes
├── utils/
│   ├── logger.ts       # Logging utilities (success, error, info)
│   ├── validator.ts    # Validation utilities
│   ├── branchName.ts   # Handles branch name formatting
│   └── interfaces/
│       └── type.interface.ts # Defines branch types
├── index.ts            # Entry point for the CLI
└── package.json        # Project metadata and npm configuration

Development Setup 🧑‍💻

  1. Clone the repository:
git clone https://github.com/big-prince/gitweaver.git
cd gitweaver
  1. Install dependencies:
npm install
  1. Run the CLI locally:
npm start -- gitweaver-branch -n <branch-name> -t <branch-type>
  1. Run tests:
npm test

Contributing 🤝

We welcome contributions to improve GitWeaver! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or fix:
git checkout -b feature/my-feature
  1. Commit your changes:
git commit -m "feat: added awesome new feature"
  1. Push to your fork:
git push origin feature/my-feature
  1. Open a pull request.

License 📜

This project is licensed under the MIT License. See the LICENSE file for details.

Feedback and Support 💬

For feedback, feature requests, or support, feel free to open an issue on GitHub or reach out to us at support@gitweaver.com.


Unleash the full potential of Git with GitWeaver—your trusty companion for streamlined version control! 🌟