Generated by the Very Good CLI 🤖
A Very Good Project created by Very Good CLI..
Install the CLI globally from the Git repository:
dart pub global activate --source=git https://github.com/cherrybit-studios/pepper_sprite_cli.gitOr locally via:
dart pub global activate --source=path <path to this package># Show CLI version
$ pepper_sprite_cli --version
# Show usage help
$ pepper_sprite_cli --helpDownloads a file from the Pepper Sprite cloud service using a file ID and API key.
$ pepper_sprite_cli download -f <fileId> -k <apiKey> -o <outputPath>Options:
-f, --file-id(mandatory) - The ID of the file to download-k, --api-key(mandatory) - The API key for authentication-o, --output(mandatory) - The output path where the file will be saved
Example:
$ pepper_sprite_cli download -f abc123 -k myApiKey -o ./downloads/sprite.pspExports an image from a Pepper Sprite (.psp) file to PNG format.
# Export full sprite
$ pepper_sprite_cli export -s <source> -o <output>
# Export all frames of a specific animation
$ pepper_sprite_cli export -s <source> -o <output> -a <animationName>
# Export a specific frame of an animation
$ pepper_sprite_cli export -s <source> -o <output> -a <animationName> -f <frameIndex>Options:
-s, --source(mandatory) - The path to the pepper sprite file (.psp)-o, --output(mandatory) - The output path where the image will be saved-a, --animation(optional) - Export a specific animation (exports full sprite if not specified)-f, --frame(optional) - Export a specific frame of an animation (requires--animation)
Examples:
# Export full sprite
$ pepper_sprite_cli export -s ./sprite.psp -o ./output/sprite.png
# Export all frames of "walk" animation
$ pepper_sprite_cli export -s ./sprite.psp -o ./output/walk.png -a walk
# Export frame 0 of "walk" animation
$ pepper_sprite_cli export -s ./sprite.psp -o ./output/walk_frame_0.png -a walk -f 0Downloads and exports files based on a pepper-sprite.yaml configuration file. This command combines the download and export commands to automate asset management.
Configuration file format (pepper-sprite.yaml):
files:
- fileId: "abc123"
output: "./assets/sprites/character.png"
- fileId: "def456"
output: "./assets/sprites/enemy.png"Usage:
# Use default config file (./pepper-sprite.yaml)
$ pepper_sprite_cli get -k <apiKey>
# Use custom config file
$ pepper_sprite_cli get -k <apiKey> -c ./config/my-sprites.yamlOptions:
-k, --api-key(mandatory) - The API key for authentication-c, --config(optional) - Path to the config file (defaults to./pepper-sprite.yaml)
Example workflow:
- Create a
pepper-sprite.yamlfile in your project root:
files:
- fileId: "hero-sprite-001"
output: "./assets/images/hero.png"
- fileId: "enemy-sprite-002"
output: "./assets/images/enemy.png"- Run the get command:
$ pepper_sprite_cli get -k your-api-keyThis will:
- Download each file from the cloud service
- Export each file as a PNG image
- Save to the specified output paths
- Clean up temporary files automatically
A sample command that prints a joke.
$ pepper_sprite_cli sample
# Print in cyan
$ pepper_sprite_cli sample --cyanOptions:
-c, --cyan- Prints the same joke, but in cyan
Updates the CLI to the latest version.
$ pepper_sprite_cli updateTo run all unit tests use the following command:
$ dart pub global activate coverage 1.15.0
$ dart test --coverage=coverage
$ dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.infoTo view the generated coverage report you can use lcov .
# Generate Coverage Report
$ genhtml coverage/lcov.info -o coverage/
# Open Coverage Report
$ open coverage/index.html