Skip to content

cherrybit-studios/pepper_sprite_cli

Repository files navigation

pepper_sprite_cli

coverage style: very good analysis License: MIT

Generated by the Very Good CLI 🤖

A Very Good Project created by Very Good CLI..


Getting Started 🚀

Install the CLI globally from the Git repository:

dart pub global activate --source=git https://github.com/cherrybit-studios/pepper_sprite_cli.git

Or locally via:

dart pub global activate --source=path <path to this package>

Usage

# Show CLI version
$ pepper_sprite_cli --version

# Show usage help
$ pepper_sprite_cli --help

Commands

download

Downloads 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.psp

export

Exports 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 0

get

Downloads 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.yaml

Options:

  • -k, --api-key (mandatory) - The API key for authentication
  • -c, --config (optional) - Path to the config file (defaults to ./pepper-sprite.yaml)

Example workflow:

  1. Create a pepper-sprite.yaml file in your project root:
files:
  - fileId: "hero-sprite-001"
    output: "./assets/images/hero.png"

  - fileId: "enemy-sprite-002"
    output: "./assets/images/enemy.png"
  1. Run the get command:
$ pepper_sprite_cli get -k your-api-key

This 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

sample

A sample command that prints a joke.

$ pepper_sprite_cli sample

# Print in cyan
$ pepper_sprite_cli sample --cyan

Options:

  • -c, --cyan - Prints the same joke, but in cyan

update

Updates the CLI to the latest version.

$ pepper_sprite_cli update

Running Tests with coverage 🧪

To 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.info

To 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages