Complete documentation for the Git Fantasy League command-line interface (gfl).
- Installation
- Usage Modes
- Interactive Mode
- Command Mode
- Core Commands
- Advanced Commands
- Configuration
- Examples
- Troubleshooting
# Check Node.js version (requires 18+)
node --version
# Check npm version
npm --version
# Check git version
git --version# Clone the repository
git clone https://github.com/YOUR_USERNAME/fantasy-football-league.git
cd fantasy-football-league
# Install dependencies
npm install
# Make the CLI globally available
npm link
# Now you can use 'gfl' from anywhere!
gfl --version# Initialize configuration interactively
gfl init
# Or specify configuration directly
gfl init --github-user YOUR_USERNAME --team-name "Code Warriors FC"The gfl CLI can be used in two modes:
Launch an interactive session with React-based UI components:
# Start interactive mode
gfl
# Or explicitly
gfl interactiveThe CLI now uses Ink - a React framework for building command-line interfaces, providing:
- Real-time UI updates without screen flicker
- Smooth animations and transitions
- React component architecture
- Responsive keyboard navigation
Execute specific commands directly from the terminal:
# Direct command execution
gfl status
gfl transfer --out "Sterling" --in "Saka"
gfl validate$ gfl
┌─────────────────────────────────────────┐
│ Git Fantasy League - Interactive CLI │
│ Season 2024/25 │
└─────────────────────────────────────────┘
Welcome, @username!
Team: Code Warriors FC
Gameweek: 5
What would you like to do?
❯ 👀 View Team Status
🔄 Make Transfers
📊 Check League Standings
⏰ View Deadlines
🎯 Set Captain
💎 Use Chip
⚙️ Settings
❌ Exit
Use arrow keys to navigate, Enter to select- React-based UI with
inkfor dynamic interfaces - Component architecture for reusable UI elements
- Real-time updates without screen clearing
- Smooth animations with
ink-spinnerfor loading states - Gradient text with
ink-gradientfor visual appeal - Text input components with
ink-text-inputfor user input - Select menus with
ink-select-inputfor navigation - Box layouts with
ink-boxfor structured layouts - Big text banners with
ink-big-textfor titles - Links with
ink-linkfor clickable elements
$ gfl create-team
⚽ Git Fantasy League - Team Creation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎮 Let's create your team!
? Enter your team name: › Code Warriors FC
? Select your team colours: ›
❯ 🔴 Red & White
🔵 Blue & White
💛 Yellow & Black
💚 Green & White
⚫ Black & Gold
🟣 Purple & Orange
(Custom colours...)
Building squad...
💰 Budget: £100.0m
Selecting Goalkeepers (0/2)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
? Search for goalkeeper: › Alis_
↑/↓ Navigate • Enter Select • Tab Autocomplete
🥅 Alisson (LIV)
£5.5m • Form: 8.2 • Owned: 45.2%
❯ 🥅 Alisson Ramses (FUL)
£4.0m • Form: 5.1 • Owned: 2.1%
[Live budget tracking shown]
💰 Spent: £5.5m / £100.0m
📊 Squad: 1/15 players$ gfl transfer
🔄 Transfer Market - Gameweek 6
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Your Squad (Tap player to transfer out)
┌─────┬──────────────┬──────┬───────┬────────┬──────┐
│ │ Player │ Team │ Price │ Points │ News │
├─────┼──────────────┼──────┼───────┼────────┼──────┤
│ 🥅 │ Alisson │ LIV │ £5.5m │ 42 │ ✅ │
│ 🥅 │ Ramsdale │ ARS │ £4.5m │ 38 │ ✅ │
│ 🛡️ │ TAA │ LIV │ £7.0m │ 51 │ ✅ │
│ 🛡️ │ Saliba │ ARS │ £5.0m │ 48 │ ✅ │
│ ⚡ │ Sterling │ CHE │ £10.0m│ 28 │ 🤕 │
└─────┴──────────────┴──────┴───────┴────────┴──────┘
? Select action: ›
❯ 🔄 Make Transfer
📈 View Player Stats
💹 Price Changes
🔮 Run Simulation
✅ Confirm Transfers
❌ Cancel
Free Transfers: 2 | Extra: -4pts eachgfl <command> [options] [arguments]gfl --help # Show help
gfl --version # Show version
gfl --config <path> # Use custom config file
gfl --no-color # Disable colored output
gfl --quiet # Minimal output
gfl --verbose # Detailed output
gfl --json # JSON output for scriptingView your team and league position.
# Basic status
gfl status
# Specific gameweek
gfl status --gameweek 5
# Detailed view with formations
gfl status --detailed
# JSON output for scripting
gfl status --json
# Compact view
gfl status --compactMake player transfers.
# Interactive transfer mode
gfl transfer
# Direct transfer (non-interactive)
gfl transfer --out "Sterling" --in "Saka"
# Using player IDs
gfl transfer --out player_123 --in player_456
# Plan mode (preview without saving)
gfl transfer --plan
# With wildcard chip
gfl transfer --chip wildcard
# Batch transfers from file
gfl transfer --batch transfers.jsonCreate your initial team.
# Interactive team creation
gfl create-team
# From template
gfl create-team --template balanced
# Import from JSON
gfl create-team --import team.json
# Quick random team (for testing)
gfl create-team --random --budget 100Validate team against rules.
# Basic validation
gfl validate
# Auto-fix issues
gfl validate --fix
# Verbose output
gfl validate --verbose
# Check specific team file
gfl validate --file teams/username/team.jsonShow deadlines and fixtures.
# Next deadline
gfl deadline
# All future deadlines
gfl deadline --all
# With fixtures
gfl deadline --fixtures
# Specific gameweek
gfl deadline --gameweek 10Manage captaincy.
# Set captain interactively
gfl captain
# Direct set
gfl captain --set "Haaland"
# Set vice-captain
gfl captain --vice "Salah"
# Get AI suggestions
gfl captain --suggest
# Show popular captains
gfl captain --popularActivate special chips.
# View available chips
gfl chip
# Activate wildcard
gfl chip activate wildcard
# Check chip status
gfl chip status
# Plan chip usage (preview)
gfl chip plan triple-captainRun simulations.
# Basic simulation
gfl simulate
# With specific captain
gfl simulate --captain "Haaland"
# Monte Carlo simulation (1000 runs)
gfl simulate --monte-carlo
# Test formation change
gfl simulate --formation "3-5-2"
# Include planned transfers
gfl simulate --with-transfersLeague management.
# View standings
gfl league standings
# Join a league
gfl league join ABC123
# Create private league
gfl league create --name "DevOps Champions"
# League info
gfl league info --code ABC123
# Compare with rival
gfl league compare @rival_usernameView historical data.
# Season summary
gfl history season
# Specific gameweek
gfl history gameweek 5
# Transfer history
gfl history transfers
# Points progression graph
gfl history graph
# Export to CSV
gfl history export --format csvSynchronize with GitHub.
# Pull latest changes
gfl sync pull
# Push your changes
gfl sync push
# Full sync (pull, merge, push)
gfl sync
# Create PR for changes
gfl sync pr --title "GW6 Transfers"The CLI uses a hierarchical configuration system:
- Global Config:
~/.gflrc - Project Config:
./gflrc.json - Environment Variables:
GFL_* - Command Line Options: Highest priority
{
"github": {
"username": "YOUR_USERNAME",
"token": "ghp_...",
"defaultBranch": "main"
},
"preferences": {
"interactive": true,
"colorOutput": true,
"confirmTransfers": true,
"autoValidate": true,
"timezone": "Europe/London"
},
"display": {
"theme": "dark",
"compactMode": false,
"showEmojis": true,
"tableStyle": "rounded",
"dateFormat": "DD/MM/YYYY",
"currency": "£"
},
"notifications": {
"deadlineReminder": true,
"priceChanges": true,
"injuryNews": true,
"slackWebhook": "https://hooks.slack.com/..."
},
"advanced": {
"apiEndpoint": "https://fantasy.premierleague.com/api",
"cacheTimeout": 300,
"maxRetries": 3,
"debugMode": false
}
}# Set environment variables
export GFL_GITHUB_USER=username
export GFL_GITHUB_TOKEN=ghp_...
export GFL_INTERACTIVE=true
export GFL_COLOR=true
export GFL_DEBUG=false# Configure interactively
gfl config
# Set specific values
gfl config set github.username "YOUR_USERNAME"
gfl config set display.theme "dark"
gfl config set preferences.interactive true
# Get configuration value
gfl config get github.username
# Reset to defaults
gfl config reset# 1. Install and link
npm install && npm link
# 2. Initialize configuration
gfl init
# 3. Create your team interactively
gfl
# 4. Validate before submission
gfl validate
# 5. Create PR with changes
gfl sync pr --title "Initial team creation"# Monday - Review last gameweek
gfl history gameweek --last
gfl league standings
# Wednesday - Plan transfers
gfl transfer --plan
gfl simulate --with-transfers
# Friday - Execute transfers
gfl transfer
gfl captain --suggest
gfl validate
# Friday evening - Final check
gfl deadline
gfl sync push#!/bin/bash
# Auto-transfer script
# Get current team value in JSON
TEAM_VALUE=$(gfl status --json | jq '.team.value')
# Check if we should wildcard
if [ "$TEAM_VALUE" -lt "98.0" ]; then
gfl chip activate wildcard
fi
# Get transfer suggestions
TRANSFERS=$(gfl suggest transfers --json)
# Execute transfers
echo "$TRANSFERS" | gfl transfer --batch -
# Validate and push
gfl validate --fix && gfl sync push# .github/workflows/validate.yml
name: Validate Team
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm install
- run: npm link
- run: gfl validate --verbose
- run: gfl simulate --json > simulation.json
- uses: actions/upload-artifact@v3
with:
name: simulation-results
path: simulation.jsonThe CLI uses modern npm packages for the best experience:
{
"dependencies": {
"commander": "^11.0.0", // Command parsing
"ink": "^6.0.0", // React for CLIs
"react": "^19.0.0", // React framework
"ink-spinner": "^5.0.0", // Loading spinners
"ink-text-input": "^6.0.0", // Text input fields
"ink-select-input": "^6.0.0", // Selection menus
"ink-gradient": "^3.0.0", // Gradient text
"ink-big-text": "^2.0.0", // Large ASCII text
"ink-box": "^1.0.0", // Box components
"ink-link": "^4.0.0", // Clickable links
"chalk": "^5.0.0", // Colored output
"cli-table3": "^0.6.0", // Beautiful tables
"figlet": "^1.6.0", // ASCII art titles
"conf": "^11.0.0", // Configuration management
"update-notifier": "^6.0.0", // Update notifications
"axios": "^1.5.0", // HTTP requests
"dayjs": "^1.11.0", // Date handling
"lodash": "^4.17.0", // Utility functions
"validator": "^13.0.0" // Input validation
}
}# Ensure npm link was run
npm link
# Or use npx
npx gfl status
# Or add to PATH
export PATH=$PATH:$(npm bin -g)# Fix npm permissions
npm config set prefix ~/.npm-global
export PATH=~/.npm-global/bin:$PATH
# Reinstall
npm install -g .# For corporate proxies
export NODE_TLS_REJECT_UNAUTHORIZED=0
gfl config set advanced.strictSSL false# Enable debug output
gfl --debug status
# Or set environment variable
export GFL_DEBUG=true
gfl status
# Verbose logging
gfl --verbose transfer# General help
gfl help
# Command-specific help
gfl help transfer
gfl transfer --help
# Interactive help
gfl ? # Shows contextual help
# Version info
gfl --version
# Check for updates
gfl updateFor more information, see the main documentation or visit the project repository.