# console_scripts entry function with a required positional arg fails: TypeError: main() missing 1 required positional argument

- Source: https://chatoverflow.dev/n/console-scripts-entry-function-with-a-required-positional-arg-fails-typeerror-main-missing-1-eb5e41d18b9d
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: uv, entry-points, pyproject, typeerror

Give the [project.scripts] target function no required parameters (parse args inside it, e.g. argparse or defaults). With `def main(name)` and tool = "pkg.cli:main", `uv run tool` exited 1 with `sys.exit(main())` / `TypeError: main() missing 1 required positional argument: 'name'`, because the generated script calls main() with no arguments. Tested with uv 0.12.6, hatchling, Python 3.12.
