Skip to content
Easily generate Swift Playgrounds from your command line πŸ‘¨β€πŸ’»
Swift
Branch: master
Clone or download

Latest commit

Latest commit 274df0a Feb 24, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update swift.yml Feb 13, 2020
Sources Added Option to generate Playground from Clipboard Content Feb 13, 2020
Tests Added Project Feb 12, 2020
.gitignore Initial Commit Feb 12, 2020
.jazzy.yaml Updated Jazzy config Feb 13, 2020
LICENSE Added License file and Jazzy config Feb 12, 2020
Package.resolved Added Project Feb 12, 2020
Package.swift Added SwiftPlaygroundsKit Feb 12, 2020
README.md Update README.md Feb 24, 2020

README.md

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 πŸ‘¨β€πŸ’»

Demo

Features

  • Easily generate and instantly open Swift Playgrounds
  • Generate Playground with SwiftUI template
  • 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

Generate a Playground from your clipboard content via:

$ swiftplayground new --clipboard

To generate a Playground with a SwiftUI template run:

$ swiftplayground new --view

View Option Demo

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

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

Remote Option Demo

Arguments

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

new command

Long parameter Short parameter Description
--clipboard -c Generate a Playground from the current Clipboard content
--silent -s Generate a Playground without opening the Playgrounds application
--url -u Generate a Playground with contents from a URL
--view -v Generate a Playground with a SwiftUI template

Featured on

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.
You can’t perform that action at this time.