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.

Tokens
14.7K
Snippets
99
Records
140
Agent score
56%

What's inside Lets

  1. Overview of Lets task runner

    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.
  2. 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.
  3. 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. The lets CLI ships with a bundled skill named lets that instructs agents on how to inspect lets.yaml, discover available commands, prefer project-defined tasks, and safely modify configuration. Note: This feature is experimental and subject to change.
  4. 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.
  5. Integrate lets configuration with the Cobra CLI framework

    The lets application uses the Cobra CLI framework to handle command-line arguments and help messages. It maps the commands section of lets.yaml to cobra.Command objects:

    • Root Command: Handles global flags (e.g., --version, --help), internal lets self subcommands (e.g., lets self upgrade), and terminal autocompletion.
    • Subcommands: Generated from Config.Commands via the initSubCommands function. These subcommands use a RunE callback to handle argument parsing and normalization before passing execution to the Executor.
  6. Understand directory resolution in lets

    lets distinguishes between three types of directories to determine where commands run and how files are resolved:

    1. Root dir: The directory where you executed the lets command. This is the default directory where commands run.
    2. Config dir: The directory containing the lets.yaml file. Accessible via the environment variable $LETS_CONFIG_DIR.
    3. 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 lets from the project root, the Root dir and Config dir are the same.

  7. 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.
  8. Understand the lets configuration parsing process

    When the lets application starts, the parser searches for a lets.yaml file 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, the config.go:Config struct implements the UnmarshalYAML function, which is triggered during yaml.Unmarshal.
  9. 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 by command.work_dir.
    • LETS_SHELL: The shell to be used (replacing the generic SHELL variable to avoid path issues).
  10. 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.
  11. Build lets-cli from source using Go

    Ensure a supported version of Go is installed (check go.mod in the project repository). You can install the latest release globally or specify a target directory using GOBIN.
    # 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