Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cli/generate/task-stubs.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Use `--mise-bin=./bin/mise` to use a mise bin generated from `mise generate boot
Examples:

```
$ mise task add test -- echo 'running tests'
$ mise tasks add test -- echo 'running tests'
$ mise generate task-stubs
$ ./bin/test
running tests
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

Task to run.

Shorthand for `mise task run <TASK>`.
Shorthand for `mise tasks run <TASK>`.

## Global Flags

Expand Down
4 changes: 2 additions & 2 deletions docs/cli/tasks/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Create a file task instead of a toml task

### `-H --hide`

Hide the task from `mise task` and completions
Hide the task from `mise tasks` and completions

### `-q --quiet`

Expand Down Expand Up @@ -79,5 +79,5 @@ Do not print the command or its output
Examples:

```
mise task add pre-commit --depends "test" --depends "render" -- echo pre-commit
mise tasks add pre-commit --depends "test" --depends "render" -- echo pre-commit
```
8 changes: 4 additions & 4 deletions docs/cli/tasks/validate.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ Examples:

```
# Validate all tasks
$ mise task validate
$ mise tasks validate

# Validate specific tasks
$ mise task validate build test
$ mise tasks validate build test

# Output results as JSON
$ mise task validate --json
$ mise tasks validate --json

# Only show errors (skip warnings)
$ mise task validate --errors-only
$ mise tasks validate --errors-only
```

Validation Checks:
Expand Down
6 changes: 3 additions & 3 deletions docs/tasks/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ This automatically reruns tasks when their source files change.
### Visualize Dependencies

```bash
mise task deps build # Show build's dependencies
mise task deps --dot > deps.dot # Generate graphviz diagram
mise tasks deps build # Show build's dependencies
mise tasks deps --dot > deps.dot # Generate graphviz diagram
```

### Execution Tracing
Expand Down Expand Up @@ -267,7 +267,7 @@ Solution: Define the missing task or remove the dependency.
**Slow Parallel Execution**:

- Check if tasks have unnecessary dependencies
- Use `mise task deps` to verify dependency graph
- Use `mise tasks deps` to verify dependency graph
- Consider increasing `--jobs` if you have CPU cores available

The task architecture is designed to scale from simple single-task projects to complex multi-service applications with intricate build dependencies.
2 changes: 1 addition & 1 deletion docs/tasks/file-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Write-Host "Hello from Powershell, current directory is $current_directory"

## Editing tasks

This script can be edited with by running `mise task edit build` (using `$EDITOR`). If it doesn't exist it will be created.
This script can be edited by running `mise tasks edit build` (using `$EDITOR`). If it doesn't exist it will be created.
This is convenient for quickly editing or creating new scripts.

## Task Grouping
Expand Down
4 changes: 2 additions & 2 deletions docs/tasks/running-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

See available tasks with `mise tasks`. To show tasks hidden with property `hide=true`, use the option `--hidden`.

List dependencies of tasks with `mise task deps [tasks]...`.
List dependencies of tasks with `mise tasks deps [tasks]...`.

Run a task with `mise task run <task>`, `mise run <task>`, `mise r <task>`, or just `mise <task>`—however
Run a task with `mise tasks run <task>`, `mise run <task>`, `mise r <task>`, or just `mise <task>`—however
that last one you should never put into scripts or documentation because if mise ever adds a command with that name in a
future mise version, the task will be shadowed and must be run with one of the other forms.

Expand Down
2 changes: 1 addition & 1 deletion docs/tasks/toml-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ run = './scripts/test-e2e.sh {{vars.e2e_args}} $VERBOSE_ARGS'
You can edit the `mise.toml` file directly or using [`mise tasks add`](/cli/tasks/add)

```shell
mise task add pre-commit --depends "test" --depends "render" -- echo pre-commit
mise tasks add pre-commit --depends "test" --depends "render" -- echo pre-commit
```

will add the following to `mise.toml`:
Expand Down
2 changes: 1 addition & 1 deletion e2e/generate/test_generate_bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
assert "mise generate bootstrap -w"
assert "./bin/mise version"

