Skip to content

Mastra

This plugin is enabled if "mastra" is listed in "dependencies" or "devDependencies" in package.json.

If this plugin is enabled, the following configuration is added automatically:

{
"mastra": {
"entry": [
"src/mastra/index.{js,ts}",
"src/mastra/{storage,observability,logger,server,studio}.{js,ts,mjs,mts}",
"src/mastra/workflows/*.{js,ts}",
"src/mastra/{,agents/*/}tools/**/*.{js,ts}",
"src/mastra/agents/*/*(subagents/*/){config,instructions,memory,workspace}.{js,ts}",
"src/mastra/agents/*/*(subagents/*/){tools,scorers,skills,processors/input,processors/output}/*.{js,ts}",
"src/mastra/agents/*/*(subagents/*/)schedules/**/*.{js,ts}",
"!src/mastra/**/*.{test,spec}.{js,ts}",
"!src/mastra/**/__tests__/**"
]
}
}

Depending on local configuration, plugins may modify the defaults as shown.

Custom config or entry options override default values, they are not merged.

See Plugins for more details about plugins and their entry and config options.

This plugin adds argument parsing for the mastra binary. Configuration:

string: ["dir", "tools"]
alias: {"dir": ["d"], "tools": ["t"]}
resolveInputs: (parsed, { cwd }) => {
if (!discoveryCommands.has(parsed._[0])) return [];
const inputs = [];
if (parsed.dir) {
for (const pattern of getProductionPatterns(parsed.dir)) inputs.push(toProductionEntry(pattern));
}
if (parsed.tools) {
// `--tools` takes a comma-separated list of tool files, globs or directories; Mastra bundles each match
// as its own input and imports them all from the generated `tools.mjs`, so each is an entry file.
for (const tool of String(parsed.tools).split(',')) {
const specifier = tool.trim();
if (!specifier) continue;
const pattern = isDirectory(join(cwd, specifier)) ? `${specifier}/index.${extensions}` : specifier;
inputs.push(toProductionEntry(pattern));
}
}
return inputs;
}

The configuration was generated from source code. Also see Script Parser.

This page was generated from the mastra plugin source code.

ISC License © 2026Lars Kappert