Releases: bearsunday/BEAR.Cli
Releases · bearsunday/BEAR.Cli
0.1.1
0.1.0
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.