{"id":16812299,"url":"https://github.com/chawyehsu/moonup","last_synced_at":"2025-07-30T14:13:03.478Z","repository":{"id":248532516,"uuid":"824249796","full_name":"chawyehsu/moonup","owner":"chawyehsu","description":"Manage multiple MoonBit installations","archived":false,"fork":false,"pushed_at":"2025-03-10T07:43:36.000Z","size":518,"stargazers_count":13,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T07:21:23.053Z","etag":null,"topics":["command-line-tool","moonbit","toolchain-manager","version-manager"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chawyehsu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"chawyehsu","custom":"https://github.com/chawyehsu/sponsors"}},"created_at":"2024-07-04T17:22:10.000Z","updated_at":"2025-03-10T09:26:32.000Z","dependencies_parsed_at":"2024-08-01T06:46:17.674Z","dependency_job_id":"afc2b3f8-1837-4fbd-b714-2f712533fc0b","html_url":"https://github.com/chawyehsu/moonup","commit_stats":null,"previous_names":["chawyehsu/moonup"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chawyehsu%2Fmoonup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chawyehsu%2Fmoonup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chawyehsu%2Fmoonup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chawyehsu%2Fmoonup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chawyehsu","download_url":"https://codeload.github.com/chawyehsu/moonup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244902929,"owners_count":20529114,"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","moonbit","toolchain-manager","version-manager"],"created_at":"2024-10-13T10:21:23.256Z","updated_at":"2025-07-30T14:13:03.457Z","avatar_url":"https://github.com/chawyehsu.png","language":"Rust","funding_links":["https://github.com/sponsors/chawyehsu","https://github.com/chawyehsu/sponsors"],"categories":[],"sub_categories":[],"readme":"# moonup\n\n\u003e Manage multiple [MoonBit] installations\n\n[![cicd][cicd-badge]][cicd]\n[![downloads][downloads-badge]][releases]\n[![release][release-badge]][releases]\n[![crates-svg]][crates-url]\n[![license][license-badge]](LICENSE)\n[![codecov][codecov-badge]][codecov]\n\n## Getting Started\n\n### Install\n\nMoonup is available for installation via different ways.\n\n#### Conda (Cross-platform)\n\nYou can install moonup with conda/mamba/[pixi] from our conda-forge channel:\n\n```sh\npixi global install moonup -c chawyehsu -c conda-forge\n```\n\n#### Cargo (Cross-platform, build from source)\n\nIf you have the Rust toolchain installed, you can install **moonup** easily with Cargo:\n\n```sh\ncargo install moonup\n```\n\n#### Homebrew (macOS)\n\nIf you are on macOS and you have Homebrew installed, you can install moonup from our Homebrew Tap:\n\n```zsh\nbrew install chawyehsu/brew/moonup\n```\n\n#### Scoop (Windows)\n\nIf you are on Windows and you have Scoop installed:\n\n```pwsh\nscoop bucket add dorado https://github.com/chawyehsu/dorado\nscoop install moonup\n```\n\n#### GitHub Releases\n\nOr you may download the latest release from [GitHub releases][releases],\nmanually extract the archive and put the executables in a directory that is in your `PATH`.\n\n### Usage\n\nAfter installation, run `moonup help` to see the available commands.\n\n```sh\n$ moonup help\nMoonup is a tool to manage multiple MoonBit installations.\n\nIf you find any bugs or have a feature request, please open an issue on\nGitHub: https://github.com/chawyehsu/moonup/issues\n\nUsage: moonup [OPTIONS] \u003cCOMMAND\u003e\n\nCommands:\n  completions  Generate shell completions\n  default      Set the default toolchain\n  install      Install or update a MoonBit toolchain [aliases: i]\n  list         List installed and active toolchains [aliases: ls]\n  pin          Pin the MoonBit toolchain to a specific version\n  run          Run a command with a specific toolchain\n  self-update  Update Moonup to the latest version\n  uninstall    Uninstall a MoonBit toolchain\n  update       Update MoonBit toolchains [aliases: u]\n  which        Show the actual binary that will be run for a given command\n  help         Print this message or the help of the given subcommand(s)\n\nOptions:\n  -v, --verbose...  Increase logging verbosity\n  -q, --quiet...    Decrease logging verbosity\n  -h, --help        Print help\n  -V, --version     Print version\n```\n\n#### Install a MoonBit Toolchain\n\n```sh\n# install the latest MoonBit toolchain\nmoonup install latest\n# install the latest nightly MoonBit toolchain\nmoonup install nightly\n# install a specific MoonBit toolchain (`v` prefix is not required)\nmoonup install 0.1.20241231+ba15a9a4e\n```\n\n#### Pin a MoonBit Toolchain\n\nBy pinning a MoonBit toolchain to a specific version in a project, the toolchain\nwill be automatically switched to the pinned version when you're running MoonBit\ncommands in the project directory. With this feature, you can ensure that the\nproject is built and tested with the same MoonBit toolchain.\n\n```sh\nmoonup pin 0.1.20241231+ba15a9a4e\n# remove the `moonbit-version` file to unpin\nrm moonbit-version\n```\n\nYou're not required to install the pinned MoonBit toolchain in advance. Moonup\nwill download and install the toolchain automatically when a command is run.\n\n#### Set the Default Toolchain\n\nThe default toolchain is used when no toolchain is specified in a project. The\n`latest` toolchain is used by default.\n\n```sh\n# change the default toolchain to the latest nightly\nmoonup default nightly\n```\n\n#### Check Installed and Active Toolchains\n\n```sh\nmoonup list\n```\n\n#### Run a Command with a Specific Toolchain\n\n```sh\nmoonup run 0.1.20241231+ba15a9a4e moon version\n# or pass the version to the command directly! (syntax: `+\u003cspec\u003e`)\nmoon +nightly version --all\n```\n\n#### Uninstall a MoonBit Toolchain\n\n```sh\n# relevant cached downloads will be removed as well\nmoonup uninstall 0.1.20241231+ba15a9a4e\n# delete all cached downloads\nmoonup uninstall --clear\n```\n\n### Use Moonup in GitHub Actions\n\nWith the [setup-moonup] action, It's super easy to use Moonup to set up a\nMoonBit environment in GitHub CI. Here is an example workflow:\n\n```yaml\n- name: Setup MoonBit\n  uses: chawyehsu/setup-moonup@v1\n  run: moon version --all\n```\n\n### Distribution Server\n\nMoonup is backed by [chawyehsu/moonbit-binaries], a service built with\nGitHub Actions to continuously archive MoonBit releases from the official\nwebsite and provide a distribution server with a stable API.\n\nThe default dist server endpoint is `https://moonup.csu.moe/v2` at the\ntime of writing. Moonup supports overriding the distribution server with\nthe `MOONUP_DIST_SERVER` environment variable.\n\n```sh\n# set the distribution server to a custom endpoint\nexport MOONUP_DIST_SERVER=https://moonup.corporate.internal/\n```\n\nWith this feature, you can configure Moonup to fetch and install MoonBit\ntoolchains from a custom distribution server. This is useful when the default\ndistribution server is not accessible in your environment, or when you want\nto host your own distribution server for MoonBit toolchains.\n\nYou have to build up the distribution server yourself though.\n\n## How It Works\n\nMoonup allows you to install multiple MoonBit toolchains and switch between\nthem easily. All MoonBit toolchains (with the core standard library) are\ninstalled in Moonup's `toolchains` directory.\n\nMoonup creates shim executables that replace the original MoonBit\nexecutables in the PATH. When you run a MoonBit command, the shim\nexecutable determines which MoonBit toolchain to use and proxies the\ncommand to the actual MoonBit executable in the desired toolchain.\n\nWith this approach, you can switch between MoonBit toolchains across\nprojects easily without needing to change the PATH.\n\n### Known Limitations\n\n- Isolation of MoonBit core standard library is problematic, see [#7].\n\n## Development\n\nPrerequisites: Git, [pixi]\n\n```sh\n# clone the repo\ngit clone https://github.com/chawyehsu/moonup\ncd moonup\n# install dependencies\npixi install\n# install git pre-commit hooks\npixi run pre-commit install\n# dev build and run\npixi run cargo run moonup -- help\n```\n\n## 0.1.0 Roadmap\n\n- [x] An `install` command to install multiple MoonBit toolchains\n- [x] A `pin` command to pin toolchain to a specific version in a project\n- [x] Create shim executables to switch between toolchains automatically\n- [x] A `default` command to set the default toolchain\n- [x] A `show` command to show installed and currently active toolchains\n- [x] A `which` command to show the actual binary that will be run for a given command\n- [x] A `run` command to run a command with a specific toolchain\n- [x] A `update` command to self-update and update the toolchain\n- [x] A `completions` command to generate shell completions\n\n## License\n\n**moonup** © [Chawye Hsu](https://github.com/chawyehsu). Released under the [Apache-2.0](LICENSE) license.\n\n\u003e [Blog](https://chawyehsu.com) · GitHub [@chawyehsu](https://github.com/chawyehsu) · Twitter [@chawyehsu](https://twitter.com/chawyehsu)\n\n[MoonBit]: https://www.moonbitlang.com/\n[cicd-badge]: https://img.shields.io/github/actions/workflow/status/chawyehsu/moonup/cicd.yml?style=flat\u0026logo=github\u0026logoColor=FFFFFF\u0026colorA=0B031E\u0026colorB=9E1084\n[cicd]: https://github.com/chawyehsu/moonup/actions/workflows/cicd.yml\n[release-badge]: https://img.shields.io/github/v/release/chawyehsu/moonup?style=flat\u0026logo=semanticrelease\u0026logoColor=FFFFFF\u0026colorA=0B031E\u0026colorB=9E1084\n[releases]: https://github.com/chawyehsu/moonup/releases/latest\n[crates-svg]: https://img.shields.io/crates/v/moonup.svg?style=flat\u0026logo=rust\u0026logoColor=FFFFFF\u0026colorA=0B031E\u0026colorB=9E1084\n[codecov-badge]: https://img.shields.io/codecov/c/gh/chawyehsu/moonup?style=flat\u0026logo=codecov\u0026logoColor=FFFFFF\u0026colorA=0B031E\u0026colorB=9E1084\n[codecov]: https://codecov.io/github/chawyehsu/moonup\n[crates-url]: https://crates.io/crates/moonup\n[license-badge]: https://img.shields.io/github/license/chawyehsu/moonup?style=flat\u0026logo=spdx\u0026logoColor=FFFFFF\u0026colorA=0B031E\u0026colorB=9E1084\n[downloads-badge]: https://img.shields.io/github/downloads/chawyehsu/moonup/total?style=flat\u0026logo=github\u0026logoColor=FFFFFF\u0026colorA=0B031E\u0026colorB=9E1084\n[pixi]: https://pixi.sh\n[setup-moonup]: https://github.com/chawyehsu/setup-moonup\n[chawyehsu/moonbit-binaries]: https://github.com/chawyehsu/moonbit-binaries\n[#7]: https://github.com/chawyehsu/moonup/issues/7\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchawyehsu%2Fmoonup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchawyehsu%2Fmoonup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchawyehsu%2Fmoonup/lists"}