|
| 1 | +--- |
| 2 | +slug: managing-multiple-versions-of-educates-cli |
| 3 | +title: Managing educates versions with educatesenv |
| 4 | +authors: [jorge] |
| 5 | +tags: [educates, cli] |
| 6 | +--- |
| 7 | + |
| 8 | +Managing multiple versions of the `educates` training platform binary can be a hassle—especially when you need to switch between versions for different projects, test new releases, or roll back to a previous version. Manual downloads, renaming, and path management are error-prone and time-consuming. |
| 9 | + |
| 10 | +Enter `educatesenv`, a simple CLI tool to install, switch, and manage multiple versions of the `educates` CLI, inspired by tools like `tfenv` and `rbenv`. |
| 11 | + |
| 12 | +<!-- truncate --> |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## Why use educatesenv? |
| 17 | + |
| 18 | +- **Easy version switching:** No more manual downloads or symlink juggling. |
| 19 | +- **Safe experimentation:** Try new releases without losing your current setup. |
| 20 | +- **Development mode:** Test local builds easily. |
| 21 | +- **Cross-platform:** Works on Linux, macOS, and Windows. |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## Getting started |
| 26 | + |
| 27 | +Install `educatesenv` from [GitHub Releases](https://github.com/educates/educatesenv/releases). |
| 28 | + |
| 29 | +Initialize your `edcuatesenv` environment: |
| 30 | + |
| 31 | +```sh |
| 32 | +educatesenv init --download |
| 33 | +``` |
| 34 | + |
| 35 | +This will create default configuration file and folders in `.educatesenv` in your user's home's directory, and will show you PATH instructions to have the tool ready to be used. |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +## Common tasks |
| 40 | + |
| 41 | +### List remote versions |
| 42 | + |
| 43 | +You can get a list of all available versions from GitHub: |
| 44 | + |
| 45 | +```sh |
| 46 | +educatesenv list-remote |
| 47 | +``` |
| 48 | + |
| 49 | +You can also include pre-releases, which is convenient if you need to test a release candidate: |
| 50 | + |
| 51 | +```sh |
| 52 | +educatesenv list-remote --all |
| 53 | +``` |
| 54 | + |
| 55 | +To show only the 10 most recent versions: |
| 56 | + |
| 57 | +```sh |
| 58 | +educatesenv list-remote --recents |
| 59 | +``` |
| 60 | + |
| 61 | +### Install a specific version |
| 62 | + |
| 63 | +Install a specific version: |
| 64 | + |
| 65 | +```sh |
| 66 | +educatesenv install 3.3.2 |
| 67 | +``` |
| 68 | + |
| 69 | +Or always get the latest released version available at the time: |
| 70 | + |
| 71 | +```sh |
| 72 | +educatesenv install latest |
| 73 | +``` |
| 74 | + |
| 75 | +Installing a version doesn't make it readily available to use. For that there's another command (`use`) but you might want to do both actions at once. |
| 76 | + |
| 77 | +Set the installed version as active immediately: |
| 78 | + |
| 79 | +```sh |
| 80 | +educatesenv install 3.3.2 --use |
| 81 | +``` |
| 82 | + |
| 83 | +### List installed versions |
| 84 | + |
| 85 | +You might end up having multiple versions installed. To find out what are the versions of Educates CLI you have locally installed, use: |
| 86 | + |
| 87 | +```sh |
| 88 | +educatesenv list |
| 89 | +``` |
| 90 | + |
| 91 | +### Use a version |
| 92 | + |
| 93 | +In order to switch between all your installed versions and make it the active one: |
| 94 | + |
| 95 | +```sh |
| 96 | +educatesenv use 3.3.2 |
| 97 | +``` |
| 98 | + |
| 99 | +### Uninstall a version |
| 100 | + |
| 101 | +When you no longer need a specific version, and to keep your local computer free of old software, you can remove a version you no longer need: |
| 102 | + |
| 103 | +```sh |
| 104 | +educatesenv uninstall 3.3.2 |
| 105 | +``` |
| 106 | + |
| 107 | +### Bonus for Educates Developers |
| 108 | + |
| 109 | +Educates developers might want to use the same mechanism to select the Educates CLI version they are using. They can enable in the configuration file development configuration: |
| 110 | + |
| 111 | +You can see your configuration file by: |
| 112 | + |
| 113 | +```sh |
| 114 | +educatesenv confiv view |
| 115 | +``` |
| 116 | + |
| 117 | +and add/edit these configuration snippet: |
| 118 | + |
| 119 | +```yaml |
| 120 | +development: |
| 121 | + enabled: true |
| 122 | + binaryLocation: /Users/USER/repositories/educates-training-platform/client-programs/bin/educates-darwin-arm64 |
| 123 | +``` |
| 124 | +
|
| 125 | +Once you have done that, you can select the `develop` version from the list of available versions: |
| 126 | + |
| 127 | +```sh |
| 128 | +educatesenv use develop |
| 129 | +``` |
| 130 | + |
| 131 | +**There's an additional configuration to provide a GitHub repository and token to get your educates binaries from a private repository** |
| 132 | + |
| 133 | +--- |
| 134 | + |
| 135 | +## Conclusion |
| 136 | + |
| 137 | +`educatesenv` makes it easy to manage multiple versions of the `educates` binary, so you can always work with the latest version you need. Try it out and simplify your workflow! |
0 commit comments