krewfile is just like Brewfile (brew bundle) or Gemfiles but for the krew kubernetes plugin manager.
Define a krewfile like the following at ~/.krewfile
:
# this is a comment
explore # great module
modify-secret
neat
oidc-login
pv-migrate
stern
krew
Now run krewfile
and it will install all the plugins defined in the file and also remove all the plugins that are not in the file.
You can also put your krewfile at any other location and point to that using the -file
CLI parameter.
Lastly, you can use the -command
flag to overwrite the binary to call. By default, krew
is used, but you might as well use -command "kubectl krew"
to use the kubectl plugin instead.
If you have Go 1.16 , you can directly install by running:
go install github.com/brumhard/krewfile@latest
Based on your go configuration the
krewfile
binary can be found in$GOPATH/bin
or$HOME/go/bin
in case$GOPATH
is not set. Make sure to add the respective directory to your$PATH
. For more information see go docs for further information. Rungo env
to view your current configuration.
This repo contains a flake.nix
file which you can use for example with
nix run github:brumhard/krewfile# -- -help
Using home-manager module
If you're using flakes to manage your system, add the krewfile
input as follows:
# ...
inputs.krewfile = {
url = "github:brumhard/krewfile";
inputs.nixpkgs.follows = "nixpkgs";
};
You can now access the module via inputs.krewfile.homeManagerModules.krewfile
.
Assuming a setup with properly configured imports via home-manager.extraSpecialArgs
, the module can be imported and configured as shown below:
{ inputs, pkgs, ... }: {
imports = [
# ...
inputs.krewfile.homeManagerModules.krewfile
];
programs.krewfile = {
enable = true;
krewPackage = pkgs.krew;
plugins = [
"explore"
"modify-secret"
"neat"
"oidc-login"
"pv-migrate"
"stern"
];
};
}