Skip to content

๐ŸŽฎ A gamified CLI tool for developers that tracks coding activities and rewards XP for development milestones

License

Notifications You must be signed in to change notification settings

whoamaiii/devxp-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

DevXP CLI

๐Ÿš€ Gamify Your Development Experience - Track your coding progress, earn achievements, and level up your skills!

npm version License: MIT Node.js Version TypeScript

๐ŸŽฎ What is DevXP?

DevXP CLI is a command-line tool that gamifies your development workflow. It tracks your Git commits, coding sessions, and development activities to provide:

  • ๐Ÿ† Achievement System - Unlock achievements as you code
  • ๐Ÿ“Š XP & Leveling - Gain experience points and level up
  • ๐Ÿ“ˆ Statistics Tracking - Monitor your coding habits and productivity
  • ๐Ÿ… Leaderboards - Compare your progress with other developers
  • ๐ŸŽจ Beautiful Visualizations - See your progress in stunning terminal graphics
  • ๐Ÿ”ง Shell Integration - Automatic tracking with your favorite shell

๐Ÿ“ธ Screenshots

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                  DevXP Status                  โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘  Level 42 Developer                            โ•‘
โ•‘  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘  12,450 / 15,000 XP   โ•‘
โ•‘                                                โ•‘
โ•‘  ๐Ÿ”ฅ Current Streak: 7 days                     โ•‘
โ•‘  โšก Today's XP: 450                            โ•‘
โ•‘  ๐ŸŽฏ Next Achievement: Code Warrior (78%)       โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿš€ Quick Start

Installation

# Install globally via npm
npm install -g devxp-cli

# Or using yarn
yarn global add devxp-cli

# Or using pnpm
pnpm add -g devxp-cli

Initial Setup

# Run the interactive setup wizard
devxp install

# Or manually configure
devxp config set name "Your Name"
devxp config set shell bash  # or zsh, fish

Basic Usage

# Check your current status
devxp status

# View your achievements
devxp achievements

# Show statistics
devxp stats

# View leaderboard
devxp leaderboard

# Configure settings
devxp config

๐ŸŽฏ Features in Detail

Achievement System

Unlock achievements based on your coding activities:

  • First Commit - Make your first commit
  • Streak Master - Maintain a 30-day coding streak
  • Night Owl - Code after midnight
  • Early Bird - Start coding before 6 AM
  • Refactor King - Perform multiple refactoring commits
  • Bug Squasher - Fix bugs consistently
  • Documentation Hero - Write comprehensive documentation
  • And many more!

XP System

Earn XP through various activities:

Activity XP Earned
Git Commit 10-50 XP
Pull Request 100 XP
Code Review 75 XP
Issue Resolved 50 XP
Documentation 30 XP
Test Writing 40 XP

Shell Integration

Automatically track your development activities by integrating with your shell:

# For Bash
echo 'eval "$(devxp shell-integration bash)"' >> ~/.bashrc

# For Zsh
echo 'eval "$(devxp shell-integration zsh)"' >> ~/.zshrc

# For Fish
devxp shell-integration fish | source
echo 'devxp shell-integration fish | source' >> ~/.config/fish/config.fish

๐Ÿ› ๏ธ Advanced Configuration

Configuration File

DevXP stores configuration in ~/.config/devxp/config.json:

{
  "name": "John Doe",
  "theme": "neon",
  "notifications": true,
  "trackingEnabled": true,
  "excludePaths": ["/node_modules", "/.git"],
  "xpMultiplier": 1.0
}

Environment Variables

# Set custom config directory
export DEVXP_CONFIG_DIR="$HOME/.myconfig/devxp"

# Set custom database location
export DEVXP_DB_PATH="$HOME/.mydata/devxp.db"

# Enable debug mode
export DEVXP_DEBUG=true

Git Hooks Integration

Automatically track Git activities:

# Install Git hooks for current repository
devxp install --git-hooks

# Install globally for all repositories
devxp install --git-hooks --global

๐Ÿ“š API Reference

Commands

devxp status [options]

Display current level, XP, and recent activity.

Options:

  • -v, --verbose - Show detailed information
  • -j, --json - Output in JSON format

devxp achievements [options]

List all achievements and progress.

Options:

  • --unlocked - Show only unlocked achievements
  • --locked - Show only locked achievements
  • --recent - Show recently unlocked achievements

devxp stats [period]

Display coding statistics.

Arguments:

  • period - Time period: today, week, month, year, all (default: week)

devxp leaderboard [options]

Show leaderboard rankings.

Options:

  • --global - Show global leaderboard
  • --friends - Show friends leaderboard
  • --limit <n> - Number of entries to show

devxp config <action> [key] [value]

Manage configuration settings.

Actions:

  • get <key> - Get configuration value
  • set <key> <value> - Set configuration value
  • list - List all configuration
  • reset - Reset to defaults

๐Ÿงช Development

Prerequisites

  • Node.js >= 18.0.0
  • npm, yarn, or pnpm
  • Git

Setup Development Environment

# Clone the repository
git clone https://github.com/yourusername/devxp-cli.git
cd devxp-cli

# Install dependencies
npm install

# Run in development mode
npm run dev

# Run tests
npm test

# Build for production
npm run build

Project Structure

devxp-cli/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ index.ts              # CLI entry point
โ”‚   โ”œโ”€โ”€ commands/             # Command implementations
โ”‚   โ”‚   โ”œโ”€โ”€ status.command.ts
โ”‚   โ”‚   โ”œโ”€โ”€ achievements.command.ts
โ”‚   โ”‚   โ”œโ”€โ”€ stats.command.ts
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ modules/              # Core modules
โ”‚   โ”‚   โ”œโ”€โ”€ xp-system.ts     # XP calculation logic
โ”‚   โ”‚   โ”œโ”€โ”€ achievements.ts   # Achievement system
โ”‚   โ”‚   โ”œโ”€โ”€ database.ts       # SQLite database
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ types/                # TypeScript definitions
โ”‚   โ””โ”€โ”€ utils/                # Utility functions
โ”œโ”€โ”€ tests/                    # Test files
โ”œโ”€โ”€ docs/                     # Documentation
โ””โ”€โ”€ package.json

Available Scripts

Script Description
npm run build Build for production
npm run dev Run in development mode
npm run test Run all tests
npm run test:watch Run tests in watch mode
npm run test:coverage Generate coverage report
npm run lint Lint code
npm run format Format code with Prettier

Creating Custom Commands

// src/commands/mycommand.command.ts
import { Command } from '../types/command.js';
import { logger } from '../utils/logger.js';

export class MyCommand implements Command {
  readonly name = 'mycommand';
  readonly description = 'Description of my command';
  readonly aliases = ['mc'];
  
  async execute(args: ReadonlyArray<string>): Promise<void> {
    logger.info('Executing my command');
    // Your implementation here
  }
}

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

  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

๐Ÿ“ Changelog

See CHANGELOG.md for a list of changes.

๐Ÿ› Bug Reports

Found a bug? Please open an issue with a detailed description.

๐Ÿ’ก Feature Requests

Have an idea? We'd love to hear it! Open an issue with the enhancement label.

๐Ÿ“„ License

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

๐Ÿ™ Acknowledgments

๐Ÿ“ง Contact


Made with โค๏ธ by developers, for developers

โญ Star us on GitHub โ€” it helps!

About

๐ŸŽฎ A gamified CLI tool for developers that tracks coding activities and rewards XP for development milestones

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published