Skip to content

Instantly share code, notes, and snippets.

@jesshart
Last active March 29, 2024 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesshart/6154ac55f6cb9a139ab202f336e13f34 to your computer and use it in GitHub Desktop.
Save jesshart/6154ac55f6cb9a139ab202f336e13f34 to your computer and use it in GitHub Desktop.
Hatch Party Tricks

Hatch Party Tricks

Setting Up

Add hatch autocomplete for oh-my-zsh

  1. Run this command
mkdir -p ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/hatch-zsh-completion && _HATCH_COMPLETE=zsh_source hatch > ${ZSH_CUSTOM}/plugins/hatch-zsh-completion/hatch-zsh-completion.plugin.zsh
  1. Add hatch-zsh-completion to your .zshrc file at plugins= like so
plugins=(git hatch-zsh-completion)

Using environments

Run a script from a non-default environment

hatch run <env-name>:<script-alias>

Deactivate an environment

exit

Enter an environment

hatch -e <env-name> shell

Adding environment variables

[tool.hatch.envs.<env-name>.env-vars]
NAME = "value"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment