hatch¶
Usage:
hatch [OPTIONS] COMMAND [ARGS]...
-
Options:
Name | Type | Description | Default |
---|---|---|---|
--env , -e | text | The name of the environment to use [env var: HATCH_ENV ] | default |
--project , -p | text | The name of the project to work on [env var: HATCH_PROJECT ] | None |
--color / --no-color | boolean | Whether or not to display colored output (default is auto-detection) [env vars: FORCE_COLOR /NO_COLOR ] | None |
--interactive / --no-interactive | boolean | Whether or not to allow features like prompts and progress bars (default is auto-detection) [env var: HATCH_INTERACTIVE ] | None |
--verbose , -v | integer range (0 and above) | Increase verbosity (can be used additively) [env var: HATCH_VERBOSE ] | 0 |
--quiet , -q | integer range (0 and above) | Decrease verbosity (can be used additively) [env var: HATCH_QUIET ] | 0 |
--data-dir | text | The path to a custom directory used to persist data [env var: HATCH_DATA_DIR ] | None |
--cache-dir | text | The path to a custom directory used to cache data [env var: HATCH_CACHE_DIR ] | None |
--config | text | The path to a custom config file to use [env var: HATCH_CONFIG ] | None |
--version | boolean | Show the version and exit. | False |
--help | boolean | Show this message and exit. | False |
hatch build¶
Build a project.
Usage:
hatch build [OPTIONS] [LOCATION]
+ Hatch Reference
hatch¶
Usage:
hatch [OPTIONS] COMMAND [ARGS]...
+
Options:
Name Type Description Default --env
, -e
text The name of the environment to use [env var: HATCH_ENV
] default
--project
, -p
text The name of the project to work on [env var: HATCH_PROJECT
] None --verbose
, -v
integer range (0
and above) Increase verbosity (can be used additively) [env var: HATCH_VERBOSE
] 0
--quiet
, -q
integer range (0
and above) Decrease verbosity (can be used additively) [env var: HATCH_QUIET
] 0
--color
/ --no-color
boolean Whether or not to display colored output (default is auto-detection) [env vars: FORCE_COLOR
/NO_COLOR
] None --interactive
/ --no-interactive
boolean Whether or not to allow features like prompts and progress bars (default is auto-detection) [env var: HATCH_INTERACTIVE
] None --data-dir
text The path to a custom directory used to persist data [env var: HATCH_DATA_DIR
] None --cache-dir
text The path to a custom directory used to cache data [env var: HATCH_CACHE_DIR
] None --config
text The path to a custom config file to use [env var: HATCH_CONFIG
] None --version
boolean Show the version and exit. False
--help
boolean Show this message and exit. False
hatch build¶
Build a project.
Usage:
hatch build [OPTIONS] [LOCATION]
Options:
Name Type Description Default --target
, -t
text The target to build, overriding project defaults. This may be selected multiple times e.g. -t sdist -t wheel
None --hooks-only
boolean Whether or not to only execute build hooks [env var: HATCH_BUILD_HOOKS_ONLY
] False
--no-hooks
boolean Whether or not to disable build hooks [env var: HATCH_BUILD_NO_HOOKS
] False
--ext
boolean Whether or not to only execute build hooks for distributing binary Python packages, such as compiling extensions. Equivalent to --hooks-only -t wheel
False
--clean
, -c
boolean Whether or not existing artifacts should first be removed [env var: HATCH_BUILD_CLEAN
] False
--clean-hooks-after
boolean Whether or not build hook artifacts should be removed after each build [env var: HATCH_BUILD_CLEAN_HOOKS_AFTER
] False
--help
boolean Show this message and exit. False
hatch clean¶
Remove build artifacts.
Usage:
hatch clean [OPTIONS] [LOCATION]
Options:
Name Type Description Default --target
, -t
text The target with which to remove artifacts, overriding project defaults. This may be selected multiple times e.g. -t sdist -t wheel
None --hooks-only
boolean Whether or not to only remove artifacts from build hooks [env var: HATCH_BUILD_HOOKS_ONLY
] False
--no-hooks
boolean Whether or not to ignore artifacts from build hooks [env var: HATCH_BUILD_NO_HOOKS
] False
--ext
boolean Whether or not to only remove artifacts from build hooks for distributing binary Python packages, such as compiled extensions. Equivalent to --hooks-only -t wheel
False
--help
boolean Show this message and exit. False
hatch config¶
Manage the config file
Usage:
hatch config [OPTIONS] COMMAND [ARGS]...
Options:
Name Type Description Default --help
boolean Show this message and exit. False
hatch config explore¶
Open the config location in your file manager.
Usage:
hatch config explore [OPTIONS]
@@ -43,7 +43,15 @@
Options:
Name Type Description Default --help
boolean Show this message and exit. False
hatch project metadata¶
Display project metadata.
If you want to view the raw readme file without rendering, you can use a JSON parser like jq:
hatch project metadata | jq -r .readme
Usage:
hatch project metadata [OPTIONS] [FIELD]
Options:
Name Type Description Default --help
boolean Show this message and exit. False
hatch publish¶
Publish build artifacts.
Usage:
hatch publish [OPTIONS] [ARTIFACTS]...
-
Options:
Name Type Description Default --repo
, -r
text The repository with which to publish artifacts [env var: HATCH_INDEX_REPO
] None --user
, -u
text The user with which to authenticate [env var: HATCH_INDEX_USER
] None --auth
, -a
text The credentials to use for authentication [env var: HATCH_INDEX_AUTH
] None --ca-cert
text The path to a CA bundle [env var: HATCH_INDEX_CA_CERT
] None --client-cert
text The path to a client certificate, optionally containing the private key [env var: HATCH_INDEX_CLIENT_CERT
] None --client-key
text The path to the client certificate's private key [env var: HATCH_INDEX_CLIENT_KEY
] None --no-prompt
, -n
boolean Disable prompts, such as for missing required fields False
--initialize-auth
boolean Save first-time authentication information even if nothing was published False
--publisher
, -p
text The publisher plugin to use (default is index
) [env var: HATCH_PUBLISHER
] index
--option
, -o
text Options to pass to the publisher plugin. This may be selected multiple times e.g. -o foo=bar -o baz=23
[env var: HATCH_PUBLISHER_OPTIONS
] None --yes
, -y
boolean Confirm without prompting when the plugin is disabled False
--help
boolean Show this message and exit. False
hatch run¶
Run commands within project environments. This is a convenience wrapper around the env run
command.
If the first argument contains a colon, then the preceding component will be interpreted as the name of the environment to target, overriding the -e
/--env
root option and the HATCH_ENV
environment variable.
If the environment provides matrices, then you may also provide leading arguments starting with a +
or -
to select or exclude certain variables, optionally followed by specific comma-separated values. For example, if you have the following configuration:
[[tool.hatch.envs.test.matrix]]
+
Options:
Name Type Description Default --repo
, -r
text The repository with which to publish artifacts [env var: HATCH_INDEX_REPO
] None --user
, -u
text The user with which to authenticate [env var: HATCH_INDEX_USER
] None --auth
, -a
text The credentials to use for authentication [env var: HATCH_INDEX_AUTH
] None --ca-cert
text The path to a CA bundle [env var: HATCH_INDEX_CA_CERT
] None --client-cert
text The path to a client certificate, optionally containing the private key [env var: HATCH_INDEX_CLIENT_CERT
] None --client-key
text The path to the client certificate's private key [env var: HATCH_INDEX_CLIENT_KEY
] None --no-prompt
, -n
boolean Disable prompts, such as for missing required fields False
--initialize-auth
boolean Save first-time authentication information even if nothing was published False
--publisher
, -p
text The publisher plugin to use (default is index
) [env var: HATCH_PUBLISHER
] index
--option
, -o
text Options to pass to the publisher plugin. This may be selected multiple times e.g. -o foo=bar -o baz=23
[env var: HATCH_PUBLISHER_OPTIONS
] None --yes
, -y
boolean Confirm without prompting when the plugin is disabled False
--help
boolean Show this message and exit. False
hatch python¶
Manage Python installations
Usage:
hatch python [OPTIONS] COMMAND [ARGS]...
+
Options:
Name Type Description Default --help
boolean Show this message and exit. False
hatch python install¶
Install Python distributions.
You may select all
to install all compatible distributions:
hatch python install all
+
Usage:
hatch python install [OPTIONS] NAMES...
+
Options:
Name Type Description Default --private
boolean Do not add distributions to the user PATH False
--update
, -u
boolean Update existing installations False
--dir
, -d
text The directory in which to install distributions, overriding configuration None --help
boolean Show this message and exit. False
hatch python remove¶
Remove Python distributions.
You may select all
to remove all installed distributions:
hatch python remove all
+
Usage:
hatch python remove [OPTIONS] NAMES...
+
Options:
Name Type Description Default --dir
, -d
text The directory in which distributions reside None --help
boolean Show this message and exit. False
hatch python show¶
Show the available Python distributions.
Usage:
hatch python show [OPTIONS]
+
Options:
Name Type Description Default --ascii
boolean Whether or not to only use ASCII characters False
--dir
, -d
text The directory in which distributions reside None --help
boolean Show this message and exit. False
hatch python update¶
Update Python distributions.
You may select all
to update all installed distributions:
hatch python update all
+
Usage:
hatch python update [OPTIONS] NAMES...
+
Options:
Name Type Description Default --dir
, -d
text The directory in which distributions reside None --help
boolean Show this message and exit. False
hatch run¶
Run commands within project environments. This is a convenience wrapper around the env run
command.
If the first argument contains a colon, then the preceding component will be interpreted as the name of the environment to target, overriding the -e
/--env
root option and the HATCH_ENV
environment variable.
If the environment provides matrices, then you may also provide leading arguments starting with a +
or -
to select or exclude certain variables, optionally followed by specific comma-separated values. For example, if you have the following configuration:
[[tool.hatch.envs.test.matrix]]
python = ["3.9", "3.10"]
version = ["42", "3.14", "9000"]
[[envs.test.matrix]]
diff --git a/dev/config/hatch/index.html b/dev/config/hatch/index.html
index 0b0c57ece..efcb2cddf 100644
--- a/dev/config/hatch/index.html
+++ b/dev/config/hatch/index.html
@@ -42,9 +42,9 @@
virtual = ".hatch"
Any type of environment that is not explicitly defined will default to <DATA_DIR>/env/<ENV_TYPE>
.
Python installations¶
[dirs]
python = "..."
-
This determines where to install specific versions of Python, with the full path being <VALUE>/pythons
.
The following values have special meanings.
Value Path isolated
(default) <DATA_DIR>/pythons
shared
~/.pythons
Terminal¶
You can configure how all output is displayed using the terminal.styles
table. These settings are also applied to all plugins.
[terminal.styles]
+
This determines where to install specific versions of Python.
The following values have special meanings:
Value Path shared
(default) ~/.pythons
isolated
<DATA_DIR>/pythons
Terminal¶
You can configure how all output is displayed using the terminal.styles
table. These settings are also applied to all plugins.
[terminal.styles]
error = "..."
...
Cross-platform terminal capabilities are provided by Rich.
Output levels¶
The levels of output are as follows. Note that the verbosity indicates the minimum level at which the output is displayed.
Level Default Verbosity Description debug
bold
1 - 3 Messages that are not useful for most user experiences error
bold red
-2 Messages indicating some unrecoverable error info
bold
0 Messages conveying basic information success
bold cyan
0 Messages indicating some positive outcome waiting
bold magenta
0 Messages shown before potentially time consuming operations warning
bold yellow
-1 Messages conveying important information
See the documentation and color reference for guidance on valid values.
Spinner¶
You can select the sequence used for waiting animations with the spinner
option.
[terminal.styles]
spinner = "..."
-