Compare commits

..
2 Commits
8 changed files with 82 additions and 0 deletions
+5
View File
@@ -45,6 +45,11 @@
"key": "Docker",
"text": "docker --version 2>/dev/null | cut -d' ' -f3 | tr -d ','"
},
{
"type": "command",
"key": "Kubectl",
"text": "kubectl version --client --output=yaml 2>/dev/null | grep gitVersion | cut -d' ' -f4"
},
{
"type": "command",
"key": "Go",
+1
View File
@@ -0,0 +1 @@
/Applications/OrbStack.app/Contents/MacOS/../Resources/completions/fish/kubectl.fish
+14
View File
@@ -3,10 +3,12 @@ alias ld="ls -lisaGh"
alias g="goto"
alias vim="nvim"
alias code="open -a 'Visual Studio Code'"
alias kubi="open -a 'Lens'"
alias do-st="docker compose"
alias do-re="docker compose down && docker compose up -d"
alias qaserv="TERM=xterm-256color ssh root@195.201.17.47"
alias kc1="set -gx KUBECONFIG ~/.kube/config"
alias ram="vm_stat"
# DevOps Core Tools
@@ -18,6 +20,18 @@ alias dcl="docker compose logs -f"
alias dce="docker compose exec"
alias dps="docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'"
# Kubernetes power aliases
alias k="kubectl"
alias kx="kubectx" # Context switching
alias kn="kubens" # Namespace switching
alias kgp="kubectl get pods -o wide"
alias kgs="kubectl get svc -o wide"
alias kgd="kubectl get deploy -o wide"
alias kl="kubectl logs -f"
alias ke="kubectl exec -it"
alias kdesc="kubectl describe"
alias kpf="kubectl port-forward"
# Testing
alias pw="pnpm exec playwright"
alias pwt="pnpm exec playwright test"
+7
View File
@@ -13,6 +13,13 @@ function docker-cleanup
docker volume prune -f
end
# Kubernetes context info
function kinfo
echo "Context: "(kubectl config current-context)
echo "Namespace: "(kubectl config view --minify -o jsonpath='{..namespace}')
kubectl get nodes --no-headers | wc -l | xargs echo "Nodes:"
end
# Quick YAML validation
function yaml-check
python3 -c "import yaml; yaml.safe_load(open('$argv[1]'))"
+42
View File
@@ -0,0 +1,42 @@
# Kubernetes setup
set -gx KUBECONFIG ~/.kube/config
# Kubernetes aliases
alias k="kubectl"
alias kgp="kubectl get pods"
alias kgn="kubectl get nodes"
alias kgs="kubectl get services"
alias kgc="kubectl config get-contexts"
alias kuc="kubectl config use-context"
alias kns="kubectl config set-context --current --namespace"
# Kubernetes context function
function update_kubernetes_context
if command -q kubectl
set -l kube_ctx (kubectl config current-context 2>/dev/null)
if test $status -eq 0
set -l kube_ns (kubectl config view --minify --output 'jsonpath={..namespace}' 2>/dev/null)
set -gx STARSHIP_KUBERNETES_CONTEXT $kube_ctx
if test -n "$kube_ns"
set -gx STARSHIP_KUBERNETES_NAMESPACE $kube_ns
end
else
set -e STARSHIP_KUBERNETES_CONTEXT
set -e STARSHIP_KUBERNETES_NAMESPACE
end
end
end
# Wrapper for kubectl
function kubectl
command kubectl $argv
set -l exit_code $status
if test $exit_code -eq 0; and test "$argv[1]" = "config"; and contains "$argv[2]" "use-context" "set-context"
update_kubernetes_context
end
return $exit_code
end
# Update context on startup
update_kubernetes_context
+5
View File
@@ -27,3 +27,8 @@ function vdocker
echo "No Docker files found"
end
end
# Edit kubernetes manifests
function vk8s
find . -name "*.yaml" -o -name "*.yml" | grep -E "(k8s|kubernetes|deploy)" | head -5 | xargs nvim
end
+7
View File
@@ -4,6 +4,7 @@ $time\
$directory\
$git_branch\
$git_status\
$kubernetes\
$docker_context\
$python\
$golang\
@@ -50,6 +51,12 @@ staged = "+"
renamed = "»"
deleted = "✘"
[kubernetes]
format = '[$symbol$context( \($namespace\))]($style) '
symbol = "☸ "
style = "bold cyan"
disabled = false
[docker_context]
symbol = " "
format = "[$symbol$context]($style) "
+1
View File
@@ -264,6 +264,7 @@ Das Installationsskript kann optional verschiedene KI-Kommandozeilentools für S
- **Mise Integration** - Modernes Tool- & Node-Version-Management
- **FZF Integration** - Fuzzy finding everywhere
- **Git Shortcuts** - Aliases für häufige Commands
- **Kubernetes** - kubectl completion
- **Auto-completion** - Für Docker, Git, etc.
---