Command: init

Usage

guild init [OPTIONS] [DIR]

Initialize a Guild environment.

By default, creates .guild under DIR, or the current directory if DIR is omitted.

NOTE: As of 0.9, this command does NOT create a virtual directory in DIR. To enable pre-0.9 behavior, specify --venv along with any of the applicable virtual environment options. We recommend creating a virtual environment using standard tools rather than using this command. Backward compatibility will be maintained via the --venv option.

Options that are associated with virtual environments are noted as such below.

Resource Cache

By default resources are cached and shared at the user level in ~/.guild/cache/resources so that resources downloaded from one environment are available to other environments. You can modify this behavior to have all resources downloaded local to the environment by specifying --local-resource-cache.

Python Interpreter (virtual environments only)

Use --python to specify the Python interpreter to use within the generated virtual environment. By default, the default Python interpreter for virtualenv is used unless python is explicitly listed as a requirement. If no-venv is specified, --python is ignored.

Requirements (virtual environments only)

By default, any required packages listed under packages.requires in guild.yml in the environment parent directory are installed into the environment. Use --no-reqs to suppress this behavior.

Additionally, packages defined in requirements.txt in the environment parent directory will be installed. Use --no-reqs to suppress this behavior.

Note that packages defined in guild.yml use Guild package names while packages defined in requirements.txt use PyPI package names.

For information on requirements files, see:

https://bit.ly/guild-help-req-files

You may explicitly specify requirements file using -r or --requirement. If -r, --requirement is specified, Guild will not automatically install packages in requirements.txt – that file must be specified explicitly in the command.

Guild AI Version (virtual environments only)

By default init installs the active version of Guild AI in the initialized environment. To install a different version, or to install a Guild wheel distribution file use the --guild option.

Options

--venv Creates a virtual environment in DIR. This option enabled pre-0.9 init behavior and is implied when specifying any of the virtual environment settings below.
-n, --name NAME Environment name (default is env parent directory name). Implies --venv.
-p, --python VERSION Version of Python to use for the environment. Implies --venv.
-g, --guild VERSION_OR_PATH Version of Guild AI to use for the environment. The activate version of Guild is installed by default. This value may alternatively be a path to a Guild wheel distribution. Implies --venv.
-s, --system-site-packages Give environment access to system site packages. Implies --venv.
-H, --no-isolate Use current Guild home for the environment. Ignored if --guild-home is specified.
-h, --guild-home PATH Alternative Guild home location for with the environment. By default, Guild home is ‘.guild’ in DIR.
-r, --requirement REQ Install required package or packages defined in a file. May be used multiple times. Implies --venv.
-P, --path DIR Include DIR as a Python path in the environment. Implies --venv.
--no-reqs Don’t install from requirements.txt or guild.yml in environment parent directory. Implies --venv.
-l, --isolate-resources Use a local cache when initializing an environment.
-y, --yes Initialize a Guild environment without prompting.
--no-progress Don’t show progress when installing environment packages. Ignored if a virtual environment is not created.
--pre Install pre-release versions of applicable packages. Implies --venv.
--help Show this message and exit.

Guild AI version 0.9.0