assert "mise task add xxx -- echo 'running xxx'"
assert "mise tasks add xxx -- echo 'running xxx'"
assert "mise generate task-stubs --mise-bin ./bin/mise"
assert "./bin/xxx" "running xxx"

Expand Down
2 changes: 1 addition & 1 deletion e2e/generate/test_generate_task_stubs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash

assert "mise task add xxx -- echo 'running xxx'"
assert "mise tasks add xxx -- echo 'running xxx'"
assert "mise generate task-stubs"
assert "./bin/xxx" "running xxx"
4 changes: 2 additions & 2 deletions e2e/tasks/test_task_add
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env bash

mise task add pre-commit --depends "test" --depends "render" -- echo pre-commit
mise tasks add pre-commit --depends "test" --depends "render" -- echo pre-commit
assert "cat mise.toml" '[tasks.pre-commit]
depends = ["test", "render"]
run = "echo pre-commit"'

mise task add --file pre-commit --depends "test" --depends "render" -- echo pre-commit
mise tasks add --file pre-commit --depends "test" --depends "render" -- echo pre-commit
assert "cat mise-tasks/pre-commit" '#!/usr/bin/env bash
#MISE depends=["test", "render"]
set -euxo pipefail
Expand Down
8 changes: 4 additions & 4 deletions e2e/tasks/test_task_default
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash

assert "mise task add --file foo:bar:baz -- echo baz"
assert "mise task add --file foo:bar -- echo bar"
assert "mise tasks add --file foo:bar:baz -- echo baz"
assert "mise tasks add --file foo:bar -- echo bar"
ls -lR .

assert "mise tasks" "foo:bar
foo:bar:baz"
assert "mise task run foo:bar:baz" "baz"
assert "mise task run foo:bar" "bar"
assert "mise tasks run foo:bar:baz" "baz"
assert "mise tasks run foo:bar" "bar"
2 changes: 1 addition & 1 deletion e2e/tasks/test_task_depends_post
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ run = "echo two"
depends_post = ["two"]
run = "echo three"
EOF
assert "mise task deps" "one
assert "mise tasks deps" "one
three
two
├── three
Expand Down
4 changes: 2 additions & 2 deletions e2e/tasks/test_task_depends_post_multiple
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ EOF

# Test that task dependencies are resolved correctly
# With depends_post, the dependencies appear as children in the tree
assert "mise task deps" "bar
assert "mise tasks deps" "bar
└── baz
baz
foo
Expand All @@ -40,7 +40,7 @@ run = "echo main"
depends_post = ["one", "two", "three"]
EOF

assert "mise task deps" "main
assert "mise tasks deps" "main
one
└── main
three
Expand Down
8 changes: 4 additions & 4 deletions e2e/tasks/test_task_deps
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ depends = ["hello:*"]
EOF
assert_contains "mise run hello:all" "[hello:1] Hello from 1"
assert_contains "mise run hello:all" "[hello:2] Hello from 2"
assert "mise task deps" "hello:1
assert "mise tasks deps" "hello:1
hello:2
hello:all
├── hello:2
└── hello:1"
assert "mise task hello:all" 'Task: hello:all
assert "mise tasks hello:all" 'Task: hello:all
Description: Hello from all
Source: ~/workdir/mise.toml
Depends on: hello:*
Expand All @@ -53,5 +53,5 @@ Usage Spec:
echo '' >mise.toml

mkdir -p mise-tasks && echo "" >mise-tasks/build.sh && chmod +x mise-tasks/build.sh
assert "mise task deps build" "build"
assert "mise task deps build.sh" "build"
assert "mise tasks deps build" "build"
assert "mise tasks deps build.sh" "build"
8 changes: 4 additions & 4 deletions e2e/tasks/test_task_display_truncation
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ run = 'echo "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam n
EOF

