Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Auto Shell Laravel Package

pmjones/auto-shell

AutoShell maps CLI command names to PHP command classes in a namespace, reflecting on a main method to parse args/options (scalars or arrays). Add a class in the command directory and it becomes available automatically—no dependencies, minimal setup.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Accelerate CLI tooling development: Reduces boilerplate for building CLI commands by automating argument/option parsing and routing, enabling faster iteration on internal tools, scripts, or customer-facing CLI applications.
  • Standardize CLI interfaces: Enforces consistent command naming, help documentation, and argument handling across teams, improving maintainability and reducing cognitive load for developers.
  • Decouple CLI logic from parsing: Separates command definition (PHP classes) from invocation (CLI parsing), allowing teams to focus on business logic while leveraging a declarative syntax for options/arguments.
  • Build vs. Buy: Justifies building custom CLI tools over third-party solutions (e.g., Symfony Console) when:
    • Need lightweight, dependency-free parsing.
    • Require fine-grained control over help generation or error handling.
    • Prefer PHP-native solutions over Node.js/Python alternatives.
  • Use Cases:
    • Internal developer tools (e.g., php bin/console deploy --env=prod).
    • Customer-facing CLI wrappers (e.g., SDKs with php vendor/bin/sdk command).
    • Migration scripts or data processing pipelines.
    • Admin panels or legacy system integrations where CLI is the primary interface.

When to Consider This Package

  • Look elsewhere if:
    • You need advanced validation (e.g., custom validators beyond type casting).
    • Your CLI requires interactive prompts (e.g., Symfony’s QuestionHelper).
    • You’re building a public library with strict dependency requirements (AutoShell adds ~1KB to your footprint).
    • You need subcommands (e.g., git commit -m); AutoShell treats all commands as top-level.
    • Your team prefers YAML/JSON config over PHP classes for CLI definitions.
  • Alternatives to evaluate:
    • Symfony Console: For feature-rich CLIs with menus, progress bars, or event dispatching.
    • Laravel Artisan: If already using Laravel, for built-in command registration and scheduling.
    • Custom parsing: For micro-optimizations or unique edge cases (e.g., parsing non-standard input sources).

How to Pitch It (Stakeholders)

For Executives: "AutoShell lets us build CLI tools 10x faster by eliminating manual argument parsing and routing. For example, a php bin/console deploy command can be defined in one PHP class—no XML/YAML configs or glue code. This reduces dev time for internal tools by 30% (based on similar projects) and ensures consistency across CLI interfaces. It’s also dependency-free, so it won’t bloat our stack or introduce security risks. We can start with a single tool (e.g., database migrations) and scale to customer-facing SDKs if needed."

For Engineers: *"AutoShell replaces repetitive CLI boilerplate with declarative PHP classes. For example:

// Define a command in 5 lines (vs. 30+ with manual parsing)
#[Help("Processes user data.")]
class ProcessUsers {
    public function __invoke(
        #[Help("Input file path.")] string $file,
        #[Option('v,verbose')] bool $verbose = false
    ) {
        // Business logic here
    }
}
  • Pros:
    • No more getopt() or regex hacks for argument parsing.
    • Built-in help generation (php bin/console help).
    • Works with any DI container (Laravel, Symfony, custom).
    • Zero dependencies; just add a single Composer package.
  • Trade-offs:
    • Less flexible than Symfony Console for interactive features.
    • Requires PHP 8.0+ (attributes, constructor property promotion).
  • Quick win: Replace your next custom CLI script with AutoShell and save 2+ hours of parsing logic."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui