Skip to content

Releases: bearsunday/BEAR.Cli

0.1.1

14 Nov 21:02
26a178e
Compare
Choose a tag to compare

What's Changed

  • Remove CLI description parameter from GenFormula by @koriym in #4
  • Add FormulaException handling to improve robustness by @koriym in #5

Full Changelog: 0.1.0...0.1.1

0.1.0

14 Nov 09:05
a1135c1
Compare
Choose a tag to compare

Initial Release 0.1.0

Initial release of BEAR.Cli - A tool to transform BEAR.Sunday resources into native CLI commands.

Features

  • Transform URI-addressable resources into native CLI commands
  • Generate Homebrew formula for easy distribution
  • Support standard CLI features (help, version, etc.)
  • Multiple output formats (text/JSON)
  • Zero additional code required for existing resources

Example

use BEAR\Cli\Attribute\Cli;
use BEAR\Cli\Attribute\Option;

class Greeting extends ResourceObject
{
    #[Cli(
        name: 'greet',
        description: 'Say hello in multiple languages',
        output: 'greeting'
    )]
    public function onGet(
        #[Option(shortName: 'n', description: 'Name to greet')]
        string $name,
        #[Option(shortName: 'l', description: 'Language')]
        string $lang = 'en'
    ): static {
        // Resource implementation
    }
}
# Install
composer require bear/cli

# Generate CLI
vendor/bin/bear-cli-gen MyVendor.MyProject

# Use
$ greet -n "World" -l ja
こんにちは, World

Documentation

For detailed documentation, visit BEAR.Sunday CLI Documentation.