pepperfm / sloyka-console
Sloyka application CLI
Requires
- php: ^8.6
- ext-pcntl: *
- symfony/console: ^8.2
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Optional application CLI, PHP ^8.6 and Symfony Console. Include the package in the application require section, not require-dev. Core has no dependency on Console.
Commands and capabilities
The generated root entrypoint registers HTTP or Vue server commands and selects type generation, migrations and scaffolding explicitly:
Bake::application(__DIR__, vue: true, types: true, migrations: true, generators: true, diagnostics: true)
The legacy Bake::application(root, vue) signature retains its previous command list and defaults. Explicit types/migrations capabilities also require the corresponding installed package and application declarations/config files; they never evaluate database configuration. Scaffolding is opt-in and targets the new App\ → app/ layout.
- php bake list / help: no application bootstrap or database.
- php bake serve: local PHP server; --port (HTTP 8000, Vue 45174).
- php bake dev: HTTP server or Vue PHP + Vite via Bun; --port and --vite-port (45173 by default).
- php bake types:generate [--check]: explicit exports, available when enabled.
- php bake migrate [version] [--dry-run] [--allow-no-migration], migrate:status, migrate:sync: owner environment only.
Explicit diagnostics capability adds --debug to serve/dev for new starters only. A valid SLOYKA_APP_DEBUG=1 also opts in; --debug overrides 0, invalid values fail before starting a process. For Vue, Bake removes the app debug variable from the shared Bun environment and selects the dev:php:debug script, which enables the flag for PHP only. No debug flag is inferred from Vite origin or build commands. Do not use reverse proxies or tunnels with debug. Legacy Bake consumers retain their original options and environment.
Long-running commands replace Bake via pcntl_exec; no independent process supervisor or shell interpolation. Servers bind only to loopback.
Generators
php bake make:controller Admin/UserController
php bake make:middleware Authenticate
php bake make:model User
php bake make:service Billing/InvoiceService
php bake make:repository UserRepository
php bake make:dto UserData
php bake make:page Admin/Dashboard
PHP names are complete class names: no automatic Controller, Service or other suffix. Nested PHP names accept / or \ (quote a backslash name in a shell); do not mix the separators. Vue page names use / only. Each segment starts with an ASCII uppercase letter followed by ASCII letters, digits or underscores, at most 80 characters; at most 8 segments and 240 input bytes. PHP keywords/pseudo-types and portable reserved device names are rejected.
Targets:
| Command | Directory |
|---|---|
| make:controller | app/Http/Controllers |
| make:middleware | app/Http/Middleware |
| make:model | app/Models |
| make:service | app/Services |
| make:repository | app/Repositories |
| make:dto | app/DTO |
| make:page (Vue only) | resources/js/Pages |
Controller has an invokable HTTP Response stub (register explicitly as [Controller::class, '__invoke']), middleware implements the actual HTTP MiddlewareContract interface, DTO is a plain readonly class; model/service/repository are plain PHP classes without ORM, properties or mandatory interfaces. Vue page is a minimal Nuxt UI component. There is no automatic routing, registry or export editing: register a route to a controller, add the page name in routes/pages.php and return Page::render('Admin/Dashboard'). For typed props, implement Arrayable in a DTO, register the class with the page and select it explicitly in type-exports.php; run php bake types:generate. Literal pages require no typed export.
Filesystem safety
Generation requires ext-posix and a canonical, owner-controlled application root. The first target directory (app or resources) must already exist; missing nested directories are created on demand. Every existing target ancestor must be a real directory owned by the effective user and not group/world writable. Names are case-collision checked on every supported filesystem. Existing files, symlinks (including dangling), hardlinks and path traversal are rejected. Exclusive file creation never overwrites; on a failed write only the verified owned partial file and newly created empty directories are eligible for cleanup. No --force option.
The threat model is an owner-controlled project, not a hostile directory concurrently writable by another process with the same UID. Portable PHP filesystem checks and exclusive creation do not guarantee race-proof path traversal protection under such hostile mutation.
New applications with bootstrap/app.php use package-owned Runtime scripts for the local server, type generation and migrations. No application-level router.php or bin scripts are required. The application owns the front controller, module composition, route/export declarations and database configuration. Bake reports the installed Composer package version.
AI skills
After installing Composer dependencies, run:
php bake ai:install
php bake ai:update
php bake ai:install --agent=claude
Codex is the default (.agents/skills); Claude Code uses .claude/skills. The commands copy versioned Markdown skills from the installed Sloyka modules only, without bootstrapping the app or using the network. Commit the copied skills and .sloyka-skills.json together if sharing project instructions. Updates replace only unmodified, previously managed SKILL.md files; customized and existing unmanaged skills are preserved. Skills for unavailable modules are reported for manual review, not deleted. AGENTS.md and other user instructions are never changed.
Source snapshot: 2ca60eb2285bd7c4110ee6e938ceb1f3f0320ff8