jdx/mise · error

no tasks defined in {}. Are you in a project directory?

Error message

no tasks defined in {}. Are you in a project directory?

What it means

This is mise's final fallback when a task name cannot be resolved, no similar CLI subcommand matched, no untrusted configs were found, and no non-executable task files exist: there are simply no tasks defined anywhere in the current config scope, so mise asks whether you are actually inside a project directory. It displays the current working directory that was searched.

Source

Thrown at src/task/task_list.rs:337

                    .collect();
                bail!(
                    "no tasks defined in {}, but found {} non-executable file(s) in {}.\n\
                        Files must be executable to be detected as tasks.\n\
                        Run `chmod +x` on the task files to fix this, e.g.:\n  chmod +x {}",
                    display_path(dirs::CWD.clone().unwrap_or_default()),
                    non_exec_files.len(),
                    dirs_with_files.join(", "),
                    non_exec_files
                        .iter()
                        .take(5)
                        .map(display_path)
                        .collect::<Vec<_>>()
                        .join(" "),
                );
            }
        }

        bail!(
            "no tasks defined in {}. Are you in a project directory?",
            display_path(dirs::CWD.clone().unwrap_or_default())
        );
    }
    if let Some(task) = make_task_executable(config, name, task_context).await? {
        return Ok(Some(task));
    }

    // Suggest similar tasks using fuzzy matching for monorepo tasks
    let mut err_msg = format!("no task {} found", style::ered(name));

    let similar = similar_tasks(name, &tasks_for_error);
    if !similar.is_empty() {
        err_msg.push_str("\n\nDid you mean one of these?");
        for task_name in similar {
            err_msg.push_str(&format!("\n  - {}", task_name));
        }
    }

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. cd into the project directory that contains mise.toml/.mise.toml and retry.
  2. If tasks should exist, create them: add a [tasks] section to mise.toml or files under .mise/tasks/.
  3. Check `mise config` to see which config files are currently in scope.
  4. Define reusable global tasks in ~/.config/mise/mise.toml if you want them available everywhere.

Example fix

# before
$ cd ~ && mise build
error: no tasks defined in ~. Are you in a project directory?

# after
$ cd ~/myrepo && mise build
Defensive patterns

Strategy: validation

Validate before calling

# only run tasks from a project root
[ -f mise.toml ] || [ -f .mise.toml ] || { echo 'not in a mise project' >&2; exit 1; }
mise <task>

Prevention

When it happens

Trigger: Running `mise <task>` from a directory with no mise.toml, no .tool-versions, no global tasks, and no task include directories — e.g. $HOME or /tmp — or from a subdirectory outside any project root.

Common situations: Wrong terminal/tab cwd; running mise before cd-ing into the project; project relies on a config file mise does not auto-discover; global config defines no tasks.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/d92fca6146ad1675. Report an issue: GitHub.