{"id":15713581,"url":"https://github.com/crimson-crystal/crimson","last_synced_at":"2025-08-16T12:10:53.960Z","repository":{"id":189261341,"uuid":"677229456","full_name":"crimson-crystal/crimson","owner":"crimson-crystal","description":"A Crystal Version Manager","archived":false,"fork":false,"pushed_at":"2024-10-14T16:07:36.000Z","size":1171,"stargazers_count":16,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-31T11:03:40.194Z","etag":null,"topics":["cli","crimson","crystal","crystal-lang","version-control","version-manager","versioning"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crimson-crystal.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-08-11T04:00:18.000Z","updated_at":"2025-03-29T15:09:43.000Z","dependencies_parsed_at":"2023-10-11T03:00:23.833Z","dependency_job_id":"abc582ca-7bf5-47b1-be6f-83e3a7ff148b","html_url":"https://github.com/crimson-crystal/crimson","commit_stats":null,"previous_names":["devnote-dev/crimson","crimson-crystal/crimson"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crimson-crystal%2Fcrimson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crimson-crystal%2Fcrimson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crimson-crystal%2Fcrimson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crimson-crystal%2Fcrimson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crimson-crystal","download_url":"https://codeload.github.com/crimson-crystal/crimson/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252898081,"owners_count":21821549,"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":["cli","crimson","crystal","crystal-lang","version-control","version-manager","versioning"],"created_at":"2024-10-03T21:32:16.192Z","updated_at":"2025-05-07T14:45:06.540Z","avatar_url":"https://github.com/crimson-crystal.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource\n      media=\"(prefers-color-scheme: dark)\"\n      srcset=\"assets/crimson_banner_light.png\"\n    /\u003e\n    \u003cimg\n      alt=\"logo\"\n      src=\"assets/crimson_banner_dark.png\"\n      width=\"720px\"\n    /\u003e\n  \u003c/picture\u003e\n  \u003ch3 align=\"center\"\u003eCrimson\u003c/h3\u003e\n  \u003cp align=\"center\"\u003eCrystal version management made easy\u003c/p\u003e\n\u003c/p\u003e\n\n## Installation\n\n\u003c!-- ### Linux\n\n```sh\n# Debian/Ubuntu\napt install crimson\n\n# Alpine\napk add crimson\n\n# Arch\npacman -S crimson\n``` --\u003e\n\n### Homebrew (Linux/Windows)\n\n```\nbrew tap crimson/distribution https://github.com/crimson-crystal/distribution\nbrew install crimson\nbrew uninstall crystal\n```\n\n### Windows\n\n```\nscoop bucket add crimson https://github.com/crimson-crystal/distribution\nscoop install crimson\n```\n\n### From Release\n\nSee the [releases page](https://github.com/crimson-crystal/crimson/releases) for available packaged binaries.\n\n#### Linux\n\n```sh\ncurl -L https://github.com/crimson-crystal/crimson/releases/download/1.0.1/crimson-1.0.1-linux-x86_64.tar.gz -o crimson.tar.gz\ntar -xvf crimson.tar.gz -C /usr/local/bin\n```\n\n#### Windows (PowerShell)\n\n```ps1\nInvoke-WebRequest \"https://github.com/crimson-crystal/crimson/releases/download/1.0.1/crimson-1.0.1-windows-x86_64-msvc.zip\" -OutFile crimson.zip\nExpand-Archive .\\crimson.zip .\n```\n\n\u003e [!IMPORTANT]\n\u003e Make sure to add the `crimson.exe` and `crimson.pdb` files to a directory in `PATH`.\n\n### From Source\n\n[Crystal](https://crystal-lang.org) version 1.13.0 or higher is required to build Crimson. Make sure to add the `bin/` directory to `PATH` or move the Crimson binaries to a directory in `PATH`.\n\n```sh\ngit clone https://github.com/crimson-crystal/crimson\ncd crimson\nshards build\n```\n\n## Usage\n\nTo get started, simply run `crimson setup`. This will setup the necessary configuration files and directories for Crimson, update your system to make the `crystal` and `shards` executables available and prompt you to install the necessary build dependencies for Crystal. You can bypass the prompts by including the `-y`/`--yes` flag, or skip dependency installation by including the `-s`/`--skip-dependencies` flag.\n\n\u003e [!NOTE]\n\u003e Crystal's dependencies are not typically readily available on most systems so you will need to install them manually if you choose to skip them in the command.\n\nNext, install Crystal using `crimson install` (or `crimson in`). By default this will install the latest available version unless you specify one (for example, `crimson install 1.9.2`). You can install any Crystal version that is available on the [Crystal GitHub releases page](https://github.com/crystal-lang/crystal/releases). This unfortunately means that nightly builds cannot be installed via Crimson yet.\n\nFinally, run the `crimson switch \u003cversion\u003e` command to make that version of Crystal available on your system. You can also do this automatically by including the `-s`/`--switch` flag in `crimson install`. Now, try `crystal version`! To put this in perspective, you just setup and installed Crystal with 3 simple commands:\n\n```sh\n❯ crimson setup\nChecking dependencies\nChecking additional dependencies\nNo additional dependencies for this platform\n\n❯ crimson install 1.9.2\nInstalling Crystal version: 1.9.2\nDownloading sources...\nUnpacking archive to destination...\n1647 files unpacked (54.0MiB)\nCleaning up processes...\n\n❯ crimson switch 1.9.2\n```\n\n### Aliases\n\nVersions can be aliased to make using them easier: run `crimson alias \u003cname\u003e \u003cversion\u003e` to set an alias for a specific version (for example, `crimson alias dev 1.9.2`). You can view all aliases with `crimson alias` and delete an alias with `crimson alias -d \u003cname\u003e`. Aliases can also be set automatically by including the `-a`/`--alias` flag.\n\n### Switching\n\nYou can switch between Crystal versions using `crimson switch \u003cversion\u003e` (or `crimson use`). If the version you wish to switch to has an alias, you can use that instead (for example, `crimson switch dev`). Versions can also be switched to automatically in the install command by including the `-s`/`--switch` flag. If you want to temporarily remove the current version from your system (for example, if you wanted to revert to a local install of Crystal) you can do so with `crimson switch -d`. This doesn't uninstall the Crystal version entirely, meaning you can easily switch back to it at any time.\n\n### Defaults\n\nWhat if you frequently install or switch versions and need a default available? You can set one using `crimson default \u003cversion\u003e`. This also supports using aliases in place of the version.\n\nBut how exactly does it work? Lets say you have `1.9.2` as default and you're working with version `1.7.3` but no longer need it, so you remove it. Crimson will automatically switch back to the configured default so that you still have a version of Crystal available on your system.\n\nYou can also easily switch between your current and default version using `crimson switch .` which will set the former to the latter. Defaults can be removed using `crimson default -d`.\n\n### Importing\n\nIf you have a local Crystal compiler environment, you can import it into Crimson's environment using `crimson import`. This command has a few requirements:\n\n- The `.build/`, `lib/` and `src/` directories must be present\n- Crystal must already be compiled and its binaries readily available in the `.build/` directory\n\nTo ensure Crimson's cross-platform compatibility and platform-specific system requirements, Crystal cannot be built using this command. The install version is obtained from the compiler during the import process. If that version is already installed, the command will fail. To work around this you can specify the `-R`/`--rename` flag with a version name to be imported under.\n\nBy default, local compiler sources are copied into Crimson's environment. If you want to update source files without having to re-import the compiler environment, you can specify the `--link` flag which connects the local compiler environment to Crimson's environment.\n\n\u003e [!NOTE]\n\u003e On Windows, using `--link` with `--switch` does not always update instantly due to how CMD/PowerShell handles symlinks. Running `crimson switch \u003cimport_version\u003e` will fix this.\n\nJust like normal installs, `import` supports aliases, switching and setting the version as default.\n\n### Testing\n\nCrimson allows you to iterate over installed versions using a test command as a condition. For example, `crimson test -- shards build` will test `shards build` on all installed versions. By default the versions are tested in descending order but can be ran in ascending or random order by specifying the `--order` flag.\n\nIf you only want to test a subset of versions then you can specify the `--from` flag with a version to start from and/or the `--to` flag with a version to stop at. Additionally, you can specify versions to include or exclude on top of this subset using the `-i`/`--include` and `-e`/`--exclude` flags respectively, which support multiple arguments (for example, `crimson test -e master -e dev ...`).\n\n```crystal\n# test.cr\n\np ([] of Int32).insert_all(0, [1, 2, 3])\n```\n\n```sh\n❯ crimson test -e dev --from latest --to 1.12.2 -- crystal build test.cr --no-codegen\n1.13.2 • Passed\n1.13.1 • Passed\n1.13.0 • Passed\n1.12.2 • Failed\n┃ Showing last frame. Use --error-trace for full trace.\n┃\n┃ In test.cr:3:17\n┃\n┃  3 | p ([] of Int32).insert_all(0, [1, 2, 3])\n┃                      ^---------\n┃ Error: undefined method 'insert_all' for Array(Int32)\n```\n\n### Removing\n\nRemoving Crystal versions is as simple as `crimson remove \u003cversion\u003e` (or `crimson rm`), and you can use the alias in place of the version.\n\n## Motivation\n\nCrimson is designed to be like any other application versioning manager using standardised design patterns to ensure consistency and flexibility. It _is_ intended for people that work with multiple versions of Crystal and/or need to ensure backwards compatibility for their projects. It is _not_ intended to be a replacement for system package managers or other Crystal distribution sources (although you can use it for that if you wish).\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/crimson-crystal/crimson/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Devonte W](https://github.com/devnote-dev) - creator and maintainer\n\nThis repository is managed under the Mozilla Public License v2.\n\n© 2023-present devnote-dev\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrimson-crystal%2Fcrimson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrimson-crystal%2Fcrimson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrimson-crystal%2Fcrimson/lists"}