Skip to content

CLI Commands Reference

This is a comprehensive reference for all Plexr CLI commands.

Command Structure

plexr [global-flags] <command> [command-flags] [arguments]

Commands

plexr execute

Execute a plan file.

bash
plexr execute <plan-file> [flags]

Arguments

  • <plan-file> - Path to the YAML plan file (required)

Flags

FlagTypeDefaultDescription
--dry-run, -nboolfalsePreview execution without making changes
--auto, -yboolfalseAutomatically confirm all prompts
--platform, -pstringautoOverride platform detection (linux, darwin, windows)
--state-file, -sstring.plexr_state.jsonPath to state file
--force, -fboolfalseForce re-execution of completed steps
--verbose, -vboolfalseEnable verbose output

Examples

bash
# Basic execution
plexr execute setup.yml

# Dry run
plexr execute setup.yml --dry-run

# Force re-execution
plexr execute setup.yml --force

# Custom state file
plexr execute setup.yml --state-file=/tmp/state.json

Exit Codes

  • 0 - Successful execution
  • 1 - General error
  • 4 - Execution failed
  • 130 - User interruption (Ctrl+C)

plexr validate

Validate a plan file without executing it.

bash
plexr validate <plan-file> [flags]

Arguments

  • <plan-file> - Path to the YAML plan file (required)

Flags

FlagTypeDefaultDescription
--check-files, -cboolfalseVerify that referenced files exist
--verbose, -vboolfalseShow detailed validation information

Examples

bash
# Basic validation
plexr validate setup.yml

# Check file existence
plexr validate setup.yml --check-files

# Verbose output
plexr validate setup.yml --verbose

Exit Codes

  • 0 - Valid plan
  • 3 - Validation failed
  • 2 - Invalid arguments

plexr status

Display the current execution status.

bash
plexr status <plan-file> [flags]

Arguments

  • <plan-file> - Path to the YAML plan file (required)

Flags

FlagTypeDefaultDescription
--state-file, -sstring.plexr_state.jsonPath to state file
--verbose, -vboolfalseShow detailed status information
--json, -jboolfalseOutput in JSON format

Examples

bash
# Show status
plexr status setup.yml

# JSON output
plexr status setup.yml --json

# Custom state file
plexr status setup.yml --state-file=/tmp/state.json

Output Format (JSON)

json
{
  "plan": {
    "name": "Development Environment Setup",
    "version": "1.0.0"
  },
  "state": "in_progress",
  "progress": {
    "completed": 3,
    "total": 5,
    "percentage": 60
  },
  "current_step": "configure_app",
  "steps": [
    {
      "id": "install_tools",
      "status": "completed",
      "description": "Install development tools"
    }
  ],
  "last_updated": "2023-12-15T10:30:45Z"
}

plexr reset

Reset the execution state.

bash
plexr reset <plan-file> [flags]

Arguments

  • <plan-file> - Path to the YAML plan file (required)

Flags

FlagTypeDefaultDescription
--state-file, -sstring.plexr_state.jsonPath to state file
--force, -fboolfalseSkip confirmation prompt
--stepsstringComma-separated list of step IDs to reset

Examples

bash
# Reset with confirmation
plexr reset setup.yml

# Force reset
plexr reset setup.yml --force

# Reset specific steps
plexr reset setup.yml --steps=install_tools,setup_database

plexr completion

Generate shell completion scripts.

bash
plexr completion <shell>

Arguments

  • <shell> - Target shell: bash, zsh, fish, or powershell (required)

Examples

bash
# Bash
plexr completion bash > /etc/bash_completion.d/plexr

# Zsh
plexr completion zsh > "${fpath[1]}/_plexr"

# Fish
plexr completion fish > ~/.config/fish/completions/plexr.fish

# PowerShell
plexr completion powershell | Out-String | Invoke-Expression

plexr version

Display version information.

bash
plexr version [flags]

Flags

FlagTypeDefaultDescription
--verbose, -vboolfalseShow detailed version information
--json, -jboolfalseOutput in JSON format

Examples

bash
# Simple version
plexr version

# Detailed version
plexr version --verbose

# JSON output
plexr version --json

Output Format (JSON)

json
{
  "version": "1.0.0",
  "go_version": "go1.21.5",
  "build_time": "2023-12-15T10:30:00Z",
  "git_commit": "abc123def",
  "platform": "linux/amd64"
}

plexr help

Display help information.

bash
plexr help [command]

Arguments

  • [command] - Optional command to get help for

Examples

bash
# General help
plexr help

# Command-specific help
plexr help execute

# Also works with --help flag
plexr execute --help

Global Flags

These flags are available for all commands:

FlagTypeDefaultDescription
--config, -cstring$HOME/.plexr/config.ymlConfig file path
--log-level, -lstringinfoLog level: debug, info, warn, error
--no-colorboolfalseDisable colored output
--help, -hboolfalseShow help information

Environment Variables

VariableDescriptionDefault
PLEXR_STATE_FILEOverride default state file location.plexr_state.json
PLEXR_LOG_LEVELSet log levelinfo
PLEXR_NO_COLORDisable colored outputfalse
PLEXR_PLATFORMOverride platform detectionauto
PLEXR_CONFIGOverride config file location$HOME/.plexr/config.yml

Exit Codes

CodeDescription
0Success
1General error
2Invalid arguments or usage
3Plan validation failed
4Execution failed
5State file corrupted
130Interrupted by user (Ctrl+C)

Command Aliases

Some commands support shorter aliases:

  • execexecute
  • valvalidate
  • statstatus

Example:

bash
plexr exec setup.yml

Released under the MIT License.