Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Die interaktive gcloud-Shell ermöglicht eine umfassendere bash-Nutzung und vereinfacht die Befehls- und Dokumentationserkennung mit automatischer Vervollständigung und Snippets.
Die interaktive Shell gcloud erzeugt Vorschläge und automatische Vervollständigung für jeden Befehl, der eine man-Seite hat, einschließlich der Befehlszeilentools gcloud, bq, gsutil und kubectl. Während der Eingabe eines Befehls werden Unterbefehle, Flags sowie Datei- und Ressourcenargumente vervollständigt und die Inline-Hilfe im unteren Abschnitt angezeigt.
Weitere Informationen zur interaktiven Shell und ihren Tastenkombinationen, Steuerzeichen, Bearbeitungsmodi und konfigurierbaren Layoutoptionen finden Sie auf der Referenzseite gcloud beta interactive.
Installation und Verwendung
Die interaktive Shell gcloud ist in den gcloud beta-Komponenten enthalten.
Prüfen Sie mit dem folgenden Befehl, ob die gcloud beta-Komponenten installiert sind:
gcloud components list
Wenn die Komponenten gcloud beta nicht aufgeführt sind, führen Sie den folgenden Befehl aus, um die Betakomponenten zu installieren:
gcloud components install beta
Führen Sie den folgenden Befehl aus, um in den interaktiven gcloud-Modus zu wechseln:
gcloud beta interactive
Die normale Shell-Eingabeaufforderung wird durch die Eingabeaufforderung $ der interaktiven gcloud-Shell ersetzt.
Geben Sie einen Befehl ein, um automatische Vorschläge und Inline-Hilfe zu erhalten.
Wenn Sie eine Zeit lang mit einem Befehl arbeiten möchten, geben Sie den Teil des Befehls ein, den Sie wiederverwenden möchten, und drücken Sie dann F7. Wenn Sie beispielsweise mit gcloud compute arbeiten möchten, geben Sie gcloud compute ein und drücken Sie dann F7. Sie können dann Unterbefehle wie list eingeben, ohne den ersten Typ gcloud compute eingeben zu müssen. Wenn Sie den Befehl nicht mehr verwenden, drücken Sie Ctrl-C und F7, um den Kontext zu löschen.
So beenden Sie den interaktiven Shell-Typ: Ctrl-D oder F9
Automatische Vervollständigung und Hilfe
gcloud interactive bietet eine automatische Eingabeaufforderung für Befehle und Flags. Beim Eingeben eines Befehls werden im unteren Bereich Inline-Hilfe-Snippets angezeigt.
Statische Informationen wie Befehls- und Unterbefehlsnamen sowie Flag-Namen und Aufzählungs-Flag-Werte werden mithilfe von Dropdown-Menüs automatisch vervollständigt.
Tastenkombinationen
Für gängige Aufgaben können Sie die folgenden Tastenkombinationen verwenden:
Aktion
Tastenkombination
Dateipfad oder Ressourcenargument ausfüllen
Tab
Drop-down-Menü optimieren
Befehl weiter eingeben
Im Menü scrollen
Tab, Shift+Tab oder Pfeile
Markiertes Element oder Verzeichnis auswählen
Space oder /
Aktiven Hilfebereich wechseln (bei Aktivierung ON, bei Deaktivierung OFF).
F2
Kontext für Befehlseingabe festlegen, um eine erneute Eingabe von Befehlspräfixen zu vermeiden
F7
Kontext für Befehlseingabe löschen
Ctrl-C und F7
Webbrowser-Tab oder -Fenster öffnen, um die vollständige Manpage für den aktuellen Befehl anzuzeigen
F8
Beenden
F9 oder Ctrl+D
Bash-Kompatibilität
bash-Abschlusskonfigurationen, Aliasnamen, Exporte, Funktionen, set -o-Einstellungen und Variablen, die in Ihrem .bashrc initialisiert wurden, sind alle an der interaktiven Eingabeaufforderung verfügbar. Der Bearbeitungsmodus der interaktiven Befehlszeile wird von der Einstellung set -o emacs oder set -o vi abgeleitet.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[],[],null,["# Using gcloud interactive shell\n\n| **Beta**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThe `gcloud` interactive shell provides a richer `bash` experience, simplifying\ncommand and documentation discovery with as-you-type autocompletion and\nhelp text snippets.\n\nThe `gcloud` interactive shell produces suggestions and auto-completion for any\ncommand that has a manual (man) page, including the `gcloud`, `bq`, `gsutil`,\nand `kubectl` command-line tools. As you type a command, sub-commands, flags,\nand file and resource arguments are completed and inline help is displayed in\nthe lower section.\n\nFor more information about the interactive shell and its shortcuts, control\ncharacters, editor modes, and configurable layout options, see the\n[`gcloud beta interactive`](/sdk/gcloud/reference/beta/interactive)\nreference page.\n\nInstallation and use\n--------------------\n\nThe `gcloud` interactive shell is included in the `gcloud beta` components.\n\n1. To check if you have the `gcloud beta` components installed, run the\n following command:\n\n gcloud components list\n\n2. If you don't see the `gcloud beta` components listed, to install the beta\n components, run the following command:\n\n gcloud components install beta\n\n3. To enter the `gcloud` interactive mode, run the following command:\n\n gcloud beta interactive\n\n Your usual shell prompt is replaced with the `gcloud` interactive\n shell prompt `$`.\n4. To get auto-suggestions and inline help, start typing a command.\n\n5. To save time when you're working with a command for a while, type the part of\n the command you'll reuse and then press `F7`. For example, to work with\n `gcloud compute`, type `gcloud compute` and then press `F7`. You can then\n type subcommands such as `list` without needing to first type\n `gcloud compute`. When you're no longer using the command, press `Ctrl-C` and\n `F7` to clear the context.\n\n6. To exit the interactive shell press `Ctrl-D` or `F9`.\n\nAuto-completion and help\n------------------------\n\n`gcloud interactive` has auto prompting for commands and flags, and displays\ninline help snippets in the lower section as you type a command.\n\nStatic information, like command and sub-command names, and flag names and\nenumerated flag values, are auto-completed using dropdown menus.\n\nShortcuts\n---------\n\nTo accomplish common tasks, you can use the following shortcuts:\n\nBash compatibility\n------------------\n\n`bash` completion configs, aliases, exports, functions, `set -o` settings,\nand variables initialized in your `.bashrc` are all available at the\ninteractive command prompt. The interactive command line edit mode is derived\nfrom the `set -o emacs` or `set -o vi` setting."]]