{"id":921,"url":"https://github.com/JohnSundell/Marathon","last_synced_at":"2025-07-30T19:33:08.271Z","repository":{"id":66646853,"uuid":"84739133","full_name":"JohnSundell/Marathon","owner":"JohnSundell","description":"[DEPRECATED] Marathon makes it easy to write, run and manage your Swift scripts 🏃","archived":true,"fork":false,"pushed_at":"2019-09-15T21:40:08.000Z","size":542,"stargazers_count":1865,"open_issues_count":35,"forks_count":78,"subscribers_count":23,"default_branch":"master","last_synced_at":"2024-09-27T03:24:45.704Z","etag":null,"topics":["command-line-tool","developer-tools","marathon","scripting","swift","swift-script","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JohnSundell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-03-12T16:13:01.000Z","updated_at":"2024-09-11T08:19:46.000Z","dependencies_parsed_at":"2023-02-22T17:16:09.434Z","dependency_job_id":null,"html_url":"https://github.com/JohnSundell/Marathon","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnSundell%2FMarathon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnSundell%2FMarathon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnSundell%2FMarathon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnSundell%2FMarathon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohnSundell","download_url":"https://codeload.github.com/JohnSundell/Marathon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228179027,"owners_count":17881125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","developer-tools","marathon","scripting","swift","swift-script","xcode"],"created_at":"2024-01-05T20:15:34.686Z","updated_at":"2024-12-04T19:32:23.696Z","avatar_url":"https://github.com/JohnSundell.png","language":"Swift","readme":"**⚠️ 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](https://github.com/JohnSundell/Marathon/issues/208) for more info.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"Logo.png\" width=\"480\" max-width=\"90%\" alt=\"Marathon\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://dashboard.buddybuild.com/apps/58ff19a79a06210001d14c2d/build/latest?branch=master\"\u003e\n        \u003cimg src=\"https://dashboard.buddybuild.com/api/statusImage?appID=58ff19a79a06210001d14c2d\u0026branch=master\u0026build=latest\" /\u003e\n    \u003ca href=\"https://travis-ci.org/JohnSundell/Marathon/branches\"\u003e\n        \u003cimg src=\"https://img.shields.io/travis/JohnSundell/Marathon/master.svg\" alt=\"Travis status\" /\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Swift-4.2-orange.svg\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://swift.org/package-manager\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/spm-compatible-brightgreen.svg?style=flat\" alt=\"Swift Package Manager\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://twitter.com/johnsundell\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/contact-@johnsundell-blue.svg?style=flat\" alt=\"Twitter: @johnsundell\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nWelcome 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](https://github.com/apple/swift-package-manager) and requires no modification to your existing scripts or dependency packages.\n\n## Features\n\n🐣 Create scripts\n```\n$ marathon create helloWorld \"import Foundation; print(\\\"Hello world\\\")\"\n```\n\n🏃‍♀️ Run scripts\n```\n$ marathon run helloWorld\n\u003e Hello world\n```\n\n📦 Hassle free dependency management. Simply add a package...\n```\n$ marathon add https://github.com/JohnSundell/Files.git\n```\n\n...and use it without any additional work\n```swift\nimport Files\n\nfor file in try Folder(path: \"MyFolder\").files {\n    print(file.name)\n}\n```\n\n🚀 Update all of your scripting dependencies with a single call\n```\n$ marathon update\n```\n\n⚒ Edit, run \u0026 debug your scripts using Xcode...\n```\n$ marathon edit helloWorld\n```\n\n...or in your favorite text editor\n```\n$ marathon edit helloWorld --no-xcode\n```\n\n🌍 Run remote scripts directly from a Git repository...\n```\n$ marathon run https://github.com/johnsundell/testdrive.git\n```\n\n...using only a GitHub username \u0026 repository name:\n```\n$ marathon run johnsundell/testdrive\n```\n\n💻 Install scripts as binaries and run them independently from anywhere...\n```\n$ marathon install helloWorld\n$ helloWorld\n\u003e Hello world\n```\n\n...you can even install remote scripts (+ their dependencies) from a URL:\n```\n$ marathon install https://raw.githubusercontent.com/JohnSundell/Marathon-Examples/master/AddSuffix/addSuffix.swift\n$ cd myImages\n$ addSuffix \"@2x\"\n\u003e Added suffix \"@2x\" to 15 files\n```\n\n...or from a GitHub repository:\n```\n$ marathon install johnsundell/testdrive\n$ testdrive\n```\n\n👪 Share your scripts with your team and automatically install their dependencies...\n```swift\nimport Files // marathon:https://github.com/JohnSundell/Files.git\n\nprint(Folder.current.path)\n```\n\n...or specify your dependencies using a `Marathonfile`:\n```\n$ echo \"https://github.com/JohnSundell/Files.git\" \u003e Marathonfile\n```\n\n## Installing\n\n### On macOS\n\nUsing Make **(recommended)**:\n```sh\n$ git clone https://github.com/JohnSundell/Marathon.git\n$ cd Marathon\n$ make\n```\n\nUsing the Swift Package Manager:\n```sh\n$ git clone https://github.com/JohnSundell/Marathon.git\n$ cd Marathon\n$ swift build -c release -Xswiftc -static-stdlib\n$ cp -f .build/release/Marathon /usr/local/bin/marathon\n```\n\nUsing [Mint](https://github.com/yonaskolb/mint):\n```sh\n$ mint install JohnSundell/Marathon\n```\n\nUsing Homebrew **(not recommended, due to slow update cycle)**:\n```sh\nbrew install marathon-swift\n```\n\n### On Linux\n\n```sh\n$ git clone https://github.com/JohnSundell/Marathon.git\n$ cd Marathon\n$ swift build -c release\n$ cp -f .build/release/Marathon /usr/local/bin/marathon\n```\n\nIf you encounter a permissions failure while installing, you may need to prepend `sudo` to the commands.\nTo update Marathon, simply repeat any of the above two series of commands, except cloning the repo.\n\n## Requirements\n\nMarathon requires the following to be installed on your system:\n\n- Swift 4.1 or later (bundled with Xcode 9.3 or later)\n- Git\n- Xcode (if you want to edit scripts using it)\n\n## Examples\n\nCheck out [this repository](https://github.com/JohnSundell/Marathon-Examples) for a few example Swift scripts that you can run using Marathon.\n\n## Specifying dependencies inline\n\nScripting 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:\n\n```swift\nimport Files // marathon:https://github.com/JohnSundell/Files.git\nimport Unbox // marathon:https://github.com/JohnSundell/Unbox.git\n```\n\nSpecifying 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!\n\n## Using a Marathonfile\n\nIf 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:\n\n- The URL to a git repository of a local or remote package to install before running your script.\n- The path to another script that should be linked to your script before running it.\n\nHere is an example of a `Marathonfile`:\n```\nhttps://github.com/JohnSundell/Files.git\nhttps://github.com/JohnSundell/Unbox.git\nhttps://github.com/JohnSundell/Wrap.git\n~/packages/MyPackage\notherScript.swift\n```\n\n## Shell autocomplete\n\nMarathon includes autocomplete for the `zsh` and `fish` shells (PRs adding support for other shells is more than welcome!). To enable it, do the following:\n\n+ `zsh`:\n    - Add the line `fpath=(~/.marathon/ShellAutocomplete/zsh $fpath)` to your `~/.zshrc` file.\n    - Add the line `autoload -Uz compinit \u0026\u0026 compinit -i` to your `~/.zshrc` file if it doesn't already contain it.\n    - Restart your terminal.\n\n+ `fish`:\n    - `cp -f ~/.marathon/ShellAutocomplete/fish/marathon.fish ~/.config/fish/completions`\n\nYou can now type `marathon r` and have it be autocompleted to `marathon run` 🎉\n\n## Help, feedback or suggestions?\n\n- Run `$ marathon help` to display help for the tool itself or for any specific command.\n- Append `--verbose` to any command to make Marathon output everything it's doing, for debugging purposes.\n- [Open an issue](https://github.com/JohnSundell/Marathon/issues/new) if you need help, if you found a bug, or if you want to discuss a feature request.\n- [Open a PR](https://github.com/JohnSundell/Marathon/pull/new/master) if you want to make some change to Marathon.\n- Contact [@johnsundell on Twitter](https://twitter.com/johnsundell) for discussions, news \u0026 announcements about Marathon.\n","funding_links":[],"categories":["Command Line","Libs","HarmonyOS","Swift","Scripting [🔝](#readme)","The Index"],"sub_categories":["Linter","Scripting","Windows Manager","Other free courses","Developer Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJohnSundell%2FMarathon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJohnSundell%2FMarathon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJohnSundell%2FMarathon/lists"}