# Test task listing shows full names (not truncated at 60 chars)
assert_contains "mise task ls" "short"
assert_contains "mise task ls" "medium-length-task-name"
assert_contains "mise task ls" "very-long-task-name-that-exceeds-sixty-characters-to-test-truncation"
assert_contains "mise task ls" "super-duper-ultra-mega-extremely-long-task-name-that-definitely-exceeds-the-old-sixty-character-hard-limit"
assert_contains "mise tasks ls" "short"
assert_contains "mise tasks ls" "medium-length-task-name"
assert_contains "mise tasks ls" "very-long-task-name-that-exceeds-sixty-characters-to-test-truncation"
assert_contains "mise tasks ls" "super-duper-ultra-mega-extremely-long-task-name-that-definitely-exceeds-the-old-sixty-character-hard-limit"

# Test that we can still run tasks with long names
assert_succeed "mise run short"
Expand Down
8 changes: 4 additions & 4 deletions e2e/tasks/test_task_edit_nested_names
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ EDITOR_EOF
chmod +x fake-editor

# Test 1: Create a task with nested colons using task edit
echo "Running: mise task edit foo:bar:baz --path"
TASK_PATH=$(mise task edit foo:bar:baz --path 2>&1)
echo "Running: mise tasks edit foo:bar:baz --path"
TASK_PATH=$(mise tasks edit foo:bar:baz --path 2>&1)

# Verify the file was created
if [ ! -f "$TASK_PATH" ]; then
Expand All @@ -48,7 +48,7 @@ assert_contains "mise run foo:bar:baz" "nested task executed"
assert_contains "mise tasks ls" "foo:bar:baz"

# Test 3: Try editing an existing nested task (should not create duplicates)
TASK_PATH2=$(mise task edit foo:bar:baz --path 2>&1)
TASK_PATH2=$(mise tasks edit foo:bar:baz --path 2>&1)

if [ "$TASK_PATH" != "$TASK_PATH2" ]; then
echo "ERROR: Editing the same task twice gave different paths"
Expand All @@ -58,7 +58,7 @@ if [ "$TASK_PATH" != "$TASK_PATH2" ]; then
fi

# Test 4: Create a task with multiple levels of nesting
TASK_PATH3=$(mise task edit deploy:prod:backend:api --path 2>&1)
TASK_PATH3=$(mise tasks edit deploy:prod:backend:api --path 2>&1)

if [ ! -f "$TASK_PATH3" ]; then
echo "ERROR: Deeply nested task file was not created at $TASK_PATH3"
Expand Down
8 changes: 4 additions & 4 deletions e2e/tasks/test_task_info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

mkdir -p mise-tasks && echo "" >mise-tasks/build.sh && chmod +x mise-tasks/build.sh
assert "mise task info build" 'Task: build
assert "mise tasks info build" 'Task: build
Description:
Source: ~/workdir/mise-tasks/build.sh
File: ~/workdir/mise-tasks/build.sh
Expand All @@ -10,16 +10,16 @@ Usage Spec:
name build
bin build'

assert_contains "mise task info build.sh --json" '"name": "build"'
assert_contains "mise tasks info build.sh --json" '"name": "build"'

assert_json_partial_object "mise task info build --json" "name,source,description" '{
assert_json_partial_object "mise tasks info build --json" "name,source,description" '{
"name": "build",
"source": "'"$PWD"'/mise-tasks/build.sh",
"description": ""
}'

