1.0.2 ⢠Published 12 months ago
@rightalx/gitfolio-extract v1.0.2
GitFolio-Extract š
Extract GitHub projects information into a structured JSON format for your portfolio website.
Features āØ
- š Simple GitHub authentication via browser
- š Extracts repository details including:
- Basic information (name, description, URL)
- Statistics (stars, forks, last updated)
- Technical details (languages used)
- Repository content (README)
- š¾ Saves data in a clean JSON format
- š ļø Easy to use CLI interface
Installation š¦
# Install globally using npm
npm install -g @rightalx/gitfolio-extract@latest
# Or using pnpm
pnpm add -g @rightalx/gitfolio-extract@latest
# Or using yarn
yarn global add @rightalx/gitfolio-extract@latestUsage šØ
After installation, you can use the CLI directly:
# Configure GitHub authentication
gitfolio-extract configure
# Extract repository data (saves to current directory as portfolio.json)
gitfolio-extract extract
# Extract to custom location (specify full path or relative to current directory)
gitfolio-extract extract -o ./my-portfolio.json
gitfolio-extract extract -o C:/Users/username/Documents/my-portfolio.json
# Show help
gitfolio-extract --helpOutput Location š
- When using
./my-portfolio.json, the file is saved in your current working directory - You can use absolute paths like
C:/path/to/my-portfolio.json - If the specified directory doesn't exist, it will be created automatically
The tool will save:
- Your GitHub authentication securely in your system's config directory
- The portfolio data in JSON format at your specified location (or
./portfolio.jsonby default)
Output Format š
The tool generates a JSON file with the following structure:
{
"metadata": {
"generated": "2024-01-20T12:00:00Z",
"username": "yourusername",
"totalRepos": 10
},
"repositories": [
{
"basic": {
"name": "repo-name",
"description": "Repository description",
"url": "https://github.com/user/repo",
"homepage": "https://project-homepage.com"
},
"stats": {
"stars": 5,
"forks": 2,
"lastUpdated": "2024-01-19T10:30:00Z"
},
"technical": {
"languages": ["TypeScript", "JavaScript"],
"techStack": []
},
"content": {
"readme": "# Project README content..."
}
}
]
}Development š ļø
Project Structure
gitfolio-extract/
āāā src/
ā āāā commands/
ā ā āāā configure.ts # Authentication command
ā ā āāā extract.ts # Data extraction command
ā āāā services/
ā ā āāā github.service.ts # GitHub API interactions
ā ā āāā repository.service.ts # Repository data handling
ā āāā index.ts # CLI entry point
āāā package.json
āāā tsconfig.jsonBuilding
# Build the project
pnpm build
# Development with watch mode
pnpm devContributing š¤
Contributions are welcome! Please feel free to submit a Pull Request.
- 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 š
- Built with TypeScript
- Uses GitHub's OAuth Device Flow for authentication
- Powered by Octokit for GitHub API interactions