Skip to content
Development
Command

/xact

Local GitHub Actions testing with nektos/act for rapid development feedback

From plugin
claude-code
11045 skills45 commands29 hooks

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/xact

Context preview

What this command does when you run it.

Local GitHub Actions testing with nektos/act for rapid development feedback

Command definition

xact.md
description: Local GitHub Actions testing with nektos/act for rapid development feedback
tags: [github-actions, local-testing, development, act, docker, automation, macos]

`/xact` - Local GitHub Actions Testing

Test GitHub Actions workflows locally using nektos/act for fast feedback during development, before pushing to GitHub.

Usage

/xact                           # Auto-discover and run all workflows
/xact --workflow ci.yml         # Run specific workflow file
/xact --job test                # Run specific job only
/xact --list                    # List available workflows
/xact --install-deps            # Install nektos/act and Docker
/xact --check-deps              # Check dependency status
/xact --simulate                # Run in simulation mode
/xact --dry-run                 # Preview execution without running
/xact --start-docker            # Start Docker daemon (macOS)

Options

Core Operations

**`--workflow <file>`** - Run specific workflow file

/xact --workflow .github/workflows/ci.yml
/xact --workflow tests.yml

**`--job <name>`** - Execute specific job only

/xact --job test
/xact --job build
/xact --job security-scan

**`--list`** - List all available workflows

/xact --list                    # Show discoverable workflows

Dependency Management

**`--install-deps`** - Install nektos/act and Docker

/xact --install-deps            # Auto-install dependencies

**`--check-deps`** - Verify dependency availability

/xact --check-deps              # Check act and Docker status

**`--start-docker`** - Start Docker daemon (macOS-specific)

/xact --start-docker            # Launch Docker Desktop on macOS

Execution Modes

**`--simulate`** - Run in fallback simulation mode

/xact --simulate                # Simulate when Docker unavailable

**`--dry-run`** - Preview without execution

/xact --dry-run                 # Show what would be executed

Implementation

Based on $ARGUMENTS, perform local GitHub Actions testing operations:

First, check project structure and workflow availability: !find .github/workflows -name "*.yml" -o -name "*.yaml" 2>/dev/null | head -10 !ls -la .github/workflows/ 2>/dev/null || echo "No GitHub Actions workflows found"

Create enhanced Act runner script following your specifications:

!cat > scripts/xact.sh << 'EOF' #!/bin/bash set -euo pipefail

Enhanced GitHub Actions Local Runner using nektos/act

Implements: Local GitHub Actions testing with comprehensive dependency management

Colors for professional output

BLUE='\033[0;34m' GREEN='\033[0;32m' YELLOW='\033[1;33m' RED='\033[0;31m' NC='\033[0m' # No Color

PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" TIMEOUT_SECONDS=600 ACT_CONFIG_FILE="${PROJECT_ROOT}/.actrc" ARTIFACT_PATH="/tmp/act-artifacts"

Arrays to track workflow results

workflow_names=() workflow_statuses=()

log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" >&2 }

Function to add workflow result

add_workflow_result() { local name="$1" local status="$2" workflow_names+=("$name") workflow_statuses+=("$status") }

show_help() { echo -e "${BLUE}๐ŸŽฌ Enhanced Act GitHub Actions Runner${NC}" echo "======================================" echo "" cat << HELP_EOF USAGE: ./scripts/xact.sh [OPTIONS] [WORKFLOW_FILE]

OPTIONS: --help Show this help message --check-docker Check Docker availability --simulate Run in fallback simulation mode --list List available workflows --job JOB_NAME Run specific job --install-deps Install nektos/act and Docker dependencies --check-deps Check for missing dependencies --install-docker Install Docker only --start-docker Start Docker daemon

EXAMPLES: ./scripts/xact.sh # Auto-discover and run all workflows ./scripts/xact.sh .github/workflows/ci.yml # Run specific workflow ./scripts/xact.sh --job test # Run specific job ./scripts/xact.sh --simulate # Run in simulation mode

FEATURES: โœ“ Automatic workflow discovery and validation โœ“ Workflow-specific execution logic โœ“ Professional colored output โœ“ Intelligent dependency installation โœ“ Hybrid real/simulation execution โœ“ Automatic Docker daemon startup

HELP_EOF }

check_docker() { log "Checking Docker availability..."

if ! command -v docker &> /dev/null; then log "ERROR: Docker not installed" echo "docker: not found" return 1 fi

if ! docker info &> /dev/null; then log "ERROR: Docker daemon not running" echo "docker: daemon not running" return 1 fi

log "Docker is available and running" echo "docker: available" return 0 }

run_simulation() { log "Running in fallback simulation mode..."

cat << SIM_EOF === GitHub Actions Workflow Simulation ===

This is a fallback simulation for workflows requiring GitHub-specific features. Act is not available or Docker is not running.

Simulated workflow execution: โœ“ Workflow syntax validation โœ“ Job dependency analysis โœ“ Environment variable validation โœ“ Artifact path verification โœ“ Security scan simulation

Simulation completed successfully. SIM_EOF return 0 }

install_dependencies() { log "Installing dependencies..." local install_failed=false

Install nektos/act

if ! command -v act &> /dev/null; then echo "Installing nektos/act..." if [[ "$OSTYPE" == "darwin"* ]]; then if command -v brew &> /dev/null; then if brew install act; then echo "โœ“ nektos/act installed successfully" else echo "โœ— Failed to install nektos/act via Homebrew" install_failed=true fi else

Read more
Ships withclaude-code

Transform Claude Code into a complete development platform with 45 AI-powered commands that automate your entire software development workflow. Now with improved git identity management!

Get the whole plugin

Other commands on claude-code.