SwiftPlaygroundsCLI Header Logo

Swift 5.1 CI Status Version Documentation
Mint brew Twitter


Easily generate Swift Playgrounds from your command line
for the new Playgrounds App on macOS 👨‍💻

Features

  • [x] Easily generate Swift Playgrounds
  • [x] Predefined SwiftUI template option
  • [x] Open code from GitHub in a Swift Playground.

Installation

Mint 🌱

Mint is a package manager that installs and runs Swift command line tool packages.

$ mint install SvenTiigi/SwiftPlaygroundsCLI

Homebrew 🍺

Homebrew is a free and open-source software package management system that simplifies the installation of software on Apple’s macOS operating system.

$ brew tap SvenTiigi/SwiftPlaygroundsCLI
$ brew install swiftplaygroundscli

Usage 👨‍💻

To generate a new Swift Playground simply run:

$ swiftplayground new

If you wish to specify a name for the Playground run:

$ swiftplayground new MyAwesomePlayground

To generate a Playground with a SwiftUI template run:

$ swiftplayground new --view

A Playground with contents from a GitHub URL can be generated via:

$ swiftplayground new --url https://gist.github.com/SvenTiigi/7eae5e55edd9be41211470fcbd937285

Arguments

A list of the available arguments that are supported by the SwiftPlaygroundsCLI.

Long parameter Short parameter Description
--view -v Generate a Playground with a SwiftUI template
--url -u Generate a Playground with contents from a URL
--silent -s Generate a Playground without opening SwiftPlaygrounds application

Contributing

Contributions are very welcome 🙌 🤓

Credits

SwiftPlaygroundsCLI is inspired by Playground from JohnSundell

License

SwiftPlaygroundsCLI
Copyright (c) 2020 Sven Tiigi <sven.tiigi@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.