0.0.1 • Published 9 months ago
@imagine3d/isogit-cli v0.0.1
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 repositoryclone
- Clone a repository into a new directorystatus
- Show working tree statusadd
- Add file contents to the indexcommit
- Record changes to the repositoryremote
- Manage set of tracked repositoriesfetch
- Download objects and refs from another repositorypush
- Update remote refs along with associated objectspull
- Fetch from and integrate with another repositorybranch
- List, create, or delete branchescheckout
- Switch branches or restore working tree filestag
- Create, list, delete or verify tag objectslog
- 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
- Clone the repository:
git clone https://github.com/imagine-3d/isogit-cli.git
cd isogit-cli
- Install dependencies:
npm install
- Link the package globally:
npm link
Development Scripts
npm start
- Run the CLInpm test
- Run testsnpm run lint
- Run ESLintnpm run format
- Format code with Prettiernpm run dev
- Run with auto-reload (nodemon)
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- isomorphic-git - Core Git functionality
- Commander.js - CLI argument parsing
Author
Imagine 3D - @imagine-3d
Support
For support, please open an issue in the GitHub repository.
0.0.1
9 months ago