Filtering Packages

Each Melos command can be used alongside the following global filters:

--no-private

Exclude private packages (publish_to: none). They are included by default.

melos bootstrap --no-private

--published

Filter packages where the current local package version exists on pub.dev.

melos bootstrap --published

Use --no-published to filter packages that have not had their current version published yet.

--scope

Include only packages with names matching the given glob. This option can be repeated.

# Run `flutter build ios` on all packages with "example" in the package name
melos exec --scope="*example*" -- flutter build ios

--ignore

Exclude packages with names matching the given glob. This option can be repeated.

# Run `flutter build ios` on all packages but ignore those whose packages names contain "internal"
melos exec --ignore="*internal*" -- flutter build ios

--since

Only include packages that have been changed since the specified ref, e.g. a commit sha or git tag.

# Run `flutter build ios` on all packages that have been changed since the specified commit hash
melos exec --since=<commit hash> -- flutter build ios

--dir-exists

Include only packages where a specific directory exists inside the package.

# Only bootstrap packages with an example directory
melos bootstrap --dir-exists="example"

--file-exists

Include only packages where a specific file exists in the package.

# Only bootstrap packages with an README.md file
melos bootstrap --file-exists="README.md"

--flutter

Filter packages where the package depends on the Flutter SDK.

melos exec --flutter -- flutter test

Use --no-flutter to filter packages that do not depend on the Flutter SDK.

--depends-on

Include only packages that depend on specific dependencies.

melos exec --depends-on="flutter" --depends-on="firebase_core" -- flutter test

Use --no-depends-on to filter packages that do not depend on the given dependencies.