This guide is for developers who want to contribute to or modify the GitHub Cloner CLI tool.
github-cloner/
├── src/
│ ├── cli.js # Main CLI entry point
│ ├── github-cli-cloner.js # Core CLI logic
│ ├── axiosUtils.js # GitHub API interactions
│ ├── gitUtils.js # Git operations utilities
│ ├── branchMenu.js # Branch management interface
│ ├── utils.js # Helper functions
│ └── constants.js # Configuration constants
├── bin/
│ └── github-cloner.js # Binary executable
└── package.json
-
Clone the repository:
git clone git@github.com:relbns/github-cloner.git cd github-cloner -
Install dependencies:
npm install
-
Set up your GitHub token (required for development):
export GITHUB_TOKEN=your_token_here -
Run the CLI locally:
npm start
- Use ES modules (import/export)
- Maintain consistent error handling
- Add appropriate comments for complex logic
- Follow existing patterns for new features
- Make your changes
- Test locally using
npm start - Test global installation:
npm link clone # Test your changes npm unlink # When done testing
-
File Organization
- Add new utilities to appropriate utility files:
- Git operations in
gitUtils.js - API calls in
axiosUtils.js - General utilities in
utils.js
- Git operations in
- Add new constants to
constants.js
- Add new utilities to appropriate utility files:
-
Adding Commands
- Extend the CLI in
cli.js - Follow the Commander.js pattern
- Extend the CLI in
-
UI Components
- Use Inquirer.js for interactive prompts
- Maintain consistent styling with Chalk
- Use Ora for loading spinners
New releases are automatically published to npm after successful merging of pull requests through our CI/CD pipeline.
No manual release steps are required. Simply:
- Create your feature branch
- Make your changes
- Submit a pull request
- After approval and merge, the release will be automated
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
- Describe your changes
- Explain the problem you're solving
- Include any relevant issue numbers
- Test your changes thoroughly
-
Token Issues
# Verify token is set echo $GITHUB_TOKEN # Check permissions curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user
-
Installation Issues
# Clear npm cache npm cache clean --force # Reinstall dependencies rm -rf node_modules npm install
MIT © Ariel Benesh