All Projects โ†’ JohnSundell โ†’ Marathon

JohnSundell / Marathon

Licence: mit
[DEPRECATED] Marathon makes it easy to write, run and manage your Swift scripts ๐Ÿƒ

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Marathon

Suitcase
A flexible command line tool for instantly deploying user interfaces for simple commands and scripts.
Stars: โœญ 1,287 (-31.87%)
Mutual labels:  command-line-tool, xcode, developer-tools
Stylesync
A command line tool to extract shared styles from a Sketch document, and generate native code for any platform.
Stars: โœญ 382 (-79.78%)
Mutual labels:  command-line-tool, xcode, developer-tools
Awesome Ios Interview
๐Ÿ“ฒ The curated list of iOS Developer interview questions and answers, Swift & Objective-C
Stars: โœญ 753 (-60.14%)
Mutual labels:  xcode, developer-tools
Gita
Manage many git repos with sanity ไปŽๅฎน็ฎก็†ๅคšไธชgitๅบ“
Stars: โœญ 865 (-54.21%)
Mutual labels:  command-line-tool, developer-tools
Xgist
Xcode extension to send code to GitHub's Gist
Stars: โœญ 75 (-96.03%)
Mutual labels:  xcode, developer-tools
Xcode Defaults
Awesome and useful Xcode defaults
Stars: โœญ 399 (-78.88%)
Mutual labels:  xcode, developer-tools
Xcov
Nice code coverage reporting without hassle
Stars: โœญ 467 (-75.28%)
Mutual labels:  command-line-tool, xcode
Xcperfect
Make your xccov outputs prettier โœจ
Stars: โœญ 56 (-97.04%)
Mutual labels:  command-line-tool, xcode
AppIconSetGen
Tool to generate App Icon set for iOS, macOS, watchOS apps
Stars: โœญ 20 (-98.94%)
Mutual labels:  developer-tools, command-line-tool
Hmap
hmap is a command line tool written in Swift to work with Clang header maps produced by Xcode.
Stars: โœญ 110 (-94.18%)
Mutual labels:  command-line-tool, xcode
Accesscontrolkitty
Xcode extension - quickly change access control level (public, private etc.) of selected Swift code by Editor menu item or keyboard command
Stars: โœญ 119 (-93.7%)
Mutual labels:  xcode, developer-tools
Poodle
๐Ÿ”ฅ A fast and beautiful command line tool to build API requests.
Stars: โœญ 129 (-93.17%)
Mutual labels:  command-line-tool, developer-tools
Circleci Cli
Use CircleCI from the command line
Stars: โœญ 297 (-84.28%)
Mutual labels:  command-line-tool, developer-tools
Playalways
Create Xcode playgrounds from your menu bar
Stars: โœญ 515 (-72.74%)
Mutual labels:  xcode, developer-tools
droxy
Create commands on your machine that proxy docker run / exec calls
Stars: โœญ 12 (-99.36%)
Mutual labels:  developer-tools, command-line-tool
Linessorter Xcode Extension
Xcode Extension that helps you keep your import statements and long code lists organized and uniform
Stars: โœญ 54 (-97.14%)
Mutual labels:  xcode, developer-tools
Fengniao
A command line tool for cleaning unused resources in Xcode.
Stars: โœญ 2,852 (+50.98%)
Mutual labels:  command-line-tool, xcode
pganonymize
A commandline tool for anonymizing PostgreSQL databases
Stars: โœญ 20 (-98.94%)
Mutual labels:  developer-tools, command-line-tool
Swiff
๐Ÿ’ Command line tools for common local โ†” remote server tasks.
Stars: โœญ 87 (-95.39%)
Mutual labels:  command-line-tool, developer-tools
Check It Out
A command line interface for Git Checkout. See branches available for checkout.
Stars: โœญ 127 (-93.28%)
Mutual labels:  command-line-tool, developer-tools

โš ๏ธ DEPRECATED: Marathon is now deprecated in favor of using the Swift Package Manager directly. It's recommended to migrate your scripts as soon as possible, since future Xcode/macOS versions may break compatibility. See this issue for more info.

Marathon

Travis status Swift Package Manager Twitter: @johnsundell

Welcome to Marathon, a command line tool that makes it easy to write, run and manage your Swift scripts. It's powered by the Swift Package Manager and requires no modification to your existing scripts or dependency packages.

Features

๐Ÿฃ Create scripts

$ marathon create helloWorld "import Foundation; print(\"Hello world\")"

๐Ÿƒโ€โ™€๏ธ Run scripts

$ marathon run helloWorld
> Hello world

๐Ÿ“ฆ Hassle free dependency management. Simply add a package...

