René's URL Explorer Experiment


Title: Abilities without `input_schema` return an error when run via the CLI · Issue #6 · wp-cli/ability-command · GitHub

Open Graph Title: Abilities without `input_schema` return an error when run via the CLI · Issue #6 · wp-cli/ability-command

X Title: Abilities without `input_schema` return an error when run via the CLI · Issue #6 · wp-cli/ability-command

Description: Bug Report Yes, I reviewed the contribution guidelines. Yes, more specifically, I reviewed the guidelines on how to write clear bug reports. Describe the current, buggy behavior The input_schema is optional, and I think for "simple" abil...

Open Graph Description: Bug Report Yes, I reviewed the contribution guidelines. Yes, more specifically, I reviewed the guidelines on how to write clear bug reports. Describe the current, buggy behavior The input_schema is...

X Description: Bug Report Yes, I reviewed the contribution guidelines. Yes, more specifically, I reviewed the guidelines on how to write clear bug reports. Describe the current, buggy behavior The input_schema is...

Opengraph URL: https://github.com/wp-cli/ability-command/issues/6

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Abilities without `input_schema` return an error when run via the CLI","articleBody":"## Bug Report\n\n- [x] Yes, I reviewed the [contribution guidelines](https://make.wordpress.org/cli/handbook/contributing/).\n- [x] Yes, more specifically, I reviewed the guidelines on [how to write clear bug reports](https://make.wordpress.org/cli/handbook/bug-reports/).\n\n**Describe the current, buggy behavior**\n\nThe `input_schema` is optional, and I think for \"simple\" abilities, it's fairly common to skip it, especially for those that are \"just\" returning data.\n\nhttps://github.com/WordPress/WordPress/blob/24dac1cd906af3e6c06a5c52b5ca8629b4c91080/wp-includes/abilities-api/class-wp-ability.php#L148\n\nHowever, when I run the ability for an ability that doesn't have an input schema defined, e.g. `wp ability run foo/simple-no-input`, I get the following error:\n\n```\nError: Ability \"foo/simple-no-input\" does not define an input schema required to validate the provided input.\n```\n\n**Describe how other contributors can replicate this bug**\n\nRegister an ability as follows:\n\n```php\nadd_action(\n    'wp_abilities_api_categories_init',\n    function () {\n        wp_register_ability_category(\n            'foo',\n            [\n                'label' => 'Foo',\n                'description' => 'Foo...',\n            ],\n        );\n    },\n);\n\nadd_action(\n    'wp_abilities_api_init',\n    function () {\n        wp_register_ability(\n            'foo/simple-no-input',\n            [\n                'label' => 'Simple No Input',\n                'description' => 'Simple No Input...',\n                'category' => 'foo',\n                'output_schema' => [\n                    'type' => 'array',\n                ],\n                'execute_callback' => function () {\n                    return [];\n                },\n                'permission_callback' => '__return_true',\n            ],\n        );\n    },\n);\n```\n\nThen run the `wp ability run foo/simple-no-input` via the CLI.\n\n**Describe what you would expect as the correct outcome**\n\nI would expect that if I register an ability without an input schema and call it with the CLI, I would receive an output, in this case `[]`.\n\n`wp_get_ability('foo/simple-no-input')->execute()` works perfectly.\n\n**Let us know what environment you are running this on**\n\n```\nPHP version: 8.4.22\nWP-CLI version: 2.13.0-alpha-c807ba0\nWP version: 7.0\n```\n\n**Provide a possible solution**\n\n...\n\n**Provide additional context/Screenshots**\n\nAfter a quick look, the problem seems to be that an empty array is passed to execute rather than `null` which is the default of the `execute` method:\n\nhttps://github.com/wp-cli/ability-command/blob/9e2b34eca6a37ec5d4aed9b73cbd14873a997c66/src/Ability_Command.php#L370-L374\n\nhttps://github.com/WordPress/WordPress/blob/24dac1cd906af3e6c06a5c52b5ca8629b4c91080/wp-includes/abilities-api/class-wp-ability.php#L734\n\nTo make a \"simple\" ability work with the CLI the following `input_schema` can be added:\n\n```php\n[\n    'input_schema' => [\n        'type' => 'object',\n    ],\n   \n],\n```\n\nHowever, the consequence of this is that when `wp_get_ability` is used, it has to be executed with an input:\n\n```php\nwp_get_ability('foo/simple-no-input')->execute([]);\n```\n\nThe following would result in an error, even though for a \"simple\" ability this would be the ideal situation:\n\n```php\nwp_get_ability('foo/simple-no-input')->execute();\n```\n\n```\nobject(WP_Error)#1124 (3) {\n  [\"errors\"]=>\n  array(1) {\n    [\"ability_invalid_input\"]=>\n    array(1) {\n      [0]=>\n      string(85) \"Ability \"foo/simple-no-input\" has invalid input. Reason: input is not of type object.\"\n    }\n  }\n  [\"error_data\"]=>\n  array(0) {\n  }\n  [\"additional_data\":protected]=>\n  array(0) {\n  }\n}\n```\n\nFrom what I see in the tests, there's no case where the `input_schema` is not defined:\n\nhttps://github.com/wp-cli/ability-command/blob/9e2b34eca6a37ec5d4aed9b73cbd14873a997c66/features/ability.feature#L152-L155","author":{"url":"https://github.com/meszarosrob","@type":"Person","name":"meszarosrob"},"datePublished":"2026-06-11T14:37:28Z","url":"https://github.com/wp-cli/ability-command/issues/6"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:58e91304-3500-f456-1ed4-8a5b3db57d95
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEC38:2F2AB3:11777D7:17F8BED:6AFB6A3C
html-safe-noncedc43ddfc0241aa38baf6929e5b4c1d761c0111cbf39697c70eafbecbeb8cce3b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzM4OjJGMkFCMzoxMTc3N0Q3OjE3RjhCRUQ6NkFGQjZBM0MiLCJ2aXNpdG9yX2lkIjoiNjQ3NzQwMTQxOTg1NzM2MjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac5b5583fce26e75d9928718216df451893534d958a6bb17196499bac8cb6f6965
hovercard-subject-tagissue:4641489917
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/wp-cli/ability-command/6/issue_layout
twitter:imagehttps://opengraph.githubassets.com/179573d9a3248ea6ef6fac1e254f23096c2fdc9e1ef31e66054c6898bb23999b/wp-cli/ability-command/issues/6
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/179573d9a3248ea6ef6fac1e254f23096c2fdc9e1ef31e66054c6898bb23999b/wp-cli/ability-command/issues/6
og:image:altBug Report Yes, I reviewed the contribution guidelines. Yes, more specifically, I reviewed the guidelines on how to write clear bug reports. Describe the current, buggy behavior The input_schema is...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemeszarosrob
hostnamegithub.com
expected-hostnamegithub.com
Noneea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94
turbo-cache-controlno-preview
go-importgithub.com/wp-cli/ability-command git https://github.com/wp-cli/ability-command.git
octolytics-dimension-user_id1570774
octolytics-dimension-user_loginwp-cli
octolytics-dimension-repository_id1113185972
octolytics-dimension-repository_nwowp-cli/ability-command
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1113185972
octolytics-dimension-repository_network_root_nwowp-cli/ability-command
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release59ef97164c52cf59bd10558ddec9c4f482763988
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/wp-cli/ability-command/issues/6#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fwp-cli%2Fability-command%2Fissues%2F6
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fwp-cli%2Fability-command%2Fissues%2F6
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=wp-cli%2Fability-command
Reloadhttps://github.com/wp-cli/ability-command/issues/6
Reloadhttps://github.com/wp-cli/ability-command/issues/6
Reloadhttps://github.com/wp-cli/ability-command/issues/6
wp-clihttps://github.com/wp-cli
ability-commandhttps://github.com/wp-cli/ability-command
Codehttps://github.com/wp-cli/ability-command
Issueshttps://github.com/wp-cli/ability-command/issues
Pull requestshttps://github.com/wp-cli/ability-command/pulls
Actionshttps://github.com/wp-cli/ability-command/actions
Security and qualityhttps://github.com/wp-cli/ability-command/security
Insightshttps://github.com/wp-cli/ability-command/pulse
https://github.com/wp-cli/ability-command
New issuehttps://github.com/login?return_to=https://github.com/wp-cli/ability-command/issues/6
New issuehttps://github.com/login?return_to=https://github.com/wp-cli/ability-command/issues/6
#7https://github.com/wp-cli/ability-command/pull/7
Abilities without input_schema return an error when run via the CLIhttps://github.com/wp-cli/ability-command/issues/6#top
#7https://github.com/wp-cli/ability-command/pull/7
https://github.com/swissspidy
https://github.com/copilot-swe-agent
command:ability-runRelated to 'ability run' commandhttps://github.com/wp-cli/ability-command/issues?q=state%3Aopen%20label%3A%22command%3Aability-run%22
scope:testingRelated to testinghttps://github.com/wp-cli/ability-command/issues?q=state%3Aopen%20label%3A%22scope%3Atesting%22
state:unconfirmedhttps://github.com/wp-cli/ability-command/issues?q=state%3Aopen%20label%3A%22state%3Aunconfirmed%22
https://github.com/meszarosrob
meszarosrobhttps://github.com/meszarosrob
on Jun 11, 2026https://github.com/wp-cli/ability-command/issues/6#issue-4641489917
contribution guidelineshttps://make.wordpress.org/cli/handbook/contributing/
how to write clear bug reportshttps://make.wordpress.org/cli/handbook/bug-reports/
https://github.com/WordPress/WordPress/blob/24dac1cd906af3e6c06a5c52b5ca8629b4c91080/wp-includes/abilities-api/class-wp-ability.php#L148https://github.com/WordPress/WordPress/blob/24dac1cd906af3e6c06a5c52b5ca8629b4c91080/wp-includes/abilities-api/class-wp-ability.php#L148
ability-command/src/Ability_Command.phphttps://github.com/wp-cli/ability-command/blob/9e2b34eca6a37ec5d4aed9b73cbd14873a997c66/src/Ability_Command.php#L370-L374
9e2b34ehttps://github.com/wp-cli/ability-command/commit/9e2b34eca6a37ec5d4aed9b73cbd14873a997c66
https://github.com/WordPress/WordPress/blob/24dac1cd906af3e6c06a5c52b5ca8629b4c91080/wp-includes/abilities-api/class-wp-ability.php#L734https://github.com/WordPress/WordPress/blob/24dac1cd906af3e6c06a5c52b5ca8629b4c91080/wp-includes/abilities-api/class-wp-ability.php#L734
ability-command/features/ability.featurehttps://github.com/wp-cli/ability-command/blob/9e2b34eca6a37ec5d4aed9b73cbd14873a997c66/features/ability.feature#L152-L155
9e2b34ehttps://github.com/wp-cli/ability-command/commit/9e2b34eca6a37ec5d4aed9b73cbd14873a997c66
github-actionshttps://github.com/apps/github-actions
command:ability-runRelated to 'ability run' commandhttps://github.com/wp-cli/ability-command/issues?q=state%3Aopen%20label%3A%22command%3Aability-run%22
scope:testingRelated to testinghttps://github.com/wp-cli/ability-command/issues?q=state%3Aopen%20label%3A%22scope%3Atesting%22
state:unconfirmedhttps://github.com/wp-cli/ability-command/issues?q=state%3Aopen%20label%3A%22state%3Aunconfirmed%22
on Jun 11, 2026https://github.com/wp-cli/ability-command/issues/6#event-26630920022
swissspidyhttps://github.com/swissspidy
Copilothttps://github.com/apps/copilot-swe-agent
swissspidyhttps://github.com/swissspidy
on Jun 12, 2026https://github.com/wp-cli/ability-command/issues/6#event-26679440756
https://github.com/swissspidy
swissspidyhttps://github.com/swissspidy
on Jun 12, 2026https://github.com/wp-cli/ability-command/issues/6#issuecomment-4695706777
#7https://github.com/wp-cli/ability-command/pull/7
https://github.com/meszarosrob
meszarosrobhttps://github.com/meszarosrob
on Jun 14, 2026https://github.com/wp-cli/ability-command/issues/6#issuecomment-4701109392
#7https://github.com/wp-cli/ability-command/pull/7
@swissspidyhttps://github.com/swissspidy
swissspidyhttps://github.com/swissspidy
Handle `wp ability run` missing input based on `input_schema` #7https://github.com/wp-cli/ability-command/pull/7
on Jun 16, 2026https://github.com/wp-cli/ability-command/issues/6#event-26800069174
swissspidyhttps://github.com/swissspidy
completedhttps://github.com/wp-cli/ability-command/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 16, 2026https://github.com/wp-cli/ability-command/issues/6#event-26800076078
Sign up for freehttps://github.com/signup?return_to=https://github.com/wp-cli/ability-command/issues/6
Sign in to commenthttps://github.com/login?return_to=https://github.com/wp-cli/ability-command/issues/6
Copilothttps://github.com/apps/copilot-swe-agent
swissspidyhttps://github.com/swissspidy
command:ability-runRelated to 'ability run' commandhttps://github.com/wp-cli/ability-command/issues?q=state%3Aopen%20label%3A%22command%3Aability-run%22
scope:testingRelated to testinghttps://github.com/wp-cli/ability-command/issues?q=state%3Aopen%20label%3A%22scope%3Atesting%22
state:unconfirmedhttps://github.com/wp-cli/ability-command/issues?q=state%3Aopen%20label%3A%22state%3Aunconfirmed%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.