mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-31 11:49:50 +00:00
Compare commits
1 Commits
834fbf3711
...
update/plu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db3004908f |
2
.github/dependencies.yml
vendored
2
.github/dependencies.yml
vendored
@@ -30,7 +30,7 @@ dependencies:
|
|||||||
plugins/kube-ps1:
|
plugins/kube-ps1:
|
||||||
repo: jonmosco/kube-ps1
|
repo: jonmosco/kube-ps1
|
||||||
branch: master
|
branch: master
|
||||||
version: 0b0e6daf4197ecabb1ae4f2d46fb148a8e1e73e5
|
version: 9b41c091d5dd4a99e58cf58b5d98a4847937b1bb
|
||||||
precopy: |
|
precopy: |
|
||||||
set -e
|
set -e
|
||||||
find . ! -name kube-ps1.sh ! -name LICENSE ! -name README.md -delete
|
find . ! -name kube-ps1.sh ! -name LICENSE ! -name README.md -delete
|
||||||
|
|||||||
@@ -35,14 +35,11 @@ the `brew` binary before sourcing `oh-my-zsh.sh` and it'll set up the environmen
|
|||||||
| `bdr` | `brew doctor` | Check your system for potential problems. |
|
| `bdr` | `brew doctor` | Check your system for potential problems. |
|
||||||
| `bfu` | `brew upgrade --formula` | Upgrade only formulae (not casks). |
|
| `bfu` | `brew upgrade --formula` | Upgrade only formulae (not casks). |
|
||||||
| `bi` | `brew install` | Install a formula. |
|
| `bi` | `brew install` | Install a formula. |
|
||||||
| `bih` | `brew install --HEAD` | Install a formula with --HEAD |
|
|
||||||
| `bl` | `brew list` | List all installed formulae. |
|
| `bl` | `brew list` | List all installed formulae. |
|
||||||
| `bo` | `brew outdated` | List installed formulae that have an updated version available. |
|
| `bo` | `brew outdated` | List installed formulae that have an updated version available. |
|
||||||
| `br` | `brew reinstall` | Reinstall a formula. |
|
|
||||||
| `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. |
|
| `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. |
|
||||||
| `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. |
|
| `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. |
|
||||||
| `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. |
|
| `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. |
|
||||||
| `brh` | `brew reinstall --HEAD` | Reinstall a formula with --HEAD |
|
|
||||||
| `bs` | `brew search` | Perform a substring search of cask tokens and formula names for text. |
|
| `bs` | `brew search` | Perform a substring search of cask tokens and formula names for text. |
|
||||||
| `bsl` | `brew services list` | List all running services. |
|
| `bsl` | `brew services list` | List all running services. |
|
||||||
| `bsoff` | `brew services stop` | Stop the service and unregister it from launching at login (or boot). |
|
| `bsoff` | `brew services stop` | Stop the service and unregister it from launching at login (or boot). |
|
||||||
|
|||||||
@@ -48,13 +48,10 @@ alias bcup='brew upgrade --cask'
|
|||||||
alias bdr='brew doctor'
|
alias bdr='brew doctor'
|
||||||
alias bfu='brew upgrade --formula'
|
alias bfu='brew upgrade --formula'
|
||||||
alias bi='brew install'
|
alias bi='brew install'
|
||||||
alias bih='brew install --HEAD'
|
|
||||||
alias bl='brew list'
|
alias bl='brew list'
|
||||||
alias bo='brew outdated'
|
alias bo='brew outdated'
|
||||||
alias br='brew reinstall'
|
|
||||||
alias brewp='brew pin'
|
alias brewp='brew pin'
|
||||||
alias brewsp='brew list --pinned'
|
alias brewsp='brew list --pinned'
|
||||||
alias brh='brew reinstall --HEAD'
|
|
||||||
alias bs='brew search'
|
alias bs='brew search'
|
||||||
alias bsl='brew services list'
|
alias bsl='brew services list'
|
||||||
alias bsoff='brew services stop'
|
alias bsoff='brew services stop'
|
||||||
|
|||||||
@@ -1,143 +0,0 @@
|
|||||||
# hcloud plugin
|
|
||||||
|
|
||||||
This plugin adds completion for the [Hetzner Cloud CLI](https://github.com/hetznercloud/cli),
|
|
||||||
as well as some aliases for common hcloud commands.
|
|
||||||
|
|
||||||
To use it, add `hcloud` to the plugins array in your zshrc file:
|
|
||||||
|
|
||||||
```zsh
|
|
||||||
plugins=(... hcloud)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Aliases
|
|
||||||
|
|
||||||
| Alias | Command | Description |
|
|
||||||
| :--------- | :---------------------------------------- | :------------------------------------------------------------ |
|
|
||||||
| hc | `hcloud` | The hcloud command |
|
|
||||||
| | | **Context Management** |
|
|
||||||
| hcctx | `hcloud context` | Manage contexts |
|
|
||||||
| hcctxls | `hcloud context list` | List all contexts |
|
|
||||||
| hcctxu | `hcloud context use` | Use a context |
|
|
||||||
| hcctxc | `hcloud context create` | Create a new context |
|
|
||||||
| hcctxd | `hcloud context delete` | Delete a context |
|
|
||||||
| hcctxa | `hcloud context active` | Show active context |
|
|
||||||
| | | **Server Management** |
|
|
||||||
| hcs | `hcloud server` | Manage servers |
|
|
||||||
| hcsl | `hcloud server list` | List all servers |
|
|
||||||
| hcsc | `hcloud server create` | Create a server |
|
|
||||||
| hcsd | `hcloud server delete` | Delete a server |
|
|
||||||
| hcsdesc | `hcloud server describe` | Describe a server |
|
|
||||||
| hcspoff | `hcloud server poweroff` | Power off a server |
|
|
||||||
| hcspon | `hcloud server poweron` | Power on a server |
|
|
||||||
| hcsr | `hcloud server reboot` | Reboot a server |
|
|
||||||
| hcsreset | `hcloud server reset` | Reset a server |
|
|
||||||
| hcssh | `hcloud server ssh` | SSH into a server |
|
|
||||||
| hcse | `hcloud server enable-rescue` | Enable rescue mode for a server |
|
|
||||||
| hcsdr | `hcloud server disable-rescue` | Disable rescue mode for a server |
|
|
||||||
| hcsip | `hcloud server ip` | Manage server IPs |
|
|
||||||
| hcsa | `hcloud server attach-iso` | Attach an ISO to a server |
|
|
||||||
| hcsda | `hcloud server detach-iso` | Detach an ISO from a server |
|
|
||||||
| hcscip | `hcloud server change-type` | Change server type |
|
|
||||||
| | | **Volume Management** |
|
|
||||||
| hcv | `hcloud volume` | Manage volumes |
|
|
||||||
| hcvl | `hcloud volume list` | List all volumes |
|
|
||||||
| hcvc | `hcloud volume create` | Create a volume |
|
|
||||||
| hcvd | `hcloud volume delete` | Delete a volume |
|
|
||||||
| hcvdesc | `hcloud volume describe` | Describe a volume |
|
|
||||||
| hcva | `hcloud volume attach` | Attach a volume to a server |
|
|
||||||
| hcvda | `hcloud volume detach` | Detach a volume from a server |
|
|
||||||
| hcvr | `hcloud volume resize` | Resize a volume |
|
|
||||||
| | | **Network Management** |
|
|
||||||
| hcn | `hcloud network` | Manage networks |
|
|
||||||
| hcnl | `hcloud network list` | List all networks |
|
|
||||||
| hcnc | `hcloud network create` | Create a network |
|
|
||||||
| hcnd | `hcloud network delete` | Delete a network |
|
|
||||||
| hcndesc | `hcloud network describe` | Describe a network |
|
|
||||||
| hcnas | `hcloud network add-subnet` | Add a subnet to a network |
|
|
||||||
| hcnds | `hcloud network delete-subnet` | Delete a subnet from a network |
|
|
||||||
| hcnar | `hcloud network add-route` | Add a route to a network |
|
|
||||||
| hcndr | `hcloud network delete-route` | Delete a route from a network |
|
|
||||||
| | | **Floating IP Management** |
|
|
||||||
| hcfip | `hcloud floating-ip` | Manage floating IPs |
|
|
||||||
| hcfipl | `hcloud floating-ip list` | List all floating IPs |
|
|
||||||
| hcfipc | `hcloud floating-ip create` | Create a floating IP |
|
|
||||||
| hcfipd | `hcloud floating-ip delete` | Delete a floating IP |
|
|
||||||
| hcfipdesc | `hcloud floating-ip describe` | Describe a floating IP |
|
|
||||||
| hcfipa | `hcloud floating-ip assign` | Assign a floating IP to a server |
|
|
||||||
| hcfipua | `hcloud floating-ip unassign` | Unassign a floating IP from a server |
|
|
||||||
| | | **SSH Key Management** |
|
|
||||||
| hcsk | `hcloud ssh-key` | Manage SSH keys |
|
|
||||||
| hcskl | `hcloud ssh-key list` | List all SSH keys |
|
|
||||||
| hcskc | `hcloud ssh-key create` | Create an SSH key |
|
|
||||||
| hcskd | `hcloud ssh-key delete` | Delete an SSH key |
|
|
||||||
| hcskdesc | `hcloud ssh-key describe` | Describe an SSH key |
|
|
||||||
| hcsku | `hcloud ssh-key update` | Update an SSH key |
|
|
||||||
| | | **Image Management** |
|
|
||||||
| hci | `hcloud image` | Manage images |
|
|
||||||
| hcil | `hcloud image list` | List all images |
|
|
||||||
| hcid | `hcloud image delete` | Delete an image |
|
|
||||||
| hcidesc | `hcloud image describe` | Describe an image |
|
|
||||||
| hciu | `hcloud image update` | Update an image |
|
|
||||||
| | | **Firewall Management** |
|
|
||||||
| hcfw | `hcloud firewall` | Manage firewalls |
|
|
||||||
| hcfwl | `hcloud firewall list` | List all firewalls |
|
|
||||||
| hcfwc | `hcloud firewall create` | Create a firewall |
|
|
||||||
| hcfwd | `hcloud firewall delete` | Delete a firewall |
|
|
||||||
| hcfwdesc | `hcloud firewall describe` | Describe a firewall |
|
|
||||||
| hcfwar | `hcloud firewall add-rule` | Add a rule to a firewall |
|
|
||||||
| hcfwdr | `hcloud firewall delete-rule` | Delete a rule from a firewall |
|
|
||||||
| hcfwas | `hcloud firewall apply-to-resource` | Apply a firewall to a resource |
|
|
||||||
| hcfwrs | `hcloud firewall remove-from-resource` | Remove a firewall from a resource |
|
|
||||||
| | | **Load Balancer Management** |
|
|
||||||
| hclb | `hcloud load-balancer` | Manage load balancers |
|
|
||||||
| hclbl | `hcloud load-balancer list` | List all load balancers |
|
|
||||||
| hclbc | `hcloud load-balancer create` | Create a load balancer |
|
|
||||||
| hclbd | `hcloud load-balancer delete` | Delete a load balancer |
|
|
||||||
| hclbdesc | `hcloud load-balancer describe` | Describe a load balancer |
|
|
||||||
| hclbu | `hcloud load-balancer update` | Update a load balancer |
|
|
||||||
| hclbas | `hcloud load-balancer add-service` | Add a service to a load balancer |
|
|
||||||
| hclbds | `hcloud load-balancer delete-service` | Delete a service from a load balancer |
|
|
||||||
| hclbat | `hcloud load-balancer add-target` | Add a target to a load balancer |
|
|
||||||
| hclbdt | `hcloud load-balancer delete-target` | Delete a target from a load balancer |
|
|
||||||
| | | **Certificate Management** |
|
|
||||||
| hccert | `hcloud certificate` | Manage certificates |
|
|
||||||
| hccertl | `hcloud certificate list` | List all certificates |
|
|
||||||
| hccertc | `hcloud certificate create` | Create a certificate |
|
|
||||||
| hccertd | `hcloud certificate delete` | Delete a certificate |
|
|
||||||
| hccertdesc | `hcloud certificate describe` | Describe a certificate |
|
|
||||||
| hccertu | `hcloud certificate update` | Update a certificate |
|
|
||||||
| | | **Datacenter and Location Info** |
|
|
||||||
| hcdc | `hcloud datacenter list` | List all datacenters |
|
|
||||||
| hcloc | `hcloud location list` | List all locations |
|
|
||||||
| hcst | `hcloud server-type list` | List all server types |
|
|
||||||
| hcit | `hcloud image list --type system` | List all system images |
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
This plugin requires the [Hetzner Cloud CLI](https://github.com/hetznercloud/cli) to be installed.
|
|
||||||
|
|
||||||
### Installation
|
|
||||||
|
|
||||||
Install the Hetzner Cloud CLI using one of the following methods:
|
|
||||||
|
|
||||||
**macOS (Homebrew):**
|
|
||||||
```bash
|
|
||||||
brew install hcloud
|
|
||||||
```
|
|
||||||
|
|
||||||
**Linux (from source):**
|
|
||||||
```bash
|
|
||||||
go install github.com/hetznercloud/cli/cmd/hcloud@latest
|
|
||||||
```
|
|
||||||
|
|
||||||
**Or download a prebuilt binary from the [releases page](https://github.com/hetznercloud/cli/releases).**
|
|
||||||
|
|
||||||
### Setup
|
|
||||||
|
|
||||||
After installation, create a context and authenticate:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
hcloud context create my-project
|
|
||||||
```
|
|
||||||
|
|
||||||
You'll be prompted to enter your Hetzner Cloud API token, which you can generate in the [Hetzner Cloud Console](https://console.hetzner.cloud/).
|
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
# hcloud plugin for oh-my-zsh
|
|
||||||
# Hetzner Cloud CLI: https://github.com/hetznercloud/cli
|
|
||||||
|
|
||||||
if (( ! $+commands[hcloud] )); then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If the completion file doesn't exist yet, we need to autoload it and
|
|
||||||
# bind it to `hcloud`. Otherwise, compinit will have already done that.
|
|
||||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_hcloud" ]]; then
|
|
||||||
typeset -g -A _comps
|
|
||||||
autoload -Uz _hcloud
|
|
||||||
_comps[hcloud]=_hcloud
|
|
||||||
fi
|
|
||||||
|
|
||||||
hcloud completion zsh 2> /dev/null >| "$ZSH_CACHE_DIR/completions/_hcloud" &|
|
|
||||||
|
|
||||||
# Main alias
|
|
||||||
alias hc='hcloud'
|
|
||||||
|
|
||||||
# Context management
|
|
||||||
alias hcctx='hcloud context'
|
|
||||||
alias hcctxls='hcloud context list'
|
|
||||||
alias hcctxu='hcloud context use'
|
|
||||||
alias hcctxc='hcloud context create'
|
|
||||||
alias hcctxd='hcloud context delete'
|
|
||||||
alias hcctxa='hcloud context active'
|
|
||||||
|
|
||||||
# Server management
|
|
||||||
alias hcs='hcloud server'
|
|
||||||
alias hcsl='hcloud server list'
|
|
||||||
alias hcsc='hcloud server create'
|
|
||||||
alias hcsd='hcloud server delete'
|
|
||||||
alias hcsdesc='hcloud server describe'
|
|
||||||
alias hcspoff='hcloud server poweroff'
|
|
||||||
alias hcspon='hcloud server poweron'
|
|
||||||
alias hcsr='hcloud server reboot'
|
|
||||||
alias hcsreset='hcloud server reset'
|
|
||||||
alias hcssh='hcloud server ssh'
|
|
||||||
alias hcse='hcloud server enable-rescue'
|
|
||||||
alias hcsdr='hcloud server disable-rescue'
|
|
||||||
alias hcsip='hcloud server ip'
|
|
||||||
|
|
||||||
# Server actions
|
|
||||||
alias hcsa='hcloud server attach-iso'
|
|
||||||
alias hcsda='hcloud server detach-iso'
|
|
||||||
alias hcscip='hcloud server change-type'
|
|
||||||
|
|
||||||
# Volume management
|
|
||||||
alias hcv='hcloud volume'
|
|
||||||
alias hcvl='hcloud volume list'
|
|
||||||
alias hcvc='hcloud volume create'
|
|
||||||
alias hcvd='hcloud volume delete'
|
|
||||||
alias hcvdesc='hcloud volume describe'
|
|
||||||
alias hcva='hcloud volume attach'
|
|
||||||
alias hcvda='hcloud volume detach'
|
|
||||||
alias hcvr='hcloud volume resize'
|
|
||||||
|
|
||||||
# Network management
|
|
||||||
alias hcn='hcloud network'
|
|
||||||
alias hcnl='hcloud network list'
|
|
||||||
alias hcnc='hcloud network create'
|
|
||||||
alias hcnd='hcloud network delete'
|
|
||||||
alias hcndesc='hcloud network describe'
|
|
||||||
alias hcnas='hcloud network add-subnet'
|
|
||||||
alias hcnds='hcloud network delete-subnet'
|
|
||||||
alias hcnar='hcloud network add-route'
|
|
||||||
alias hcndr='hcloud network delete-route'
|
|
||||||
|
|
||||||
# Floating IP management
|
|
||||||
alias hcfip='hcloud floating-ip'
|
|
||||||
alias hcfipl='hcloud floating-ip list'
|
|
||||||
alias hcfipc='hcloud floating-ip create'
|
|
||||||
alias hcfipd='hcloud floating-ip delete'
|
|
||||||
alias hcfipdesc='hcloud floating-ip describe'
|
|
||||||
alias hcfipa='hcloud floating-ip assign'
|
|
||||||
alias hcfipua='hcloud floating-ip unassign'
|
|
||||||
|
|
||||||
# SSH key management
|
|
||||||
alias hcsk='hcloud ssh-key'
|
|
||||||
alias hcskl='hcloud ssh-key list'
|
|
||||||
alias hcskc='hcloud ssh-key create'
|
|
||||||
alias hcskd='hcloud ssh-key delete'
|
|
||||||
alias hcskdesc='hcloud ssh-key describe'
|
|
||||||
alias hcsku='hcloud ssh-key update'
|
|
||||||
|
|
||||||
# Image management
|
|
||||||
alias hci='hcloud image'
|
|
||||||
alias hcil='hcloud image list'
|
|
||||||
alias hcid='hcloud image delete'
|
|
||||||
alias hcidesc='hcloud image describe'
|
|
||||||
alias hciu='hcloud image update'
|
|
||||||
|
|
||||||
# Firewall management
|
|
||||||
alias hcfw='hcloud firewall'
|
|
||||||
alias hcfwl='hcloud firewall list'
|
|
||||||
alias hcfwc='hcloud firewall create'
|
|
||||||
alias hcfwd='hcloud firewall delete'
|
|
||||||
alias hcfwdesc='hcloud firewall describe'
|
|
||||||
alias hcfwar='hcloud firewall add-rule'
|
|
||||||
alias hcfwdr='hcloud firewall delete-rule'
|
|
||||||
alias hcfwas='hcloud firewall apply-to-resource'
|
|
||||||
alias hcfwrs='hcloud firewall remove-from-resource'
|
|
||||||
|
|
||||||
# Load balancer management
|
|
||||||
alias hclb='hcloud load-balancer'
|
|
||||||
alias hclbl='hcloud load-balancer list'
|
|
||||||
alias hclbc='hcloud load-balancer create'
|
|
||||||
alias hclbd='hcloud load-balancer delete'
|
|
||||||
alias hclbdesc='hcloud load-balancer describe'
|
|
||||||
alias hclbu='hcloud load-balancer update'
|
|
||||||
alias hclbas='hcloud load-balancer add-service'
|
|
||||||
alias hclbds='hcloud load-balancer delete-service'
|
|
||||||
alias hclbat='hcloud load-balancer add-target'
|
|
||||||
alias hclbdt='hcloud load-balancer delete-target'
|
|
||||||
|
|
||||||
# Certificate management
|
|
||||||
alias hccert='hcloud certificate'
|
|
||||||
alias hccertl='hcloud certificate list'
|
|
||||||
alias hccertc='hcloud certificate create'
|
|
||||||
alias hccertd='hcloud certificate delete'
|
|
||||||
alias hccertdesc='hcloud certificate describe'
|
|
||||||
alias hccertu='hcloud certificate update'
|
|
||||||
|
|
||||||
# Datacenter and location info
|
|
||||||
alias hcdc='hcloud datacenter list'
|
|
||||||
alias hcloc='hcloud location list'
|
|
||||||
alias hcst='hcloud server-type list'
|
|
||||||
alias hcit='hcloud image list --type system'
|
|
||||||
@@ -385,9 +385,9 @@ kube_ps1() {
|
|||||||
local KUBE_PS1_RESET_COLOR="${_KUBE_PS1_OPEN_ESC}${_KUBE_PS1_DEFAULT_FG}${_KUBE_PS1_CLOSE_ESC}"
|
local KUBE_PS1_RESET_COLOR="${_KUBE_PS1_OPEN_ESC}${_KUBE_PS1_DEFAULT_FG}${_KUBE_PS1_CLOSE_ESC}"
|
||||||
|
|
||||||
# If background color is set, reset color should also reset the background
|
# If background color is set, reset color should also reset the background
|
||||||
if [[ -n "${KUBE_PS1_BG_COLOR}" ]]; then
|
# if [[ -n "${KUBE_PS1_BG_COLOR}" ]]; then
|
||||||
KUBE_PS1_RESET_COLOR="${_KUBE_PS1_OPEN_ESC}${_KUBE_PS1_DEFAULT_FG}${_KUBE_PS1_DEFAULT_BG}${_KUBE_PS1_CLOSE_ESC}"
|
# KUBE_PS1_RESET_COLOR="${_KUBE_PS1_OPEN_ESC}${_KUBE_PS1_DEFAULT_FG}${_KUBE_PS1_DEFAULT_BG}${_KUBE_PS1_CLOSE_ESC}"
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
# Background Color
|
# Background Color
|
||||||
[[ -n "${KUBE_PS1_BG_COLOR}" ]] && KUBE_PS1+="$(_kube_ps1_color_bg "${KUBE_PS1_BG_COLOR}")"
|
[[ -n "${KUBE_PS1_BG_COLOR}" ]] && KUBE_PS1+="$(_kube_ps1_color_bg "${KUBE_PS1_BG_COLOR}")"
|
||||||
|
|||||||
Reference in New Issue
Block a user