Skip to content

Shef is a powerful CLI tool for cooking up shell recipes.

License

Notifications You must be signed in to change notification settings

eduardoagarcia/shef

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shef

Shef, a wordplay on "shell" and "chef", is a powerful CLI tool for cooking up advanced shell recipes.

Essentially, imagine that Make, GitHub Actions, and CyberChef had a weird little <moira-rose>bea-by</>.

Shef allows you to pipe shell commands together, add interactive user prompts, loop using complex control structures, easily run and manage background tasks, and build reusable workflows with advanced logic and conditions.

Quick Start Example

The following example showcases a simple Shef recipe, giving you a quick glance at the syntax and functionality.

Quick Start Conditional Example

recipes:
  - name: "conditional"
    description: "A simple demo of conditional operations using direct prompt values"
    category: "demo"
    operations:
      - name: "Choose Fruit"
        id: "choose"
        command: 'echo "You selected: {{ .fruit }}"'
        prompts:
          - name: "Fruit Select"
            id: "fruit"
            type: "select"
            message: "Choose a fruit:"
            options:
              - "Apples"
              - "Oranges"

      - name: "Apple Operation"
        id: "apple"
        command: echo "This is the apple operation! 🍎"
        condition: .fruit == "Apples"

      - name: "Orange Operation"
        id: "orange"
        command: echo "This is the orange operation! 🍊"
        condition: .fruit == "Oranges"

Tip

Want to see more before diving deeper? Check out the demo recipes.

Documentation

Shef's Primary Features

  • Command Piping: Chain multiple commands together, passing output from one command to the next
  • Transformations: Transform command output with powerful templating
  • Interactive Prompts: Add user input, selections, confirmations, and more
  • Conditional Logic: Branching based on command results
  • Control Flow: Create dynamic workflows with loops and control structures
  • Background Task Management: Easily monitor and control background tasks
  • Progress Mode: Inline updates for clean status updates and progress indicators
  • Multiple Sources and Contexts: Use local, user, or public recipes
  • Public Recipes: Common, useful recipes anyone can use. Browse public recipes.

Quick Start

Once Shef is installed, you are ready to begin using it.

# Sync all public recipes locally
shef sync

# Run the Hello World recipe
shef demo hello-world

# View help information about a recipe
shef demo hello-world --help

# List available recipes (demo recipes are excluded by default)
shef ls

# List all recipes within a specific category
shef ls demo

Dive In

Ready to learn more? Start with learning how to build your own recipes, then check out recipe arguments and flags and background task management.