plcommand

1.2.6

Running Command with Swift.
pelagornis/plcommand

What's New

PLCommand v1.2.6

2024-06-09T12:26:21Z

What's Changed

  • Add logging feature to task in Command.

PLCommand

Official SPM Swift License Platform

⌘ Running Command from Swift

Installation

PLCommand was deployed as Swift Package Manager. Package to install in a project. Add as a dependent item within the swift manifest.

let package = Package(
    ...
    dependencies: [
        .package(url: "https://github.com/pelagornis/plcommand.git", from: "1.2.5")
    ],
    ...
)

Then import the PLCommand from thr location you want to use.

import Command

Documentation

The documentation for releases and main are available here:

Using

If you want to use Bash.

@Command(\.bash) var bashCommand
bashCommand.run("command")

Or if you want to use zsh.

@Command(\.zsh) var zshCommand
zshCommand.run("command")

Or if you want to use Makefile command.

@Command(\.make) var makeCommand
makeCommand.run("command")

Frequently Used Commands

PLCommand supports frequently used features.

Support Git Command

@Command(\.git) var git

git.`init`()
git.add()
git.clone(repositoryURL)
git.commit("comment")
git.push()
git.pull(remote: "origin")
git.checkout(branch: "gh-page")

Support Swift Package Command

@Command(\.package) var swiftPackage

swiftPackage.create()
swiftPackage.create(type: .executable)
swiftPackage.update()
swiftPackage.generateXcodeproj()
swiftPackage.build()
swiftPackage.test()

Support Fastlane Command

@Command(\.fastlane) var fastlane

fastlane.`init`()
fastlane.tests()
fastlane.snapshot()
fastlane.deliver()
fastlane.frameit()
fastlane.run("fastlane command")

Support Tuist Command

@Command(\.tuist) var tuist

tuist.build()
tuist.clean()
tuist.fetch()
tuist.edit()
tuist.graph()
tuist.generate()
tuist.migration([])
tuist.scaffold("template", [])
tuist.test()
tuist.run("tuist command")

Extension

PLCommand is easier to scale.

extension CommandValues {
    var swift: Alias {
        Alias(executableURL: "/usr/bin/swift")
    }
}


// Usage
@Command(\.swift) var swiftCommand

License

plcommand is under MIT license. See the LICENSE file for more info.

Description

  • Swift Tools 5.7.0
View More Packages from this Author

Dependencies

Last updated: Thu Oct 17 2024 14:39:19 GMT-0900 (Hawaii-Aleutian Daylight Time)