Go Task Binary Installer
go-task-bin is a Python package that simplifies the installation of the Go-based Task task runner CLI. It ensures a specific, stable version of the `task` executable is available on your system, acting as a simpler alternative to Make or other build tools. The current version is 3.50.0, and it typically releases new versions in sync with major updates to the upstream Task CLI project.
Common errors
-
task: command not found
cause The directory where `go-task-bin` installs the `task` executable is not in your system's `PATH` environment variable.fixAdd the installation directory (commonly `~/.local/bin` on Linux/macOS or `C:\Users\<User>\AppData\Roaming\Python\Scripts` on Windows) to your `PATH`. For example, add `export PATH="$HOME/.local/bin:$PATH"` to your `~/.bashrc` or `~/.zshrc` and then `source` the file or restart your terminal. -
Taskfile not found in current directory or any parent
cause The `task` command was run without a `Taskfile.yml` present in the current directory or any parent directories. `Task` requires a `Taskfile.yml` to define tasks.fixCreate a `Taskfile.yml` in your project's root directory. Ensure it has at least one task defined, e.g., `version: '3' tasks: hello: cmds: - echo "Hello from Task!"`. Then run `task hello`. -
You are running Task vX.Y.Z, but Taskfile requires at least vA.B.C
cause The `Taskfile.yml` specifies a minimum required version of Task that is newer than the version currently installed by `go-task-bin`.fixUpgrade `go-task-bin` to get a newer, compatible version of the `task` executable: `pip install --upgrade go-task-bin`.
Warnings
- gotcha The `task` executable is installed into a user-specific binary directory (e.g., `~/.local/bin` on Linux/macOS, or a Scripts directory in Python's user base on Windows). This directory may not be automatically added to your system's `PATH` environment variable, leading to 'command not found' errors.
- gotcha `go-task-bin` installs a *pinned* version of the Task CLI. If you have an existing global `task` installation (e.g., via Homebrew, `apt`), using `go-task-bin` might lead to version conflicts or you might inadvertently run the globally installed version instead of the one managed by `pip`.
- gotcha It's common for users to misunderstand that `go-task-bin` is an installer for a *Go-based* task runner, not a Python-native task runner. It doesn't integrate directly with Python code execution beyond providing the CLI tool.
Install
-
pip install go-task-bin
Imports
- Task CLI (No Python imports)
import task
This library installs a command-line executable. There are no Python symbols for direct programmatic use.
Quickstart
# 1. Install the binary (if not already done) pip install go-task-bin # 2. Ensure ~/.local/bin is in your PATH (if on Linux/macOS) # Add this to your ~/.bashrc or ~/.zshrc: # export PATH="$HOME/.local/bin:$PATH" # Then run: source ~/.bashrc (or ~/.zshrc) # 3. Create a Taskfile.yml in your project directory # (Save this content as Taskfile.yml) # version: '3' # tasks: # hello: # cmds: # - echo "Hello from Task!" # build: # cmds: # - echo "Building project..." # - go build -o myapp ./cmd/myapp # run: # deps: [build] # cmds: # - ./myapp # 4. Run a task from your terminal task hello task build task run