Skip to content

Commit

Permalink
command aliases (#1181)
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke authored Nov 2, 2024
1 parent e17af52 commit 030705d
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
54 changes: 54 additions & 0 deletions docs/reference/config/command-alias.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
sidebar_position: 895
---

# Command Aliases

[v2.37.0](https://github.com/aquaproj/aqua/releases/tag/v2.31.0) [3224](https://github.com/aquaproj/aqua/pull/3224)

You can define command aliases in aqua.yaml.

This is useful to use multiple versions of the same package.

```yaml
registries:
- type: standard
ref: v4.246.0 # renovate: depName=aquaproj/aqua-registry
packages:
- name: hashicorp/[email protected]
- name: hashicorp/terraform
version: v0.13.7
command_aliases:
- command: terraform
alias: terraform-013
# no_link: true
```

Then you can run `terraform` (v1.9.8) and `terraform-013` (v0.13.7).

```console
$ terraform version
Terraform v1.9.8
on darwin_arm64

$ terraform-013 version
Terraform v0.13.7

Your version of Terraform is out of date! The latest version
is 1.9.8. You can update by downloading from https://www.terraform.io/downloads.html
```

You can skip creating symbolic links for aliases by `no_link: true`

```yaml
command_aliases:
- command: terraform
alias: terraform-013
no_link: true
```
You can still run aliases via `aqua exec`.

```sh
aqua exec -- terraform-013 version
```
1 change: 1 addition & 0 deletions docs/reference/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ packages:
* `update.enabled`: If this is false, `aqua update` command ignores the package. If the package name is passed to aqua up command explicitly, enabled is ignored. By default, enabled is true.
* `go_version_file`: (string, optional) `aqua >= v2.28.0` [#2632](https://github.com/aquaproj/aqua/pull/2632) A file path to go.mod or go.work. This field is used to get the version of go from go directive in go.mod or go.work
* `vars`: (map of string) [v2.31.0](https://github.com/aquaproj/aqua/releases/tag/v2.31.0) [#3052](https://github.com/aquaproj/aqua/pull/3052). Please see [here](/docs/reference/registry-config/vars)
* `command_aliases`: (array of objects, optional) [v2.37.0](https://github.com/aquaproj/aqua/releases/tag/v2.31.0) [#3224](https://github.com/aquaproj/aqua/pull/3224): Aliases of commands. Please see [here](./command-alias.md)

The following two configuration is equivalent.

Expand Down

0 comments on commit 030705d

Please sign in to comment.