Skip to content

feat: add support for custom output filenames - #15

Merged
juunini merged 2 commits into
juunini:mainfrom
VoyagerVR:main
Oct 15, 2025
Merged

juunini merged 2 commits into
juunini:mainfrom
VoyagerVR:main

Conversation

@adwood53

Copy link
Copy Markdown
Contributor

Problem

Currently, the CLI always outputs files as compressed.glb, making batch processing difficult as each file overwrites the previous output.

Solution

This PR adds automatic filename generation based on input files, with an optional flag to override the behaviour.

What Changed

  • Added --filename / -f flag for custom output names
  • Auto-generates output filename from input when flag not provided (e.g., model.glb → model_optimized.glb)
  • Updated README with new usage examples
  • Fully backwards compatible

Usage

Default (auto-generate):

gltf-optimizer -i car.glb -o ./output
# Outputs: car_optimized.glb
gltf-optimizer -i car.glb -o ./output -f custom.glb
# Outputs: custom.glb
gltf-optimizer -i car.glb -o ./output -f compressed.glb
# Outputs: compressed.glb (original behaviour)

@juunini

juunini commented Oct 15, 2025

Copy link
Copy Markdown
Owner

Thanks for your contribution

@juunini
juunini merged commit 268f180 into juunini:main Oct 15, 2025
1 of 2 checks passed
@juunini juunini linked an issue Oct 15, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support for custom output filenames in CLI

2 participants