0.0.1 • Published 9 months ago

@imagine3d/isogit-cli v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

isogit-cli

A JavaScript implementation of Git CLI using isomorphic-git. This lightweight, cross-platform Git client provides core Git functionality through a familiar command-line interface.

Features

  • Pure JavaScript implementation
  • Familiar Git command syntax
  • Cross-platform compatibility
  • Built on isomorphic-git
  • Modern async/await API
  • Comprehensive command support

Installation

Install globally via npm:

npm install -g isogit-cli

Or install locally in your project:

npm install isogit-cli

Supported Commands

  • init - Initialize a new Git repository
  • clone - Clone a repository into a new directory
  • status - Show working tree status
  • add - Add file contents to the index
  • commit - Record changes to the repository
  • remote - Manage set of tracked repositories
  • fetch - Download objects and refs from another repository
  • push - Update remote refs along with associated objects
  • pull - Fetch from and integrate with another repository
  • branch - List, create, or delete branches
  • checkout - Switch branches or restore working tree files
  • tag - Create, list, delete or verify tag objects
  • log - Show commit logs

Usage

# Initialize a new repository
jsgit init

# Clone a repository
jsgit clone https://github.com/user/repo [directory]

# Check status
jsgit status

# Add files
jsgit add <files...>

# Commit changes
jsgit commit -m "commit message"

# Push changes
jsgit push -r origin -b main

# Pull changes
jsgit pull

# List branches
jsgit branch

# Create and checkout new branch
jsgit checkout -b feature-branch

# Show commit history
jsgit log

Command Details

clone

jsgit clone <repository> [directory]

Options:
  --depth <depth>     Create a shallow clone with specified depth (default: 1)
  --branch <branch>   Clone specific branch (default: main)
  --progress         Show progress status

commit

jsgit commit -m "message"

Options:
  -m, --message <message>   Commit message
  --amend                   Amend previous commit

push

jsgit push

Options:
  -r, --remote <name>   Remote name (default: origin)
  -b, --branch <name>   Branch name (default: main)
  --force               Force push
  --tags                Push tags

See jsgit help <command> for detailed information about specific commands.

Development

Prerequisites

  • Node.js >= 14.0.0
  • npm >= 6.0.0

Setup

  1. Clone the repository:
git clone https://github.com/imagine-3d/isogit-cli.git
cd isogit-cli
  1. Install dependencies:
npm install
  1. Link the package globally:
npm link

Development Scripts

  • npm start - Run the CLI
  • npm test - Run tests
  • npm run lint - Run ESLint
  • npm run format - Format code with Prettier
  • npm run dev - Run with auto-reload (nodemon)

Contributing

  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

License

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

Acknowledgments

Author

Imagine 3D - @imagine-3d

Support

For support, please open an issue in the GitHub repository.