Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default withMermaid(
{ text: "Shims", link: "/dev-tools/shims" },
{ text: "Aliases", link: "/dev-tools/aliases" },
{ text: "Registry", link: "/registry" },
{ text: "mise.lock Lockfile", link: "/dev-tools/mise-lock" },
{
text: "Backend Architecture",
link: "/dev-tools/backend_architecture",
Expand Down Expand Up @@ -94,7 +95,10 @@ export default withMermaid(
{ text: "cargo", link: "/dev-tools/backends/cargo" },
{ text: "dotnet", link: "/dev-tools/backends/dotnet" },
{ text: "gem", link: "/dev-tools/backends/gem" },
{ text: "github", link: "/dev-tools/backends/github" },
{ text: "gitlab", link: "/dev-tools/backends/gitlab" },
{ text: "go", link: "/dev-tools/backends/go" },
{ text: "http", link: "/dev-tools/backends/http" },
{ text: "npm", link: "/dev-tools/backends/npm" },
{ text: "pipx", link: "/dev-tools/backends/pipx" },
{ text: "spm", link: "/dev-tools/backends/spm" },
Expand Down
160 changes: 160 additions & 0 deletions docs/dev-tools/backends/github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# GitHub Backend

You may install GitHub release assets directly using the `github` backend. This backend downloads release assets from GitHub repositories and is ideal for tools that distribute pre-built binaries through GitHub releases.

The code for this is inside of the mise repository at [`./src/backend/github.rs`](https://github.com/jdx/mise/blob/main/src/backend/github.rs).

## Usage

The following installs the latest version of ripgrep from GitHub releases
and sets it as the active version on PATH:

```sh
$ mise use -g github:BurntSushi/ripgrep
$ rg --version
ripgrep 14.1.1
```

The version will be set in `~/.config/mise/config.toml` with the following format:

```toml
[tools]
"github:BurntSushi/ripgrep" = "latest"
```

## Tool Options

The following [tool-options](/dev-tools/#tool-options) are available for the `github` backend—these
go in `[tools]` in `mise.toml`.

### `asset_pattern`

Specifies the pattern to match against release asset names. This is useful when there are multiple assets for your OS/arch combination.

```toml
[tools]
"github:cli/cli" = { version = "latest", asset_pattern = "gh_*_linux_x64.tar.gz" }
```

### Platform-specific Asset Patterns

You can specify different asset patterns for different platforms:

```toml
[tools]
"github:cli/cli" = {
version = "latest",
platforms_linux_x64_asset_pattern = "gh_*_linux_x64.tar.gz",
platforms_macos_arm64_asset_pattern = "gh_*_macOS_arm64.tar.gz"
}
```

### `checksum`

Verify the downloaded file with a checksum:

```toml
[tools."github:owner/repo"]
version = "1.0.0"
asset_pattern = "tool-1.0.0-x64.tar.gz"
checksum = "sha256:a1b2c3d4e5f6789..."
```

*Instead of specifying the checksum here, you can use [mise.lock](/dev-tools/mise-lock) to manage checksums.*

### Platform-specific Checksums

You can specify different checksums for different platforms:

```toml
[tools]
"github:cli/cli" = {
version = "latest",
platforms_linux_x64_checksum = "sha256:a1b2c3d4e5f6789...",
platforms_macos_arm64_checksum = "sha256:b2c3d4e5f6789..."
}
```

### `size`

Verify the downloaded asset size:

```toml
[tools]
"github:cli/cli" = {
version = "latest",
size = "12345678"
}
```

### `strip_components`

Number of directory components to strip when extracting archives:

```toml
[tools]
"github:cli/cli" = {
version = "latest",
strip_components = 1
}
```

### `bin_path`

Specify the directory containing binaries within the extracted archive:

```toml
[tools]
"github:cli/cli" = {
version = "latest",
bin_path = "bin"
}
```

**Binary path lookup order:**

1. If `bin_path` is specified, use that directory
2. If `bin_path` is not set, look for a `bin/` directory in the install path
3. If no `bin/` directory exists, search subdirectories for `bin/` directories
4. If no `bin/` directories are found, use the root of the extracted directory

### `api_url`

For GitHub Enterprise or self-hosted GitHub instances, specify the API URL:

```toml
[tools]
"github:myorg/mytool" = {
version = "latest",
api_url = "https://github.mycompany.com/api/v3"
}
```

## Self-hosted GitHub

If you are using a self-hosted GitHub instance, set the `api_url` tool option and optionally the `MISE_GITHUB_ENTERPRISE_TOKEN` environment variable for authentication:

```sh
export MISE_GITHUB_ENTERPRISE_TOKEN="your-token"
```

## Supported GitHub Syntax

- **GitHub shorthand for latest release version:** `github:cli/cli`
- **GitHub shorthand for specific release version:** `github:cli/cli@2.40.1`

## Settings

<script setup>
import Settings from '/components/settings.vue';
</script>
<Settings child="github" :level="3" />

::: warning
The GitHub backend is experimental and requires the `mise.experimental` setting to be enabled:

```sh
mise settings set experimental true
```

:::
173 changes: 173 additions & 0 deletions docs/dev-tools/backends/gitlab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# GitLab Backend

You may install GitLab release assets directly using the `gitlab` backend. This backend downloads release assets from GitLab repositories and is ideal for tools that distribute pre-built binaries through GitLab releases.

The code for this is inside of the mise repository at [`./src/backend/gitlab.rs`](https://github.com/jdx/mise/blob/main/src/backend/gitlab.rs).

## Usage

The following installs the latest version of gitlab-runner from GitLab releases
and sets it as the active version on PATH:

```sh
$ mise use -g gitlab:gitlab-org/gitlab-runner
$ gitlab-runner --version
gitlab-runner 16.8.0
```

The version will be set in `~/.config/mise/config.toml` with the following format:

```toml
[tools]
"gitlab:gitlab-org/gitlab-runner" = "latest"
```

## Tool Options

The following [tool-options](/dev-tools/#tool-options) are available for the `gitlab` backend—these
go in `[tools]` in `mise.toml`.

### `asset_pattern`

Specifies the pattern to match against release asset names. This is useful when there are multiple assets for your OS/arch combination.

```toml
[tools]
"gitlab:gitlab-org/gitlab-runner" = { version = "latest", asset_pattern = "gitlab-runner-linux-x64" }
```

### Platform-specific Asset Patterns

You can specify different asset patterns for different platforms:

```toml
[tools]
"gitlab:gitlab-org/gitlab-runner" = {
version = "latest",
platforms_linux_x64_asset_pattern = "gitlab-runner-linux-x64",
platforms_macos_arm64_asset_pattern = "gitlab-runner-macos-arm64"
}
```

### `checksum`

Verify the downloaded file with a checksum:

```toml
[tools."gitlab:owner/repo"]
version = "1.0.0"
asset_pattern = "tool-1.0.0-x64.tar.gz"
checksum = "sha256:a1b2c3d4e5f6789..."
```

*Instead of specifying the checksum here, you can use [mise.lock](/dev-tools/mise-lock) to manage checksums.*

### Platform-specific Checksums

You can specify different checksums for different platforms:

```toml
[tools]
"gitlab:gitlab-org/gitlab-runner" = {
version = "latest",
platforms_linux_x64_checksum = "sha256:a1b2c3d4e5f6789...",
platforms_macos_arm64_checksum = "sha256:b2c3d4e5f6789..."
}
```

### `size`

Verify the downloaded asset size:

```toml
[tools]
"gitlab:gitlab-org/gitlab-runner" = {
version = "latest",
size = "12345678"
}
```

### Platform-specific Size

You can specify different sizes for different platforms:

```toml
[tools]
"gitlab:gitlab-org/gitlab-runner" = {
version = "latest",
platforms_linux_x64_size = "12345678",
platforms_macos_arm64_size = "9876543"
}
```

### `strip_components`

Number of directory components to strip when extracting archives:

```toml
[tools]
"gitlab:gitlab-org/gitlab-runner" = {
version = "latest",
strip_components = 1
}
```

### `bin_path`

Specify the directory containing binaries within the extracted archive:

```toml
[tools]
"gitlab:gitlab-org/gitlab-runner" = {
version = "latest",
bin_path = "bin"
}
```

**Binary path lookup order:**

1. If `bin_path` is specified, use that directory
2. If `bin_path` is not set, look for a `bin/` directory in the install path
3. If no `bin/` directory exists, search subdirectories for `bin/` directories
4. If no `bin/` directories are found, use the root of the extracted directory

### `api_url`

For self-hosted GitLab instances, specify the API URL:

```toml
[tools]
"gitlab:myorg/mytool" = {
version = "latest",
api_url = "https://gitlab.mycompany.com/api/v4"
}
```

## Self-hosted GitLab

If you are using a self-hosted GitLab instance, set the `api_url` tool option and optionally the `MISE_GITLAB_ENTERPRISE_TOKEN` environment variable for authentication:

```sh
export MISE_GITLAB_ENTERPRISE_TOKEN="your-token"
```

## Supported GitLab Syntax

- **GitLab shorthand for latest release version:** `gitlab:gitlab-org/gitlab-runner`
- **GitLab shorthand for specific release version:** `gitlab:gitlab-org/gitlab-runner@16.8.0`

## Settings

<script setup>
import Settings from '/components/settings.vue';
</script>
<Settings child="gitlab" :level="3" />

::: warning
The GitLab backend is experimental and requires the `mise.experimental` setting to be enabled:

```sh
mise settings set experimental true
```

:::
Loading
Loading