parent
0e399d47b9
commit
659dbb5368
2 changed files with 35 additions and 16 deletions
@ -1,29 +1,42 @@ |
|||||||
## Terraform oh-my-zsh plugin |
# Terraform plugin |
||||||
|
|
||||||
Plugin for Terraform, a tool from Hashicorp for managing infrastructure safely and efficiently. |
Plugin for Terraform, a tool from Hashicorp for managing infrastructure safely and efficiently. |
||||||
|
It adds completion for `terraform`, as well as aliases and a prompt function. |
||||||
|
|
||||||
Current as of Terraform v0.13 |
To use it, add `terraform` to the plugins array of your `~/.zshrc` file: |
||||||
|
|
||||||
|
```shell |
||||||
|
plugins=(... terraform) |
||||||
|
``` |
||||||
|
|
||||||
### Requirements |
## Requirements |
||||||
|
|
||||||
* [Terraform](https://terraform.io/) |
* [Terraform](https://terraform.io/) |
||||||
|
|
||||||
### Usage |
## Aliases |
||||||
|
|
||||||
To use it, add `terraform` to the plugins array of your `~/.zshrc` file: |
| Alias | Command | |
||||||
|
| ----- | -------------------- | |
||||||
|
| `tf` | `terraform` | |
||||||
|
| `tfa` | `terraform apply` | |
||||||
|
| `tfd` | `terraform destroy` | |
||||||
|
| `tff` | `terraform fmt` | |
||||||
|
| `tfi` | `terraform init` | |
||||||
|
| `tfp` | `terraform plan` | |
||||||
|
| `tfv` | `terraform validate` | |
||||||
|
|
||||||
```shell |
## Prompt function |
||||||
plugins=(... terraform) |
|
||||||
``` |
|
||||||
|
|
||||||
* Type `terraform` into your prompt and hit `TAB` to see available completion options |
You can add the current Terraform workspace in your prompt by adding `$(tf_prompt_info)` |
||||||
* Type `tf` into your prompt as a short alias to `terraform` |
to your `PROMPT` or `RPROMPT` variable. |
||||||
|
|
||||||
### Expanding ZSH prompt with current Terraform workspace name |
```sh |
||||||
|
RPROMPT='$(tf_prompt_info)' |
||||||
|
``` |
||||||
|
|
||||||
If you want to get current Terraform workspace name in your ZSH prompt open |
You can also specify the PREFIX and SUFFIX for the workspace with the following variables: |
||||||
your .zsh-theme file and in a chosen place insert: |
|
||||||
|
|
||||||
```shell |
```sh |
||||||
PROMPT=$'%{$fg[white]%}$(tf_prompt_info)%{$reset_color%} ' |
ZSH_THEME_TF_PROMPT_PREFIX="%{$fg[white]%}" |
||||||
|
ZSH_THEME_TF_PROMPT_SUFFIX="%{$reset_color%}" |
||||||
``` |
``` |
||||||
|
|||||||
Loading…
Reference in new issue