hatch run - suggest close defined "script" names when the command is not found
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 462
- Avg merge
- 19h 36m
- Merged PRs (30d)
- 10
Description
when using a project setup like
[tool.hatch.envs.default]
detached = true
python = "3.12"
installer = "uv"
dependencies = [
"ipython",
"sphinx-tabs",
"sphinx>=8.2.0",
"sphinx-autobuild",
"myst_parser",
"sphinx-tabs",
"sphinxawesome-theme",
]
[tool.hatch.envs.default.scripts]
build = "sphinx-build src public -d doctrees"
live-build = "sphinx-autobuild src public -d doctrees --open-browser"
when i try to run something like
$ LC_ALL=C hatch run build-live
/bin/sh: line 1: build-live: command not found
it takes a while to figure what the issue is
it would be a big help if the ux was more along the lines of
$ LC_ALL=C hatch run build-live
ERROR: command build-live not found
Please ensure the necessary dependencies/extras/groups are part of the environment
PS: the script names defined in $configfile are:
- live-build
- build
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the hatch run command-not-found handling and inspect how scripts from the project configuration are loaded and displayed. Reproduce the missing build-live command with the shown configuration; done means the error identifies the missing command and lists the configured script names, while retaining the dependency guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100