$ marathon add https://github.com/JohnSundell/Files.git

...and use it without any additional work

import Files

for file in try Folder(path: "MyFolder").files {
    print(file.name)
}

๐Ÿš€ Update all of your scripting dependencies with a single call

$ marathon update

โš’ Edit, run & debug your scripts using Xcode...

$ marathon edit helloWorld

...or in your favorite text editor

$ marathon edit helloWorld --no-xcode

๐ŸŒ Run remote scripts directly from a Git repository...

$ marathon run https://github.com/johnsundell/testdrive.git

...using only a GitHub username & repository name:

$ marathon run johnsundell/testdrive

๐Ÿ’ป Install scripts as binaries and run them independently from anywhere...

$ marathon install helloWorld
$ helloWorld
> Hello world

...you can even install remote scripts (+ their dependencies) from a URL:

$ marathon install https://raw.githubusercontent.com/JohnSundell/Marathon-Examples/master/AddSuffix/addSuffix.swift
$ cd myImages
$ addSuffix "@2x"
> Added suffix "@2x" to 15 files

...or from a GitHub repository:

$ marathon install johnsundell/testdrive
$ testdrive

๐Ÿ‘ช Share your scripts with your team and automatically install their dependencies...

import Files // marathon:https://github.com/JohnSundell/Files.git

print(Folder.current.path)

...or specify your dependencies using a Marathonfile:

$ echo "https://github.com/JohnSundell/Files.git" > Marathonfile

Installing

On macOS

Using Make (recommended):

$ git clone https://github.com/JohnSundell/Marathon.git
$ cd Marathon
$ make

Using the Swift Package Manager:

$ git clone https://github.com/JohnSundell/Marathon.git
$ cd Marathon
$ swift build -c release -Xswiftc -static-stdlib
$ cp -f .build/release/Marathon /usr/local/bin/marathon

Using Mint:

$ mint install JohnSundell/Marathon

Using Homebrew (not recommended, due to slow update cycle):

brew install marathon-swift

On Linux

$ git clone https://github.com/JohnSundell/Marathon.git
$ cd Marathon
$ swift build -c release
$ cp -f .build/release/Marathon /usr/local/bin/marathon

If you encounter a permissions failure while installing, you may need to prepend sudo to the commands. To update Marathon, simply repeat any of the above two series of commands, except cloning the repo.

Requirements

Marathon requires the following to be installed on your system:

  • Swift 4.1 or later (bundled with Xcode 9.3 or later)
  • Git
  • Xcode (if you want to edit scripts using it)

Examples

Check out this repository for a few example Swift scripts that you can run using Marathon.

Specifying dependencies inline

Scripting usually involves using 3rd party frameworks to get your job done, and Marathon provides an easy way to define such dependencies right when you are importing them in your script, using a simple comment syntax:

import Files // marathon:https://github.com/JohnSundell/Files.git
import Unbox // marathon:https://github.com/JohnSundell/Unbox.git

Specifying your dependencies ensures that they will always be installed by Marathon before your script is run, edited or installed - making it super easy to share scripts with your friends, team or the wider community. All you have to do is share the script file, and Marathon takes care of the rest!

Using a Marathonfile

If you prefer to keep your dependency declarations separate, you can create a Marathonfile in the same folder as your script. This file is simply a new line separated list of URLs pointing to either:

  • The URL to a git repository of a local or remote package to install before running your script.
  • The path to another script that should be linked to your script before running it.

Here is an example of a Marathonfile:

https://github.com/JohnSundell/Files.git
https://github.com/JohnSundell/Unbox.git
https://github.com/JohnSundell/Wrap.git
~/packages/MyPackage
otherScript.swift

Shell autocomplete

Marathon includes autocomplete for the zsh and fish shells (PRs adding support for other shells is more than welcome!). To enable it, do the following:

  • zsh:

    • Add the line fpath=(~/.marathon/ShellAutocomplete/zsh $fpath) to your ~/.zshrc file.
    • Add the line autoload -Uz compinit && compinit -i to your ~/.zshrc file if it doesn't already contain it.
    • Restart your terminal.
  • fish:

    • cp -f ~/.marathon/ShellAutocomplete/fish/marathon.fish ~/.config/fish/completions

You can now type marathon r and have it be autocompleted to marathon run ๐ŸŽ‰

Help, feedback or suggestions?

  • Run $ marathon help to display help for the tool itself or for any specific command.
  • Append --verbose to any command to make Marathon output everything it's doing, for debugging purposes.
  • Open an issue if you need help, if you found a bug, or if you want to discuss a feature request.
  • Open a PR if you want to make some change to Marathon.
  • Contact @johnsundell on Twitter for discussions, news & announcements about Marathon.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].