mise tasks add lint --depends "build -v" -- 'echo "linting!"'
assert_json "mise task info lint --json" "$(
assert_json "mise tasks info lint --json" "$(
cat <<EOF
{
"name": "lint",
Expand Down
6 changes: 3 additions & 3 deletions e2e/tasks/test_task_ls
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@ cat <<'EOF' >.config/mise/conf.d/confdtask-config.toml
run = 'echo "confdtask"'
EOF

assert "mise task ls" "confdtask
assert "mise tasks ls" "confdtask
filetask2
filetask3
lint
test
test-with-args"

assert "mise task -x ls" "confdtask ./.config/mise/conf.d/confdtask-config.toml
assert "mise tasks -x ls" "confdtask ./.config/mise/conf.d/confdtask-config.toml
filetask2 ./mytasks/filetask2
filetask3 ./mytasks/filetask3.sh
lint ./mise.toml
test ./tasks.toml
test-with-args ./tasks.toml"

assert_json "mise task ls --json" "$(
assert_json "mise tasks ls --json" "$(
cat <<EOF
[
{
Expand Down
24 changes: 12 additions & 12 deletions e2e/tasks/test_task_ls_usage
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Test the `mise task ls --usage` functionality (display_usage)
# Test the `mise tasks ls --usage` functionality (display_usage)

# Test 1: Basic usage output with simple tasks
cat <<EOF >mise.toml
Expand All @@ -18,9 +18,9 @@ description = "Task with flags"
EOF

# Test basic usage output format contains expected tasks
assert_contains "mise task ls --usage" 'cmd simple help="A simple task with no arguments"'
assert_contains "mise task ls --usage" 'cmd with-args help="Task with arguments"'
assert_contains "mise task ls --usage" 'cmd with-flags help="Task with flags"'
assert_contains "mise tasks ls --usage" 'cmd simple help="A simple task with no arguments"'
assert_contains "mise tasks ls --usage" 'cmd with-args help="Task with arguments"'
assert_contains "mise tasks ls --usage" 'cmd with-flags help="Task with flags"'

# Test 2: Tasks with aliases and dependencies
cat <<EOF >mise.toml
Expand All @@ -35,9 +35,9 @@ alias = "c"
depends = ["parent"]
EOF

assert_contains "mise task ls --usage" 'cmd parent help="Parent task"'
assert_contains "mise task ls --usage" 'cmd child help="Child task"'
assert_contains "mise task ls --usage" 'alias c'
assert_contains "mise tasks ls --usage" 'cmd parent help="Parent task"'
assert_contains "mise tasks ls --usage" 'cmd child help="Child task"'
assert_contains "mise tasks ls --usage" 'alias c'

# Test 3: File-based tasks
mkdir -p mise-tasks
Expand All @@ -48,7 +48,7 @@ echo "file task"
EOF
chmod +x mise-tasks/file-task

assert_contains "mise task ls --usage" 'cmd file-task help="A file-based task"'
assert_contains "mise tasks ls --usage" 'cmd file-task help="A file-based task"'

# Test 4: Hidden tasks should not appear
cat <<EOF >mise.toml
Expand All @@ -62,16 +62,16 @@ description = "Hidden task"
hide = true
EOF

assert_contains "mise task ls --usage" 'cmd visible help="Visible task"'
assert_not_contains "mise task ls --usage" 'cmd hidden help="Hidden task"'
assert_contains "mise tasks ls --usage" 'cmd visible help="Visible task"'
assert_not_contains "mise tasks ls --usage" 'cmd hidden help="Hidden task"'

# Test 5: Task with no description
cat <<EOF >mise.toml
[tasks.no-desc]
run = 'echo "no description"'
EOF

assert_contains "mise task ls --usage" 'cmd no-desc'
assert_contains "mise tasks ls --usage" 'cmd no-desc'

# Test 6: Performance test - should be fast even with complex environment
cat <<EOF >mise.toml
Expand All @@ -87,6 +87,6 @@ node = "latest"
EOF

# This should complete quickly (within 5 seconds)
timeout 5 mise task ls --usage >/dev/null || fail "Usage generation took too long"
timeout 5 mise tasks ls --usage >/dev/null || fail "Usage generation took too long"

echo "All usage display tests passed!"
2 changes: 1 addition & 1 deletion e2e/tasks/test_task_project_root
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

mise task add a:b:c --file -- echo \$MISE_PROJECT_ROOT
mise tasks add a:b:c --file -- echo \$MISE_PROJECT_ROOT
assert "mise a:b:c" "$PWD"
2 changes: 1 addition & 1 deletion e2e/tasks/test_task_run_output
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ running z"
# now the graph isn't linear so it uses prefix
assert_contains "mise run a ::: d" "[a] running a"
assert_contains "mise run a ::: d" "[d] running d"
assert "mise task deps" "a
assert "mise tasks deps" "a
all
├── c
│ └── b
Expand Down
Loading
Loading