An open API service indexing awesome lists of open source software.

https://github.com/whoamaiii/devxp-cli

๐ŸŽฎ A gamified CLI tool for developers that tracks coding activities and rewards XP for development milestones
https://github.com/whoamaiii/devxp-cli

cli developer-tools gamification git-hooks npm-package productivity typescript xp-system

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# DevXP CLI

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

[![npm version](https://img.shields.io/npm/v/devxp-cli.svg)](https://www.npmjs.com/package/devxp-cli)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Node.js Version](https://img.shields.io/node/v/devxp-cli.svg)](https://nodejs.org)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue.svg)](https://www.typescriptlang.org/)

## ๐ŸŽฎ 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

```bash
# 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

```bash
# 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

```bash
# 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:

```bash
# 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`:

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

### Environment Variables

```bash
# 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:

```bash
# 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 ` - Number of entries to show

#### `devxp config [key] [value]`
Manage configuration settings.

**Actions:**
- `get ` - Get configuration value
- `set ` - 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

```bash
# 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

```typescript
// 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): Promise {
logger.info('Executing my command');
// Your implementation here
}
}
```

## ๐Ÿค Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) 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](CHANGELOG.md) for a list of changes.

## ๐Ÿ› Bug Reports

Found a bug? Please [open an issue](https://github.com/yourusername/devxp-cli/issues) with a detailed description.

## ๐Ÿ’ก Feature Requests

Have an idea? We'd love to hear it! [Open an issue](https://github.com/yourusername/devxp-cli/issues) with the `enhancement` label.

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ™ Acknowledgments

- Built with [Commander.js](https://github.com/tj/commander.js/)
- Terminal graphics powered by [Chalk](https://github.com/chalk/chalk) and [Boxen](https://github.com/sindresorhus/boxen)
- Database management with [Better SQLite3](https://github.com/WiseLibs/better-sqlite3)
- Inspired by gaming achievement systems

## ๐Ÿ“ง Contact

- **Author**: Your Name
- **Email**: your.email@example.com
- **Twitter**: [@yourhandle](https://twitter.com/yourhandle)
- **Website**: [yourwebsite.com](https://yourwebsite.com)

---

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


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