Skip to content

docs(app_development): add occ commands guide - #14853

Merged
skjnldsv merged 2 commits into
masterfrom
feature/occ-commands-documentation
May 15, 2026
Merged

docs(app_development): add occ commands guide#14853
skjnldsv merged 2 commits into
masterfrom
feature/occ-commands-documentation

Conversation

@skjnldsv

@skjnldsvskjnldsv commented May 14, 2026

Copy link
Copy Markdown
Member

Summary

Adds a new page to the App development section documenting how to implement occ commands in Nextcloud apps.

Covers:

  • OC\Core\Command\Base extends Symfony Console and adds bash completion support
  • Registration via appinfo/info.xml<commands> element with automatic DI container wiring
  • Full working example with constructor DI, arguments, options, and proper return codes
  • Naming conventions (appid:command-name, optional grouping with appid:group:command-name)
  • Arguments vs options reference table (Symfony InputArgument/InputOption constants)
  • Return codes (self::SUCCESS, self::FAILURE, self::INVALID)
  • Interactive commands with the Symfony question helper + non-interactive caveat ($input->isInteractive())

🖼️ Screenshots

✅ Checklist

  • I have built the documentation locally and reviewed the output
  • Screenshots are included for visual changes
  • I have not moved or renamed pages (or added a redirect if I did)
  • I have run codespell or similar and addressed any spelling issues

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

🔍 Open preview →

📄 2 changed documentation pages

Last updated: Fri, 15 May 2026 17:10:02 GMT

@skjnldsv
skjnldsvforce-pushed the feature/occ-commands-documentation branch from 09fc5a7 to a603b83CompareMay 14, 2026 16:44
@skjnldsv
skjnldsv requested a review from kesselbMay 14, 2026 18:21
Comment threaddeveloper_manual/app_development/commands.rst Outdated
Comment threaddeveloper_manual/app_development/commands.rst Outdated
Closes#5460
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv
skjnldsvforce-pushed the feature/occ-commands-documentation branch from a603b83 to 6cfa659CompareMay 15, 2026 07:36
The `occ` label is defined in the admin manual which is a separate
Sphinx build, causing an undefined label warning. Replace with an
absolute URL per the cross-manual linking convention.
Also fix the style guide which incorrectly documented `/latest/`
instead of `/server/latest/` as the cross-manual URL pattern.
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv
skjnldsvforce-pushed the feature/occ-commands-documentation branch from 7cf9fd7 to c08ad18CompareMay 15, 2026 10:44
@skjnldsv
skjnldsv enabled auto-merge May 15, 2026 10:45
@skjnldsv
skjnldsv merged commit 1ceab7d into masterMay 15, 2026
23 checks passed
@skjnldsv
skjnldsv deleted the feature/occ-commands-documentation branch May 15, 2026 17:10
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@skjnldsv@nickvergessen