Skip to content

Initial implementation: Zero-dependency task runner CLI#2

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/initial-implementation-task-cli
Draft

Initial implementation: Zero-dependency task runner CLI#2
Copilot wants to merge 3 commits intomainfrom
copilot/initial-implementation-task-cli

Conversation

Copy link

Copilot AI commented Nov 25, 2025

Implements a Poetry-based task runner that executes commands defined in pyproject.toml [tool.tasks] via a task CLI.

Task Types Supported

  • Shell commands: test = "pytest tests/"
  • Task aliases: t = "test"
  • Task chains: ci = ["test", "lint"] (stops on first failure)
  • Python entry points: call = "module:function" (uses sys.argv for args)

Implementation

  • config.py - TOML parser with upward directory search for pyproject.toml
  • executor.py - Task execution with circular dependency detection, shell argument escaping via shlex.quote()
  • cli.py - Entry point with task <name> [args...] and task --list

Configuration Example

[tool.tasks]
test = "pytest tests/ -v"
lint = "ruff check ."
ci = ["lint", "test"]

[tool.tasks.version]
call = "myapp:print_version"

Technical Details

  • Zero runtime dependencies (uses tomllib, subprocess, importlib from stdlib)
  • Python 3.11+ required for tomllib
  • 38 tests, 95% coverage
  • Shell injection protection via shlex.quote()

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • install.python-poetry.org
    • Triggering command: /usr/bin/curl curl -sSL REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Initial Implementation</issue_title>
<issue_description>Create a Poetry-based Python project that exposes a task CLI command that executes a command-line task defined in the containing project's pyproject.toml [tool.tasks] section.

  • Zero dependencies.
  • Minimum Python version is 3.11 in order to use the standard library tomllib.
  • Tasks can be defined as shell scripts, aliases for other tasks, chains of other tasks, or python module entry points.
  • Add tests to achieve full code coverage.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 25, 2025 17:56
Co-authored-by: BrandonLWhite <2344027+BrandonLWhite@users.noreply.github.com>
…t imports

Co-authored-by: BrandonLWhite <2344027+BrandonLWhite@users.noreply.github.com>
Copilot AI changed the title [WIP] Add initial implementation of task CLI for Poetry project Initial implementation: Zero-dependency task runner CLI Nov 25, 2025
Copilot AI requested a review from BrandonLWhite November 25, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Initial Implementation

2 participants