tasktree 0.0.18__tar.gz → 0.0.20__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tasktree-0.0.18 → tasktree-0.0.20}/.claude/settings.local.json +2 -1
- tasktree-0.0.20/.github/ISSUE_TEMPLATE/bug_report.yml +75 -0
- tasktree-0.0.20/.github/ISSUE_TEMPLATE/feature_request.yml +59 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/.github/workflows/claude-code-review.yml +2 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/.gitignore +4 -0
- tasktree-0.0.20/CLAUDE.md +205 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/PKG-INFO +452 -1
- {tasktree-0.0.18 → tasktree-0.0.20}/README.md +451 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/pyproject.toml +1 -1
- {tasktree-0.0.18 → tasktree-0.0.20}/schema/README.md +6 -2
- {tasktree-0.0.18 → tasktree-0.0.20}/schema/tasktree-schema.json +132 -20
- {tasktree-0.0.18 → tasktree-0.0.20}/src/tasktree/__init__.py +4 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/src/tasktree/cli.py +29 -5
- {tasktree-0.0.18 → tasktree-0.0.20}/src/tasktree/executor.py +41 -3
- {tasktree-0.0.18 → tasktree-0.0.20}/src/tasktree/graph.py +177 -1
- {tasktree-0.0.18 → tasktree-0.0.20}/src/tasktree/hasher.py +32 -3
- {tasktree-0.0.18 → tasktree-0.0.20}/src/tasktree/parser.py +196 -18
- {tasktree-0.0.18 → tasktree-0.0.20}/src/tasktree/substitution.py +156 -1
- {tasktree-0.0.18 → tasktree-0.0.20}/tasktree.yaml +1 -1
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_builtin_variables.py +0 -8
- tasktree-0.0.20/tests/integration/test_dependency_outputs.py +313 -0
- tasktree-0.0.20/tests/integration/test_private_tasks_execution.py +264 -0
- tasktree-0.0.20/tests/integration/test_self_references.py +1331 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/unit/test_graph.py +110 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/unit/test_list_formatting.py +61 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/unit/test_parser.py +474 -0
- tasktree-0.0.20/tests/unit/test_private_tasks.py +141 -0
- tasktree-0.0.20/tests/unit/test_substitution.py +958 -0
- tasktree-0.0.18/CLAUDE.md +0 -70
- tasktree-0.0.18/tests/unit/test_substitution.py +0 -518
- {tasktree-0.0.18 → tasktree-0.0.20}/.github/workflows/claude.yml +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/.github/workflows/release.yml +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/.github/workflows/test.yml +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/.github/workflows/validate-pipx-install.yml +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/.python-version +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/example/source.txt +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/example/tasktree.yaml +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/schema/vscode-settings-snippet.json +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/src/__init__.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/src/tasktree/docker.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/src/tasktree/state.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/src/tasktree/types.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/e2e/__init__.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/e2e/test_docker_basic.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/e2e/test_docker_environment.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/e2e/test_docker_ownership.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/e2e/test_docker_volumes.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/e2e/test_non_docker.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_arg_choices.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_arg_min_max.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_clean_state.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_cli_options.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_dependency_execution.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_docker_build_args.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_end_to_end.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_exported_args.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_input_detection.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_missing_outputs.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_nested_imports.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_parameterized_dependencies.yaml +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_parameterized_deps_execution.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_parameterized_deps_templates.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_state_persistence.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_variables.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/integration/test_working_directory.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/unit/test_cli.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/unit/test_dependency_parsing.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/unit/test_docker.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/unit/test_environment_tracking.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/unit/test_executor.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/unit/test_hasher.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/unit/test_parameterized_graph.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/unit/test_state.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/tests/unit/test_types.py +0 -0
- {tasktree-0.0.18 → tasktree-0.0.20}/uv.lock +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Create a report to help us improve
|
|
3
|
+
title: "[BUG] <describe bug>"
|
|
4
|
+
labels: [bug]
|
|
5
|
+
assignees: []
|
|
6
|
+
body:
|
|
7
|
+
- type: markdown
|
|
8
|
+
attributes:
|
|
9
|
+
value: |
|
|
10
|
+
**Please fill out as much of this form as possible. Incomplete reports may slow triage.**
|
|
11
|
+
|
|
12
|
+
- type: input
|
|
13
|
+
id: summary
|
|
14
|
+
attributes:
|
|
15
|
+
label: Bug Summary
|
|
16
|
+
description: Short summary of the bug (1-2 sentences).
|
|
17
|
+
placeholder: "Unexpected crash when saving file"
|
|
18
|
+
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: steps
|
|
21
|
+
attributes:
|
|
22
|
+
label: Steps to Reproduce
|
|
23
|
+
description: Step-by-step description to reproduce the bug.
|
|
24
|
+
placeholder: |
|
|
25
|
+
1. Open the application
|
|
26
|
+
2. Click on "Save"
|
|
27
|
+
3. Observe the error
|
|
28
|
+
|
|
29
|
+
- type: textarea
|
|
30
|
+
id: expected
|
|
31
|
+
attributes:
|
|
32
|
+
label: Expected Behavior
|
|
33
|
+
description: What did you expect to happen?
|
|
34
|
+
placeholder: App should save the file without errors.
|
|
35
|
+
|
|
36
|
+
- type: textarea
|
|
37
|
+
id: actual
|
|
38
|
+
attributes:
|
|
39
|
+
label: Actual Behavior
|
|
40
|
+
description: What actually happens?
|
|
41
|
+
placeholder: "Error dialog appears: 'Failed to save'."
|
|
42
|
+
|
|
43
|
+
- type: dropdown
|
|
44
|
+
id: system
|
|
45
|
+
attributes:
|
|
46
|
+
label: Environment
|
|
47
|
+
multiple: true
|
|
48
|
+
options:
|
|
49
|
+
- Linux (Debian-based)
|
|
50
|
+
- Linux (other)
|
|
51
|
+
- Windows
|
|
52
|
+
- macOS
|
|
53
|
+
- Other (please describe below)
|
|
54
|
+
description: Select all platforms where this bug occurs.
|
|
55
|
+
|
|
56
|
+
- type: input
|
|
57
|
+
id: version
|
|
58
|
+
attributes:
|
|
59
|
+
label: Version(s)
|
|
60
|
+
description: App and/or OS version numbers (paste output, e.g. `git describe`, `uname -a`, etc.)
|
|
61
|
+
placeholder: "v1.2.3, Debian 12.4, kernel 6.1.0..."
|
|
62
|
+
|
|
63
|
+
- type: textarea
|
|
64
|
+
id: logs
|
|
65
|
+
attributes:
|
|
66
|
+
label: Relevant Logs/Backtrace
|
|
67
|
+
description: Paste relevant logs, stack traces, or error messages. Use triple backticks for code.
|
|
68
|
+
render: shell
|
|
69
|
+
|
|
70
|
+
- type: textarea
|
|
71
|
+
id: extra
|
|
72
|
+
attributes:
|
|
73
|
+
label: Additional Context
|
|
74
|
+
description: Anything else useful for diagnosis? (Configurations, screenshots, external resources, etc.)
|
|
75
|
+
placeholder: "N/A"
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Suggest a new feature or improvement for this project
|
|
3
|
+
title: "[Feature] <concise feature title>"
|
|
4
|
+
labels: [enhancement]
|
|
5
|
+
assignees: []
|
|
6
|
+
body:
|
|
7
|
+
- type: markdown
|
|
8
|
+
attributes:
|
|
9
|
+
value: |
|
|
10
|
+
**Thanks for suggesting an improvement! Please provide as much context as possible.**
|
|
11
|
+
|
|
12
|
+
- type: input
|
|
13
|
+
id: summary
|
|
14
|
+
attributes:
|
|
15
|
+
label: Feature Summary
|
|
16
|
+
description: Short, high-level summary of the requested feature.
|
|
17
|
+
placeholder: "Add support for IPv6 packet inspection"
|
|
18
|
+
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: motivation
|
|
21
|
+
attributes:
|
|
22
|
+
label: Motivation & Use Case
|
|
23
|
+
description: What problem does this solve? Who benefits? Why is this needed?
|
|
24
|
+
placeholder: |
|
|
25
|
+
Currently, only IPv4 is supported in the firewall module. Many environments use IPv6 and need equivalent inspection features.
|
|
26
|
+
|
|
27
|
+
- type: textarea
|
|
28
|
+
id: description
|
|
29
|
+
attributes:
|
|
30
|
+
label: Feature Description & Requirements
|
|
31
|
+
description: Describe the change or new capability. List any requirements or constraints.
|
|
32
|
+
placeholder: |
|
|
33
|
+
- Support parsing and filtering of IPv6 packets in filter mode.
|
|
34
|
+
- Update UI to allow IPv6 rule specification.
|
|
35
|
+
- Follow current module design patterns.
|
|
36
|
+
|
|
37
|
+
- type: textarea
|
|
38
|
+
id: impact
|
|
39
|
+
attributes:
|
|
40
|
+
label: Impact/Alternatives
|
|
41
|
+
description: How does this improve the project? Are there workarounds or competing solutions?
|
|
42
|
+
placeholder: |
|
|
43
|
+
Improves feature parity with other products; current workaround requires separate external processing.
|
|
44
|
+
|
|
45
|
+
- type: textarea
|
|
46
|
+
id: implementation
|
|
47
|
+
attributes:
|
|
48
|
+
label: Implementation notes (optional)
|
|
49
|
+
description: If you have ideas about implementing this, list them here (API ideas, design notes, related RFCs, etc.)
|
|
50
|
+
placeholder: |
|
|
51
|
+
- May require libc updates (for older distros)
|
|
52
|
+
- Reference: RFC 8200
|
|
53
|
+
|
|
54
|
+
- type: textarea
|
|
55
|
+
id: extra
|
|
56
|
+
attributes:
|
|
57
|
+
label: Additional context
|
|
58
|
+
description: Add any other context, mockups, references, or screenshots here.
|
|
59
|
+
placeholder: "N/A"
|
|
@@ -48,6 +48,8 @@ jobs:
|
|
|
48
48
|
- Test coverage
|
|
49
49
|
|
|
50
50
|
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
|
|
51
|
+
|
|
52
|
+
At the end of the review, create a tickbox list of the actions arising from the review, suitable for pasting into a comment for Claude Code to work on.
|
|
51
53
|
|
|
52
54
|
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
|
|
53
55
|
|
|
@@ -154,5 +154,9 @@ example/output.txt
|
|
|
154
154
|
example/archive.tar.gz
|
|
155
155
|
example/.tasktree-state
|
|
156
156
|
|
|
157
|
+
# Requirements files copied from GitHub issues (for driving Claude Code)
|
|
158
|
+
requirements/*
|
|
159
|
+
|
|
157
160
|
# UV lock file (optional - some prefer to commit this)
|
|
158
161
|
# uv.lock
|
|
162
|
+
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
Task Tree (tt) is a task automation tool that combines simple command execution with intelligent dependency tracking and incremental execution. The project is a Python application built with a focus on:
|
|
8
|
+
|
|
9
|
+
- **Intelligent incremental execution**: Tasks only run when necessary based on input changes, dependency updates, or task definition changes
|
|
10
|
+
- **YAML-based task definition**: Tasks are defined in `tasktree.yaml` or `tt.yaml` files with dependencies, inputs, outputs, and commands
|
|
11
|
+
- **Automatic input inheritance**: Tasks automatically inherit inputs from dependencies
|
|
12
|
+
- **Parameterized tasks**: Tasks can accept typed arguments with defaults and constraints (int, float, bool, str, path, datetime, hostname, email, IP addresses)
|
|
13
|
+
- **File imports**: Task definitions can be split across multiple files and namespaced
|
|
14
|
+
- **Environment definitions**: Named execution environments (shell with custom configuration, or Docker containers with full image building support)
|
|
15
|
+
- **Template substitution**: Rich variable system with access to arguments, environment variables, built-in variables, dependency outputs, and task inputs/outputs
|
|
16
|
+
- **Docker support**: Full Docker integration with volume mounts, port mappings, build arguments, and user mapping
|
|
17
|
+
- **Named inputs/outputs**: Reference specific inputs and outputs by name for better clarity and DRY principles
|
|
18
|
+
|
|
19
|
+
## IMPORTANT! Development philosophies
|
|
20
|
+
|
|
21
|
+
### Small, incremental changes
|
|
22
|
+
The project team requires that each commit contains a small number of changes. Ideally, just the addition of a new line or statement in the code and an accompanying unit test (or tests) that validate the functionality of that line.
|
|
23
|
+
|
|
24
|
+
Tickets and features should be iteratively broken down until they can be implemented as a series of small commits.
|
|
25
|
+
|
|
26
|
+
When prompting the user to move to the next stage, estimate the size of the work and indicate whether you think there is sufficient usage to implement the next stage, or not. ("estimated required tokens: X, remaining usage in this session: Y tokens")
|
|
27
|
+
|
|
28
|
+
#### Local Claude Code work
|
|
29
|
+
When working locally on a user's machine, Claude Code should NEVER make commits - only stop and ask the user to review and commit, before carrying on with the next incremental change.
|
|
30
|
+
|
|
31
|
+
#### GitHub Claude Code integration work
|
|
32
|
+
When working as a GitHub agent, claude should still BREAK DOWN THE TASK into small, incremental commits, but commit those changes to the feature branch as they are made. GitHub integration Claude Code does not need to ask for permission to commit each change.
|
|
33
|
+
|
|
34
|
+
### Write tests, not ad hoc test scripts
|
|
35
|
+
If you are checking that a feature you are implementing has been implemented correctly, DO NOT write a bespoke test script to check the output of the app with the new functionality. INSTEAD, write a unit/integration/end-to-end test that will confirm you have correctly implemented the feature and RUN JUST THAT TEST. If it passes, you have implemented things correctly; and you can either carry on with additional parts of the feature, or run all the tests to ensure no regressions.
|
|
36
|
+
|
|
37
|
+
It is still permissible to write and run an ad hoc script to investigate/confirm the current behaviour. Although, it is better to first search for a test that does the thing that you're investigating. If one exists and is passing: then the app does the thing.
|
|
38
|
+
|
|
39
|
+
### Testas we go!
|
|
40
|
+
We do not plan to implement all the code (maybe even with unit tests) and then write a bunch of integration tests. We PLAN END-TO-END incremental changes. This will involve writing high-level test of the functionality as early as possible, to ensure that the new feature is progressing as expected.
|
|
41
|
+
|
|
42
|
+
### Try to be efficient with token usage
|
|
43
|
+
Your sponsor is not made of money! Try to minimise token useage, so that we can maximise the effectiveness of Claude Code on a features per token basis. Obviously, if a thing needs doing and it takes a bunch of tokens, that's just the way it is. Just try to consider/avoid profligacy!
|
|
44
|
+
|
|
45
|
+
### Architectural philosophies
|
|
46
|
+
|
|
47
|
+
- Try to follow SOLID principles
|
|
48
|
+
- Try to follow the advice in "Clean Code", by Robert Martin.
|
|
49
|
+
- Try to keep algorithmic logic abstracted from the TYPES that the logic can be run on. This is a restatement of the Liskov Substitution principle covered in the SOLID principles
|
|
50
|
+
- **Small, named functions are preferred over comments**. If a comment on WHAT the code is doing feels warranted, then refactor that code into a function with an indicative name. Comment on WHY code is like it is are more permissible.
|
|
51
|
+
|
|
52
|
+
## Architecture
|
|
53
|
+
|
|
54
|
+
### Core Components
|
|
55
|
+
|
|
56
|
+
- **`src/tasktree/parser.py`** (2,415 lines): YAML recipe parsing, task and environment definitions, circular import detection, schema validation
|
|
57
|
+
- **`src/tasktree/executor.py`** (1,200 lines): Task execution logic, incremental execution engine, state tracking, built-in variables, subprocess management
|
|
58
|
+
- **`src/tasktree/cli.py`** (591 lines): Typer-based CLI with commands: `--list`, `--show`, `--tree`, `--force`, `--only`, `--dry-run`, `--verbose`
|
|
59
|
+
- **`src/tasktree/graph.py`** (545 lines): Dependency resolution using graphlib.TopologicalSorter, parameterized dependencies, cycle detection
|
|
60
|
+
- **`src/tasktree/docker.py`** (446 lines): Docker image building and container execution, user mapping, volume mounts, build args
|
|
61
|
+
- **`src/tasktree/substitution.py`** (374 lines): Template variable substitution engine supporting multiple prefixes (var, arg, env, tt, dep, self)
|
|
62
|
+
- **`src/tasktree/types.py`** (139 lines): Custom Click parameter types for argument validation (hostname, email, IP, IPv4, IPv6, datetime)
|
|
63
|
+
- **`src/tasktree/hasher.py`** (161 lines): Task hashing for incremental execution, cache key generation, environment definition hashing
|
|
64
|
+
- **`src/tasktree/state.py`** (119 lines): State file management (.tasktree-state), task execution state tracking
|
|
65
|
+
|
|
66
|
+
### Key Dependencies
|
|
67
|
+
|
|
68
|
+
- **PyYAML**: For recipe parsing
|
|
69
|
+
- **Typer, Click, Rich**: For CLI and rich terminal output
|
|
70
|
+
- **graphlib.TopologicalSorter**: For dependency resolution
|
|
71
|
+
- **pathlib**: For file operations and glob expansion
|
|
72
|
+
- **docker (Python SDK)**: For Docker image building and container management
|
|
73
|
+
- **jsonschema**: For YAML schema validation
|
|
74
|
+
|
|
75
|
+
## Development Commands
|
|
76
|
+
|
|
77
|
+
### Testing
|
|
78
|
+
```bash
|
|
79
|
+
python3 -m pytest tests/
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The project has **656 tests** across three categories:
|
|
83
|
+
- **Unit tests** (`tests/unit/`): 15 test files covering parser, executor, graph, hasher, types, substitution, state
|
|
84
|
+
- **Integration tests** (`tests/integration/`): 21 test files for CLI options, parameterized tasks, Docker, variables, arg validation
|
|
85
|
+
- **E2E tests** (`tests/e2e/`): 5 test files for Docker volumes, ownership, environment, and basic functionality
|
|
86
|
+
|
|
87
|
+
### Running the Application
|
|
88
|
+
```bash
|
|
89
|
+
python3 main.py [task-names] [--options]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Package Management
|
|
93
|
+
This project uses `uv` for dependency management (indicated by `uv.lock` file). Configuration is in `pyproject.toml`.
|
|
94
|
+
|
|
95
|
+
## State Management
|
|
96
|
+
|
|
97
|
+
The application uses a `.tasktree-state` file at the project root to track:
|
|
98
|
+
- When tasks last ran
|
|
99
|
+
- Timestamps of input files at execution time
|
|
100
|
+
- Task hashes based on command, outputs, working directory, arguments, and environment definitions
|
|
101
|
+
- Cached results for incremental execution
|
|
102
|
+
|
|
103
|
+
## Testing Approach
|
|
104
|
+
|
|
105
|
+
The project uses Python's built-in `unittest` framework with:
|
|
106
|
+
- `unittest.mock` for mocking subprocess calls and external dependencies
|
|
107
|
+
- `click.testing.CliRunner` for CLI testing
|
|
108
|
+
- Comprehensive coverage across unit, integration, and E2E test layers
|
|
109
|
+
- Tests verify subprocess calls, Docker operations, state management, and CLI behavior
|
|
110
|
+
|
|
111
|
+
## Task Definition Format
|
|
112
|
+
|
|
113
|
+
Tasks are defined in YAML with the following structure:
|
|
114
|
+
```yaml
|
|
115
|
+
tasks:
|
|
116
|
+
task-name:
|
|
117
|
+
desc: Description (optional)
|
|
118
|
+
deps: [dependency-tasks] # Can include parameterized dependencies: dep-name(arg1, key=value)
|
|
119
|
+
inputs:
|
|
120
|
+
- pattern1 # Anonymous glob patterns
|
|
121
|
+
- name: glob-pattern # Named inputs for reference
|
|
122
|
+
outputs:
|
|
123
|
+
- pattern1 # Anonymous glob patterns
|
|
124
|
+
- name: path-or-pattern # Named outputs for reference
|
|
125
|
+
working_dir: execution-directory
|
|
126
|
+
env: environment-name # Reference to environment definition
|
|
127
|
+
args:
|
|
128
|
+
- name: arg-name
|
|
129
|
+
type: str|int|float|bool|path|datetime|hostname|email|ip|ipv4|ipv6
|
|
130
|
+
default: value
|
|
131
|
+
choices: [option1, option2] # Optional constraint
|
|
132
|
+
min: value # Optional for numeric types
|
|
133
|
+
max: value # Optional for numeric types
|
|
134
|
+
exported: true # Export as $ARG_NAME environment variable
|
|
135
|
+
cmd: shell-command # Can use {{ var.name }}, {{ arg.name }}, {{ env.NAME }}, {{ tt.* }}, {{ dep.task.outputs.name }}, {{ self.inputs.name }}
|
|
136
|
+
private: true # Hide from --list but still executable
|
|
137
|
+
|
|
138
|
+
environments:
|
|
139
|
+
env-name:
|
|
140
|
+
default: true # Make this the default environment
|
|
141
|
+
shell: /bin/bash # Shell environment
|
|
142
|
+
# OR
|
|
143
|
+
dockerfile: path/to/Dockerfile # Docker environment
|
|
144
|
+
context: build-context-dir
|
|
145
|
+
image: optional-image-name
|
|
146
|
+
volumes:
|
|
147
|
+
- host_path:container_path[:ro]
|
|
148
|
+
ports:
|
|
149
|
+
- "host:container"
|
|
150
|
+
build_args:
|
|
151
|
+
ARG_NAME: value
|
|
152
|
+
environment:
|
|
153
|
+
ENV_VAR: value
|
|
154
|
+
|
|
155
|
+
variables:
|
|
156
|
+
var-name: value # Simple string value
|
|
157
|
+
var-from-env: { env: ENV_VAR, default: fallback } # From environment
|
|
158
|
+
var-from-eval: { eval: "command to run" } # Runtime command evaluation
|
|
159
|
+
var-from-file: { read: path/to/file } # Read file contents
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Built-in Variables
|
|
163
|
+
|
|
164
|
+
Tasks have access to these built-in template variables:
|
|
165
|
+
- `{{ tt.project_root }}`: Root directory of the project
|
|
166
|
+
- `{{ tt.recipe_dir }}`: Directory containing the recipe file
|
|
167
|
+
- `{{ tt.task_name }}`: Name of the current task
|
|
168
|
+
- `{{ tt.working_dir }}`: Working directory for task execution
|
|
169
|
+
- `{{ tt.timestamp }}`: ISO 8601 timestamp
|
|
170
|
+
- `{{ tt.timestamp_unix }}`: Unix timestamp
|
|
171
|
+
- `{{ tt.user_home }}`: User's home directory
|
|
172
|
+
- `{{ tt.user_name }}`: Current username
|
|
173
|
+
|
|
174
|
+
## Key Features
|
|
175
|
+
|
|
176
|
+
### Template Substitution
|
|
177
|
+
Commands and paths support template substitution with multiple prefixes:
|
|
178
|
+
- `{{ var.name }}`: Variables defined in the `variables` section
|
|
179
|
+
- `{{ arg.name }}`: Task arguments passed on command line
|
|
180
|
+
- `{{ env.NAME }}`: Environment variables
|
|
181
|
+
- `{{ tt.* }}`: Built-in variables (see above)
|
|
182
|
+
- `{{ dep.task_name.outputs.output_name }}`: Outputs from dependency tasks
|
|
183
|
+
- `{{ self.inputs.input_name }}`: Named inputs of the current task
|
|
184
|
+
- `{{ self.outputs.output_name }}`: Named outputs of the current task
|
|
185
|
+
|
|
186
|
+
### Parameterized Dependencies
|
|
187
|
+
Tasks can pass arguments to their dependencies:
|
|
188
|
+
```yaml
|
|
189
|
+
tasks:
|
|
190
|
+
caller:
|
|
191
|
+
deps:
|
|
192
|
+
- dependency(value1, key=value2) # Positional and named args
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Docker Integration
|
|
196
|
+
Full Docker support with:
|
|
197
|
+
- Dockerfile-based image building
|
|
198
|
+
- Volume mounts (read-only and read-write)
|
|
199
|
+
- Port mappings
|
|
200
|
+
- User mapping (run as non-root on Unix/macOS)
|
|
201
|
+
- Build arguments separate from shell arguments
|
|
202
|
+
- Environment variable injection
|
|
203
|
+
|
|
204
|
+
### Schema Validation
|
|
205
|
+
The project includes JSON Schema definitions in `schema/` for validating recipe YAML files.
|