Starship in Toolboxes

Hi, I managed to make Starship work inside Terminal, but whenever I create a Toolbox, I get

bash: starship: command not found

Is it possible to set it up so that it is used inside Toolboxes?

I’m running Silverblue.

Thanks in advance!

You just have to install it in the toolbox too … as the toolbox is using the same .bashrc you do not need to add the command a second time to the .bashrc

It would be interesting to make the .bashrc command as if > then > else if someone likes it just to use on one place.

Add the following to the end of ~/.bashrc:

eval "$(starship init bash)"

To avoid the error message from starship.

Ah okay! I was hoping for a way to have it as some sort of default, as installing it again inside toolboxes felt redundant… But if this is the way, I’ll stop searching :slight_smile: Thank you!

Not sure about toolbox, but ‘export bin’ to user might resolve… I used this method on distrobox to get all as host level

I will have to try distrobox then! Thanks!

1 Like

I might have found a solution. It seems to work after a bit of testing. I take no credit as it was with the help of an LLM. I decided to keep the description as it explains it well for newbies like me!

On Silverblue the usual install path (/usr/local/bin) isn’t ideal for Toolbox because that directory isn’t shared with Toolbox containers. Instead, you can install Starship to a location within your home directory (for example, ~/.local/bin), which Toolbox mounts automatically. This way, Starship becomes available both on the host and inside Toolbox.

To do this, run:

curl -sS https://starship.rs/install.sh | sh -s -- -b ~/.local/bin

After the installation, make sure that ~/.local/bin is in your PATH. You might add something like this to your shell configuration file (e.g. ~/.bashrc or ~/.zshrc):

export PATH="$HOME/.local/bin:$PATH"

This approach avoids the need to reinstall Starship in Toolbox since it’s installed in a shared location.

1 Like