A Swift-based utility for managing project commands, inspired by Make.
struct Commands: SakeApp {
public static var hello: Command {
Command(
run: { context in
print("Hello, world!")
}
)
}
}
❯ sake hello
Hello, world!
⚠️ Note: Sake is under active development, with ongoing updates and improvements. Use with caution in production environments.
Full Documentation • Getting Started
- Command Dependencies: Define commands that depend on other commands, allowing for clear and organized workflows.
- Conditional Execution: Set conditions under which a command will or will not be executed.
- Command Listing: Easily list all available commands in your SakeApp project.
- Command Grouping: Organize commands into groups for better structure and maintainability.
- Swift-based Configuration: Use Swift to define and manage your commands, ensuring type safety and flexibility.
Sake is designed for Swift developers who prefer to stay within the Swift ecosystem for managing command execution, rather than switching to shell scripting or using tools like Make. By leveraging Swift, Sake ensures type safety, readability, and maintainability in defining commands, making it an intuitive solution for automating project tasks.
To start using Sake, follow these steps:
-
Install Sake
brew install kattouf/sake/sake
Other methods here
-
Initialize a new SakeApp:
Run the following command to generate a new SakeApp template in the current directory:
sake init
This will create a new project structure in the
SakeApp
directory with a basicSakefile.swift
containing a simple command. -
Inspect the generated
Sakefile.swift
:Navigate to the
SakeApp
directory and openSakefile.swift
to see the pre-definedhello
command:import Foundation import Sake @main @CommandGroup struct Commands: SakeApp { public static var hello: Command { Command( run: { _ in print("Hello, world!") } ) } }
-
Run your first command:
To execute the
hello
command, run:sake hello
This will print
Hello, world!
in your terminal.
See full documentation at sakeswift.org.
I’m open to suggestions and would be happy to receive any reports, questions, or pull requests. Feel free to contribute by opening issues or submitting pull requests to help improve Sake!
Sake is released under the MIT License. See the LICENSE file for more details.