GNOME Extensions CLI – Manage your extensions from the Terminal

GNOME Extensions CLI – Manage your extensions from the Terminal

If you are using any Linux distribution which uses GNOME as its desktop environment, then you should probably use extensions to make your desktop look better or just improve its functionality. We have already discussed the Graphical method through which you can install extensions on your GNOME desktop environment.

However, the GUI method requires you to open a web browser and install a browser extension. Which although is easy, but it requires a middle step. And therefore, in this tutorial, I will show you how to install the GNOME extensions and set it up directly from the Terminal using a command line application called gnome-extensions-cli. We will also be discussing all the features of this tool. Note that this is an unofficial application, but it does the job really well.

Features of GNOME extensions CLI

This command line tool has the following features:

  • It can install any extension that is available on the GNOME extensions website.
  • It uses DBus to communicate with GNOME shell, just like the Firefox extension does. But it can also support Non-DBus installations if needed.
  • It is also able to either install it directly using the interactive prompts or just extracting the extensions in the ~/.local/share/gnome-shell/extensions/ directory.
  • You will also be able to search the extensions if you do not know the name.
  • It will automatically select the correct version of the extension depending upon the version of your GNOME shell.
  • It will also be able to update all your GNOME extensions from the command line.
  • It does have a limitation that you cannot use it over SSH.

Installing GNOME Extensions CLI

It is available as a python package and hence you can install it using the PyPI, but the PipX is the recommended method. To do that, you can install it on your system by typing the following command, depending upon your Linux distribution:

# On Debian and Ubuntu based distributions:
sudo apt install pipx

# On Fedora Workstation
sudo dnf install pipx

# On Arch Linux based distributions
sudo pacman -S python-pipx
Installing PipX On Fedora
Installing PipX On Fedora

Once PipX is installed, you can now proceed with the installation of gnome-extensions-cli.

pipx install gnome-extensions-cli --system-site-packages
Installing GNOME Extensions CLI Using PipX
Installing GNOME Extensions CLI Using PipX

Usage of GNOME Extensions CLI

To use this CLI tool, you can either use the gnome-extensions-cli or getext commands. To list all the installed extensions, you can type the following command:

gnome-extensions-cli list
Listing The Installed Extensions
Listing The Installed Extensions

In order to search new extensions, you can use the gnome-extensions-cli command with the search command. Note that, you should use this command.

gnome-extensions-cli search dash to panel | more
Searching For Extensions In The Command Line
Searching For Extensions In The Command Line

If you want to install the extension, then simply type the following command:

gnome-extensions-cli install [email protected]
Installing Dash To Dock Using The Command Line
Installing Dash To Panel Using The Command Line

If you want to disable or enable the extension, you can do that by using the disable or enable flags respectively along with the gnome-extensions-cli like this:

gnome-extensions-cli disable [email protected]
DIsabling An Extension Using The Command Line
Disabling An Extension Using The Command Line

If you want to open the configuration window of an extension, you can do that by using the ‘preferences’ flag along with the gnome extensions CLI command like this:

gnome-extensions-cli preferences dash-to-dock
Opening An Extension Settings
Opening Extension Settings

If you want to show more details about how this command works and learn about all the available options, then you can do that by using the help flag.

gnome-extensions-flag -h
Use The Help Flag To Understand The Options Of This Command
Use The Help Flag To Understand The Options Of This Command

Similarly, if you want to update the extension from the command line, you can update them by using the update -a flag along with the command.

Using GNOME’s built-in extensions command

GNOME Shell has shipped its own gnome-extensions command since version 3.34, so no separate install is needed since it comes bundled with the desktop. It is easy to confuse with the third-party gnome-extensions-cli tool covered above, but the two solve different problems.

List installed extensions with:

gnome-extensions list

Enable, disable or remove an extension by UUID:

gnome-extensions enable [email protected]
gnome-extensions disable [email protected]
gnome-extensions uninstall [email protected]

Use info UUID to check what an extension is doing and prefs UUID to open its settings window. The install command takes a local zip file, so it works best after downloading a package rather than pulling one live from the extensions site.

This is where the two tools complement each other well. gnome-extensions cannot search or download from extensions.gnome.org on its own, so search and install with gnome-extensions-cli first, then switch to the built-in command for everyday enabling and disabling.

The built-in tool is also a solid pick over SSH, since most of its commands work directly against local files without needing an active GNOME session, unlike gnome-extensions-cli’s default DBus mode covered earlier.

Key Takeaways

  • gnome-extensions-cli manages GNOME Shell extensions entirely from the terminal.
  • Install it with pipx install gnome-extensions-cli –system-site-packages.
  • Use list, search, install, enable, disable and preferences to manage extensions.
  • Pipe search output through more to avoid a wall of text.
  • update -a refreshes every installed extension in one command.
  • The default DBus mode needs a GNOME session, so use –filesystem over SSH.
  • GNOME Shell also ships a built-in gnome-extensions command, no install needed.
  • Search and install with gnome-extensions-cli, then manage day-to-day with gnome-extensions.

Frequently Asked Questions

What is gnome-extensions-cli used for?

gnome-extensions-cli is a command line tool that installs, searches, updates and manages GNOME Shell extensions directly from the terminal, without needing a web browser or browser extension.

How do I install gnome-extensions-cli on Linux?

Install pipx first with your package manager, then run pipx install gnome-extensions-cli –system-site-packages to set up the tool in an isolated environment.

Can I use gnome-extensions-cli over SSH?

Not in its default DBus mode, which needs an active GNOME session. Switch to the –filesystem backend to install and manage extensions over a remote SSH connection.

What is the difference between gnome-extensions-cli and gnome-extensions?

gnome-extensions-cli can search and install extensions from extensions.gnome.org directly, while the built-in gnome-extensions command only manages extensions already installed or downloaded locally.

How do I update all my GNOME extensions from the terminal?

Run gnome-extensions-cli update -a to refresh every installed extension at once, or update a single extension by giving its UUID instead of -a.

Why does gnome-extensions-cli search show so much output?

The search command can return hundreds of matching extensions at once. Pipe the output through more or less, like search dash to panel | more, to page through it.

Does gnome-extensions-cli work on Fedora and Arch, not just Ubuntu?

Yes. Install pipx through dnf on Fedora or pacman on Arch, then install gnome-extensions-cli the same way you would on Debian or Ubuntu.

Summary

Overall, Gnome Extensions CLI is a great hassle-free command line tool which you can use to manage your installed extension as well as install new ones. There is only one thing which I found a bit less polished was the search flag, because it would give all the output (which was in hundreds) in one go and I had to scroll up to get the desired result. This can be easily solved using the ‘more’ or ‘less’ command with the GNOME extensions CLI command as a workaround.