ZKG(1) | Zeek Package Manager | ZKG(1) |
zkg - Zeek Package Manager
A command-line package manager for Zeek.
usage: zkg [-h] [--version] [--configfile FILE | --user] [--verbose] [--extra-source NAME=URL] {test,install,bundle,unbundle,remove,uninstall,purge,refresh,upgrade,load,unload,pin,unpin,list,search,info,config,autoconfig,env,create,template} ...
See Config File.
Environment Variables:
Runs the unit tests for the specified Zeek packages. In most cases, the "zeek" and "zeek-config" programs will need to be in PATH before running this command.
usage: zkg test [-h] [--version VERSION] package [package ...]
Installs packages from a configured package source or directly from a git URL. After installing, the package is marked as being "loaded" (see the load command).
usage: zkg install [-h] [--skiptests] [--nodeps] [--nosuggestions] [--version VERSION] [--force] [--user-var NAME=VAL] package [package ...]
Unloads (see the unload command) and uninstalls a previously installed package.
usage: zkg remove [-h] [--force] [--nodeps] package [package ...]
NOTE:
Unloads (see the unload command) and uninstalls all previously installed packages.
usage: zkg purge [-h] [--force]
This command creates a bundle file containing a collection of Zeek packages. If --manifest is used, the user supplies the list of packages to put in the bundle, else all currently installed packages are put in the bundle. A bundle file can be unpacked on any target system, resulting in a repeatable/specific set of packages being installed on that target system (see the unbundle command). This command may be useful for those that want to manage packages on a system that otherwise has limited network connectivity. E.g. one can use a system with an internet connection to create a bundle, transport that bundle to the target machine using whatever means are appropriate, and finally unbundle/install it on the target machine.
usage: zkg bundle [-h] [--force] [--nodeps] [--nosuggestions] [--manifest MANIFEST [MANIFEST ...] --] filename.bundle
This command unpacks a bundle file formerly created by the bundle command and installs all the packages contained within.
usage: zkg unbundle [-h] [--replace] [--force] [--user-var NAME=VAL] filename.bundle
Retrieve latest package metadata from sources and checks whether any installed packages have available upgrades. Note that this does not actually upgrade any packages (see the upgrade command for that).
usage: zkg refresh [-h] [--aggregate] [--fail-on-aggregate-problems] [--push] [--sources SOURCES [SOURCES ...]]
Uprades the specified package(s) to latest available version. If no specific packages are specified, then all installed packages that are outdated and not pinned are upgraded. For packages that are installed with --version using a git branch name, the package is updated to the latest commit on that branch, else the package is updated to the highest available git version tag.
usage: zkg upgrade [-h] [--skiptests] [--nodeps] [--nosuggestions] [--force] [--user-var NAME=VAL] [package ...]
The Zeek Package Manager keeps track of all packages that are marked as "loaded" and maintains a single Zeek script that, when loaded by Zeek (e.g. via @load packages), will load the scripts from all "loaded" packages at once. This command adds a set of packages to the "loaded packages" list.
usage: zkg load [-h] [--nodeps] package [package ...]
The Zeek Package Manager keeps track of all packages that are marked as "loaded" and maintains a single Zeek script that, when loaded by Zeek, will load the scripts from all "loaded" packages at once. This command removes a set of packages from the "loaded packages" list.
usage: zkg unload [-h] [--force] [--nodeps] package [package ...]
Pinned packages are ignored by the upgrade command.
usage: zkg pin [-h] package [package ...]
Packages that are not pinned are automatically upgraded by the upgrade command
usage: zkg unpin [-h] package [package ...]
Outputs a list of packages that match a given category.
usage: zkg list [-h] [--nodesc] [{all,installed,not_installed,loaded,unloaded,outdated}]
Possible choices: all, installed, not_installed, loaded, unloaded, outdated
Perform a substring search on package names and metadata tags. Surround search text with slashes to indicate it is a regular expression (e.g. /text/).
usage: zkg search [-h] search_text [search_text ...]
Shows detailed information/metadata for given packages. If the package is currently installed, additional information about the status of it is displayed. E.g. the installed version or whether it is currently marked as "pinned" or "loaded."
usage: zkg info [-h] [--version VERSION] [--nolocal] [--json] [--jsonpretty SPACES] [--allvers] package [package ...]
The default output of this command is a valid package manager config file that corresponds to the one currently being used, but also with any defaulted field values filled in. This command also allows for only the value of a specific field to be output if the name of that field is given as an argument to the command.
usage: zkg config [-h] [{all,sources,user_vars,state_dir,script_dir,plugin_dir,bin_dir,zeek_dist,bro_dist}]
Possible choices: all, sources, user_vars, state_dir, script_dir, plugin_dir, bin_dir, zeek_dist, bro_dist
The output of this command is a valid package manager config file that is generated by using the zeek-config script that is installed along with Zeek. It is the suggested configuration to use for most Zeek installations. For this command to work, the zeek-config (or bro-config) script must be in PATH, unless the --user option is given, in which case this creates a config that does not touch the Zeek installation.
usage: zkg autoconfig [-h] [--force]
This command returns shell commands that, when executed, will correctly set ZEEKPATH and ZEEK_PLUGIN_PATH (also BROPATH and BRO_PLUGIN_PATH for legacy compatibility) to use scripts and plugins from packages installed by the package manager. For this command to function properly, either have the zeek-config script (installed by zeek) in PATH, or have the ZEEKPATH and ZEEK_PLUGIN_PATH (or BROPATH and BRO_PLUGIN_PATH) environment variables already set so this command can append package-specific paths to them.
usage: zkg env [-h]
This command creates a new Zeek package in the directory provided via --packagedir. If this directory exists, zkg will not modify it unless you provide --force.
usage: zkg create [-h] --packagedir DIR [--version VERSION] [--features FEATURE [FEATURE ...]] [--template URL] [--force] [--user-var NAME=VAL]
This command shows versions and supported features for a given package.
usage: zkg template info [-h] [--json] [--jsonpretty SPACES] [--version VERSION] [URL]
The zkg command-line tool uses an INI-format config file to allow users to customize their Package Sources, Package installation paths, Zeek executable/source paths, and other zkg options.
See the default/example config file below for explanations of the available options and how to customize them:
# This is an example config file for zkg to explain what # settings are possible as well as their default values. # The order of precedence for how zkg finds/reads config files: # # (1) zkg --configfile=/path/to/custom/config # (2) the ZKG_CONFIG_FILE environment variable # (3) a config file located at $HOME/.zkg/config # (4) if none of the above exist, then zkg uses builtin/default # values for all settings shown below [sources] # The default package source repository from which zkg fetches # packages. The default source may be removed, changed, or # additional sources may be added as long as they use a unique key # and a value that is a valid git URL. The git URL may also use a # suffix like "@branch-name" where "branch-name" is the name of a real # branch to checkout (as opposed to the default branch, which is typically # "main" or "master"). You can override the package source zkg puts # in new config files (e.g. "zkg autoconfig") by setting the # ZKG_DEFAULT_SOURCE environment variable. zeek = https://github.com/zeek/packages [paths] # Directory where source repositories are cloned, packages are # installed, and other package manager state information is # maintained. If left blank or with --user this defaults to # $HOME/.zkg. In Zeek-bundled installations, it defaults to # <zeek_install_prefix>/var/lib/zkg/. state_dir = # The directory where package scripts are copied upon installation. # A subdirectory named "packages" is always created within the # specified path and the package manager will copy the directory # specified by the "script_dir" option of each package's zkg.meta # (or legacy bro-pkg.meta) file there. # If left blank or with --user this defaults to <state_dir>/script_dir. # In Zeek-bundled installations, it defaults to # <zeek_install_prefix>/share/zeek/site. # If you decide to change this location after having already # installed packages, zkg will automatically relocate them # the next time you run any zkg command. script_dir = # The directory where package plugins are copied upon installation. # A subdirectory named "packages" is always created within the # specified path and the package manager will copy the directory # specified by the "plugin_dir" option of each package's zkg.meta # (or legacy bro-pkg.meta) file there. # If left blank or with --user this defaults to <state_dir>/plugin_dir. # In Zeek-bundled installations, it defaults to # <zeek_install_prefix>/lib/zeek/plugins. # If you decide to change this location after having already # installed packages, zkg will automatically relocate them # the next time you run any zkg command. plugin_dir = # The directory where executables from packages are linked into upon # installation. If left blank or with --user this defaults to <state_dir>/bin. # In Zeek-bundled installations, it defaults to <zeek_install_prefix>/bin. # If you decide to change this location after having already # installed packages, zkg will automatically relocate them # the next time you run any zkg command. bin_dir = # The directory containing Zeek distribution source code. This is only # needed when installing packages that contain Zeek plugins that are # not pre-built. The legacy name of this option is "bro_dist". zeek_dist = [templates] # The URL of the package template repository that the "zkg create" command # will instantiate by default. default = https://github.com/zeek/package-template [user_vars] # For any key in this section that is matched for value interpolation # in a package's zkg.meta (or legacy bro-pkg.meta) file, the corresponding # value is substituted during execution of the package's `build_command`. # This section is typically automatically populated with the # the answers supplied during package installation prompts # and, as a convenience feature, used to recall the last-used settings # during subsequent operations (e.g. upgrades) on the same package.
The Zeek Project
2019, The Zeek Project
July 5, 2023 | 2.14.0 |