Skip to content

Latest commit

 

History

History
195 lines (148 loc) · 5.53 KB

cli.md

File metadata and controls

195 lines (148 loc) · 5.53 KB

CLI Reference

The Flux CLI provides full task management from the terminal, with MCP parity.

Installation

# npm (recommended)
npm install -g flux-tasks

# From source
cd packages/cli && bun run build && bun link

# Via Docker
docker run -it --rm -v flux-data:/app/packages/data -e FLUX_DATA=/app/packages/data/flux.sqlite flux-mcp flux

Storage Modes

The CLI supports three storage modes:

Local File (default)

flux init           # Creates .flux/data.json
flux project list   # Uses local data

SQLite (via FLUX_DATA)

FLUX_DATA=.flux/data.sqlite flux project list

Server/Hosted API

Connect to any Flux server (local or remote):

# Connect to hosted instance (with API key for writes)
flux init --server https://flux.example.com --api-key '$FLUX_API_KEY'

# Or local server (works keyless only if it runs with FLUX_ALLOW_ANONYMOUS=1)
flux init --server http://localhost:3000

# All commands now use the API
flux project list   # → GET /api/projects
flux task create proj_abc "New task"  # → POST /api/projects/proj_abc/tasks

Server mode stores the URL in .flux/config.json. The CLI works identically regardless of mode - all commands are transparently routed to the configured backend.

Config supports $ENV_VAR expansion for secrets:

{
  "server": "https://flux.example.com",
  "apiKey": "$FLUX_API_KEY"
}

Commands

Initialization

flux init                    # Interactive setup (JSON storage)
flux init --sqlite           # Use SQLite storage
flux init --server URL       # Connect to server
flux init --server URL --api-key KEY  # Server with auth (KEY can be $ENV_VAR)
flux init --git              # Use git sync (default)
flux init --no-agents        # Skip AGENTS.md update

Config is stored in .flux/config.json and can be committed to share with your team.

Projects

flux project list                        # List all projects
flux project create <name>               # Create project (private by default)
flux project create <name> --public      # Create a publicly readable project
flux project update <id> --name <n>      # Rename project
flux project delete <id>                 # Delete project

Epics

flux epic list <project>                 # List epics in project
flux epic create <project> <title>       # Create epic
flux epic update <id> --title <t>        # Update epic
flux epic update <id> --status done      # Change status
flux epic delete <id>                    # Delete epic

Tasks

flux task list <project>                 # List tasks
flux task list <project> --epic <id>     # Filter by epic
flux task list <project> --status todo   # Filter by status

flux task create <project> <title>       # Create task
flux task create <project> <title> -e <epic> -P 0  # With epic and priority

flux task update <id> --title <t>        # Update title
flux task update <id> --status in_progress
flux task update <id> --epic <epic_id>   # Assign to epic
flux task update <id> --note "context"   # Add note

flux task start <id>                     # Mark in_progress
flux task done <id>                      # Mark done
flux task done <id> --note "completed"   # Done with note

flux task delete <id>                    # Delete task

Quick Commands

flux ready                   # Unblocked tasks in the default project, by priority
flux ready <project>         # Unblocked tasks in a specific project
flux ready --all             # Unblocked tasks across every project
flux ready --json            # JSON output
flux show <id>               # Show task details with comments

Data Sync

Git-based sync (for teams, JSON storage only):

flux pull                    # Pull from flux-data branch
flux push                    # Push to flux-data branch
flux push "commit message"   # Push with custom message

Note: Git sync requires JSON storage. SQLite users should use export/import instead.

Export/Import:

flux export                  # Print JSON to stdout
flux export -o backup.json   # Export to file
flux import backup.json      # Import (replace)
flux import backup.json --merge  # Import (merge)
cat data.json | flux import -    # Import from stdin

Local Server

Start a local Flux server with Web UI + API:

flux serve                     # Uses config or defaults to .flux/data.json
flux serve -p 8080             # Custom port
flux serve --data path.json    # Override with JSON file
flux serve --data path.sqlite  # Override with SQLite file

Reads .flux/config.json to determine storage backend. Serves both the web dashboard and REST API.

Flags

Flag Description
--json Output as JSON
--all Ready tasks across every project instead of the default one (ready)
-P, --priority Priority: 0 (P0), 1 (P1), 2 (P2)
-e, --epic Epic ID
--note Add note/comment
--status Filter or set status

Environment Variables

Variable Description
FLUX_DIR Override .flux directory location
FLUX_DATA Data file path (.sqlite/.db for SQLite)

Examples

# Quick workflow
flux init
flux project create "My Project"
flux task create proj_abc "Fix login bug" -P 0
flux task start task_xyz
flux task done task_xyz --note "Fixed by adding null check"

# Agent workflow
flux ready --json | jq '.[0]'  # Get next task
flux task start task_123
flux task done task_123

# Team sync
flux pull
flux task create proj_abc "New feature"
flux push "added new feature task"