GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Registering custom commands · Issue #581 · dotkernel/api

Registering custom commands #581

New issue
Copy link
New issue
Copy link
Open
Open
Registering custom commands#581
Copy link

Description

@bidi47
bidi47
opened on Nov 12, 2026
Issue body actions

Feature Request

Q A
New Feature yes
RFC no
BC Break yes

Summary

Currently, the command name is declared in four places

  • #[AsCommand(name: 'admin:create')]
  • public static $defaultName
  • setName(self::$defaultName) in configure()
  • the config key.

Only the config key remains at runtime, because the loader's setName($name) overrides the others. The config uses Cmd::$defaultName as the key so the two stay in sync. Symfony Console has deprecated the static $defaultName in favour of #[AsCommand], but both declarations were kept in the recent package updates to retain functionality in our applications.

The goal is to find a solution that removes the duplicate naming.

Activity

  1. alexmerlin commented on Nov 12, 2026

    @alexmerlin
    alexmerlin
    on Nov 12, 2026
    Member
    More actions

    My suggestion:

    src/<module>/src/Command/SomeCommand.php:

    #[AsCommand(
        name: SomeCommand::DEFAULT_NAME,
        description: 'Do something.',
    )]
    class SomeCommand extends Command
    {
        public const string DEFAULT_NAME = 'some:action';

    config/autoload/cli.global.php:

        'dot_cli'                  => [
            'version'  => '1.0.0',
            'name'     => 'Dotkernel CLI',
            'commands' => [
                SomeCommand::DEFAULT_NAME => SomeCommand::class,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.