Lets Task Runner
website·Indexed 32 days ago
https://lets-cli.org/Lets is a developer-focused task runner designed as a modern alternative to Makefiles. It features a simple syntax for defining commands in lets.yaml, support for environment variable management, and Agent Skills to help AI agents discover how to work with a project. The tool includes official plugins for JetBrains and VSCode, and supports shell integration for Bash and Zsh.
What's inside Lets
- Lets is a task-centric task runner written in Go. It allows developers to group sets of CLI commands under a single named task via a YAML configuration file, making complex workflows (like test setup and execution) easy to share and run across a team.
Overview of Lets task runner
Lets is a task runner designed for developers to replace complex Makefiles. It supports projects of any size, from a few tasks to hundreds, and uses YAML as its configuration format to ensure a human-readable, well-known syntax with built-in YAML features.Overview of Agent Skills in lets
Agent Skills are portable instructions that enable AI agents to discover how to work with a specific tool or project. TheletsCLI ships with a bundled skill namedletsthat instructs agents on how to inspectlets.yaml, discover available commands, prefer project-defined tasks, and safely modify configuration. Note: This feature is experimental and subject to change.New features in Lets 0.0.63
Lets 0.0.63 introduces several functional enhancements for task running and configuration, including:
- Ability to run configurations directly from a URL.
- Support for loading
.env(dotenv) files. - New checksum configuration options.
- Improved error reporting for failed dependencies.
- Enhanced capabilities for teaching AI agents how to use project tasks.
Integrate lets configuration with the Cobra CLI framework
The
letsapplication uses the Cobra CLI framework to handle command-line arguments and help messages. It maps thecommandssection oflets.yamltocobra.Commandobjects:- Root Command: Handles global flags (e.g.,
--version,--help), internallets selfsubcommands (e.g.,lets self upgrade), and terminal autocompletion. - Subcommands: Generated from
Config.Commandsvia theinitSubCommandsfunction. These subcommands use aRunEcallback to handle argument parsing and normalization before passing execution to theExecutor.
- Root Command: Handles global flags (e.g.,
Understand directory resolution in lets
letsdistinguishes between three types of directories to determine where commands run and how files are resolved:- Root dir: The directory where you executed the
letscommand. This is the default directory where commands run. - Config dir: The directory containing the
lets.yamlfile. Accessible via the environment variable$LETS_CONFIG_DIR. - Work dir: The specific directory a command runs in. This is usually the Root dir, unless the command explicitly defines a
work_dir(accessible via$LETS_COMMAND_WORK_DIR).
If you run
letsfrom the project root, the Root dir and Config dir are the same.- Root dir: The directory where you executed the
New features in Lets 0.0.63
Lets version 0.0.63 introduces several functional enhancements for task running and configuration, including:
- Ability to run configurations directly from a URL.
- Support for loading
.env(dotenv) files. - New checksum configuration options.
- Improved error reporting for failed dependencies.
- Enhanced capabilities for teaching AI agents how to use project tasks.
Understand the lets configuration parsing process
When theletsapplication starts, the parser searches for alets.yamlfile by traversing from the current directory up to the root directory (/). Once found, the parser reads, parses, and validates the YAML configuration. To support custom field logic or normalization during this phase, theconfig.go:Configstruct implements theUnmarshalYAMLfunction, which is triggered duringyaml.Unmarshal.Access runtime environment variables
The following environment variables are exposed to commands at runtime:
LETS_OS: The operating system.LETS_ARCH: The architecture.LETS_CONFIG: The filename of the lets config used.LETS_CONFIG_DIR: The absolute path to the directory containing the lets config.LETS_COMMAND_WORKDIR: The absolute path to the directory specified bycommand.work_dir.LETS_SHELL: The shell to be used (replacing the genericSHELLvariable to avoid path issues).
New features in Lets 0.0.63
Lets version 0.0.63 introduces several functional enhancements to the task runner, including:
- Ability to run configurations directly from a URL.
- Support for loading
.env(dotenv) files. - New checksum configuration options.
- Improved error reporting for failed dependencies.
- Enhanced capabilities for teaching AI agents how to use project tasks.
Install official lets-cli plugins for JetBrains and VSCode
Official plugins for JetBrains and VSCode provide autocomplete and filetype support for lets-cli.JetBrains Plugin: https://plugins.jetbrains.com/plugin/14639-lets VSCode Plugin: https://marketplace.visualstudio.com/items?itemName=kindritskyimax.vscode-lets
Build lets-cli from source using Go
Ensure a supported version of Go is installed (checkgo.modin the project repository). You can install the latest release globally or specify a target directory usingGOBIN.# Install globally go install github.com/lets-cli/lets/cmd/lets@latest # Install to a specific directory env GOBIN=$HOME/.local/bin go install github.com/lets-cli/lets/cmd/lets@latest