再见,"It Works on My Machine":为什么我造了一个新的任务运行者 QQ

2026年8月19日2 次浏览来源:Dev.to阅读原文

正文保留英文原文(机翻易破坏代码与排版),标题/摘要已提供中文

Have you ever spent hours—or even days—debugging a failed build or deployment, only to realize the issue was a slight difference in local environments?

Maybe your colleague had Go 1.21 installed instead of Go 1.22.

Maybe they were on Windows while you were on a Mac.

Or maybe their AWS CLI version was slightly outdated.

We've all been there.

It's the classic "It works on my machine" problem.

To solve this, I built Lask, a task runner that eliminates environment discrepancies by embedding the execution environment directly into the syntax.

Here is why I built it and how it works. 🛑 The limitations of current solutions When trying to standardize tasks, teams usually lean on two approaches: Shell Scripts & Makefiles: Writing scripts automates the steps, but it doesn't standardize the execution environment.

You are still at the mercy of whatever is installed on the host OS.

CI/CD Pipelines: Running tasks in GitHub Actions or CI provides a perfectly clean, reproducible environment.

However, it sacrifices the fast feedback loop of local development.

Developers often struggle to test the exact same CI pipeline locally.

I wanted a tool that combines the reproducibility of CI/CD with the speed and convenience of local execution. ✨ Enter: Lask Lask is an open-source task runner designed around three core principles: Reproducibility, Portability, and Ease of Execution.

Instead of relying on whatever tools are installed on your host machine, Lask lets you define the execution environment inline, right next to your command.

Here is what a task looks like in Lask: By simply typing lask run publish in your terminal, Lask uses containers under the hood to execute each step in its exact required environment.

Why this changes the game: 🔒 True Reproducibility: Because the environment (#golang:1.22, #aws-cli:2.36) is hardcoded into the task, anyone running the script gets the exact same result.

No more accidental mismatches. 🌍 Portability: Whether you are on Linux, macOS, Windows, or inside a CI runner, the behavior is identical.

You effectively bring the CI environment down to your local machine. ⚡ Zero Setup: Lask is delivered as a single binary.

It also features static typing for safety and a built-in REPL for int eractive experimentation! 🤝 I'd love your feedback!

Lask is completely open-source and actively being developed.

If you are tired of debugging local environment issues, I would be thrilled if you gave it a try or checked out the code. ⭐ GitHub: lask-task-runner/lask What tools do you currently use to keep dev environments in sync across your team?

Let me know in the comments below! 👇

分享