- NAME
-
- gcloud beta interactive - start the gcloud interactive shell
- SYNOPSIS
-
-
gcloud beta interactive[--context=CONTEXT] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
(BETA)gcloud beta interactiveprovides an enhancedbash(1) command line with features that include:- auto-completion and active help for all commands
-
state preservation across commands:
cd, local/environment variables
- Display
-
The
gcloud beta interactivedisplay window is divided into sections, described here from top to bottom.Previous Output- Command output scrolls above the command input section as commands are executed.
Command Input- Commands are typed, completed, and edited in this section. The default prompt is "$ ". If a context has been set, then its tokens are prepopulated before the cursor.
Active Help-
As you type, this section displays in-line help summaries for commands, flags,
and arguments. You can toggle active help on and off via the
F2key. HitF8to display the help text in your browser. Status Display-
Current
gcloudproject and account information, and function key descriptions and settings are displayed in this section. Function keys toggle mode/state settings or run specific actions.F2:help:STATE-
Toggles the active help section,
ONwhen enabled,OFFwhen disabled. F7:context-
Sets the context for command input, so you won't have to re-type common command
prefixes at every prompt. The context is the command line from just after the
prompt up to the cursor.
For example, if you are about to work with
gcloud computefor a while, typegcloud computeand hitF7. This will displaygcloud computeat subsequent prompts until the context is changed.Hit ctrl-c and
F7to clear the context, or edit a command line and/or move the cursor and hitF7to set a different context. F8:web-help-
Opens a web browser tab/window to display the complete man page help for the
current command. If there is no active web browser (running in
ssh(1) for example), then command specific help orman(1) help is attempted. F9:quit- Exit.
- Auto and Tab Completion
-
Command completions are displayed in a scrolling pop-up menu. Use
taband up/down keys to navigate the completions, andspaceor/to select the highlighted completion.Completions for
knowncommands, flags, and static flag values are displayed automatically. Positional and dynamic flag value completions for known commands are displayed aftertabis entered. Known commands includegcloud,bq,gsutil,kubectl, and any command with a man page that has been executed at least once in anyinteractivesession.tabcompletion for unknown commands defers tobash(1), while still using theinteractiveuser interface. Absent specific command information, a file/path completer is used whentabis entered for unknown positionals (arguments that do not start with '-'). The default completer handles '~' path notation and embedded$varreferences, but does not expand their values in completions.Configure bash completions as you normally would.
gcloud beta interactivestarts up bash in a mode that sources~/.bashrcwith the environment variableCOSHELL_VERSIONset to a non-empty version value.Command completion resets with each simple command in the command line. Simple commands are separated by '|', ';', '&' and may appear after '$(', '(', '{', '!',
if,then,elif,while, andname=valueper command exports. Usetabon an empty line to enable command executable search on PATH for the first token in each simple command.Currently simple and compound commands must be entered in a single line.
Refer to Using gcloud interactive for more information and animated GIFs.
- Control Characters
-
Control characters affect the currently running command or the current command
line being entered at the prompt.
ctrl-c- If a command is currently running, then that command is interrupted. This terminates the command. Otherwise, if no command is running, ctrl-c clears the current command line.
ctrl-d-
Exits when entered as the first character at the command prompt. You can also
run the
exitcommand at the prompt. ctrl-w- If a command is not currently running, then the last word on the command line is deleted. This is handy for "walking back" partial completions.
- Command history
-
gcloud beta interactivemaintains persistent command history across sessions. - emacs mode
-
- ^N">
^N -
Move ahead one line in the history.
- ^P">
^P - Move back one line in the history.
- ^R">
^R - Search backwards in the history.
- ^P">
- ^N">
- vi mode
-
- /
-
Search backwards in the history.
j- Move ahead one line in the history.
k- Move back one line in the history.
n- Search backwards for the next match.
N- Search forwards for the next match.
- history search mode
-
ENTER/RETURN-
Retrieve the matched command line from the history.
- ^R-1">
^R - Search backwards for the next match.
- ^S">
^S - Search forwards for the next match.
- ^R-1">
- Layout Configuration
-
Parts of the layout are configurable via
$ gcloud config setinteractive/property. These properties are only checked at startup. You must exit and restart to see the effects of new settings.bottom_bindings_line-
If True, display the bottom key bindings line. The default value is
true. bottom_status_line-
If True, display the bottom status line. The default value is
false. -
Number of lines in the completion menu. The default value is
4. context- Command context string. The default value is "".
debug-
If True, enable the debugging display. The default value is
false. fixed_prompt_position-
If True, display the prompt at the same position. The default value is
false. help_lines-
Maximum number of help snippet lines. The default value is
10. -
If True, expose hidden commands/flags. The default value is
false. justify_bottom_lines-
If True, left- and right-justify bottom toolbar lines. The default value is
false. manpage_generator-
If True, use the manpage CLI tree generator for unsupported commands. The
default value is
true. -
If True, display the completions as a multi-column menu. The default value is
false. obfuscate-
If True, obfuscate status PII. The default value is
false. prompt- Command prompt string. The default value is "$ ".
show_help-
If True, show help as command args are being entered. The default value is
true. suggest-
If True, add command line suggestions based on history. The default value is
false.
- CLI Trees
-
gcloud beta interactiveuses CLI tree data files for typeahead, command line completion, and help snippet generation. A few CLI trees are installed with their respective Google Cloud CLI components:gcloud(core component),bq,gsutil, andkubectl. Trees for commands that have man(1) pages are generated on the fly. See$ gcloud topic cli-treesfor details. - EXAMPLES
-
To set the command context of
gcloud beta interactiveto "gcloud ", run:gcloud beta interactive --context="gcloud "
- FLAGS
-
--context=CONTEXT- Default command context. This is a string containing a command name, flags, and arguments. The context is prepopulated in each command line. You can inline edit any part of the context, or ctrl-c to eliminate it.
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$ gcloud helpfor details. - NOTES
-
On Windows, install
git(1) for abash(1) experience.gcloud beta interactivewill then use thegit(MinGW)bashinstead ofcmd.exe.Please run
$ gcloud feedbackto report bugs or request new features.This command is currently in beta and might change without notice. This variant is also available:
gcloud alpha interactive
gcloud beta interactive
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-22 UTC.