Skip to content

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

bpctl

Bulk edit SLS blueprint YAML files in place.

Only the includes field is rewritten. Everything else in the file stays unchanged.

Install

go build -o bpctl .

Commands

bpctl includes add <tag> [tag...]
bpctl includes remove <tag> [tag...]

Examples

# Add tags to every blueprint under the current directory
bpctl includes add shared_plugins default_limits
# Filter by blueprint type
bpctl includes add shared_plugins --type minigame
# Filter by server software
bpctl includes add shared_plugins --software paper
# Filter by software + version range
bpctl includes add shared_plugins --software paper --version '>=1.18 <=1.20.4'# Target a specific directory or file
bpctl includes add shared_plugins -p ./blueprints
bpctl includes remove default_limits -p ./blueprints/arcade.yml
# Preview without writing
bpctl includes add shared_plugins -n

Includes style

includes is a top-level key, inserted after the blueprint: section (not nested under it).

By default, existing style is preserved. New includes keys are written as a block list:

blueprint:
id: "arcade"type: "minigame"includes:
- shared_plugins
- default_limitsserver:
software: "paper"

Force a style:

bpctl includes add shared_plugins default_limits --inline
bpctl includes add shared_plugins default_limits --block
includes: [shared_plugins,default_limits]

Edits keep a single blank line between top-level sections.

Filters

FlagMatches
--typeblueprint.type
--softwareserver.software
--versionserver.version against a constraint
-p, --pathDirectory or file to scan (default: .)

Filters can be combined. Empty filters match everything.

Version constraints

Supported comparators: >, >=, <, <=, ==, =.

A bare version means equality (1.18 is the same as ==1.18).

Ranges are space-separated and combined with AND:

<=1.16.5
>=1.17
>=1.18 <=1.20.4
(>=1.17 <=1.17.1)

Flags

FlagDescription
-p, --pathDirectory or file to scan
--typeFilter by blueprint type
--softwareFilter by server software
--versionFilter by version constraint
-i, --inlineForce flow style includes: [a,b]
--blockForce block list style
-n, --dry-runShow changes without writing
-v, --verboseShow skipped non-blueprint YAML files
-q, --quietOnly print errors

Notes

  • Scans *.yml and *.yaml recursively
  • -p pointing at a non-YAML file is an error
  • Skips files that are not blueprints (use -v to list them)
  • Warns on YAML parse/read errors, unparsable server.version values, and per-file includes edit failures without aborting the run
  • Existing tags are not duplicated on add
  • Removing the last include drops the includes key

About

Bulk edit SLS blueprint YAML files in place.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages