Skip to content

mw wiki file upload

Releasev0.35.0 · cfeceb67

mw wiki file upload FILE [flags]

Upload a local file using a saved profile or explicit wiki credentials. Use –text-file for the initial file description and license wikitext. New versions preserve the existing description. Replacing a file requires –replace; other upload warnings require –ignore-warnings.

Guide: mw help guides wiki files

--comment <string>
Upload summary Default: a Wikimedia CLI upload.
--dry-run
Show the upload target without contacting the wiki
--filename <string>
Wiki filename without File: (defaults to the local basename)
--ignore-warnings
Accept other upload warnings (overwriting still requires --replace)
--replace
Allow uploading a new version of an existing file
--text <string>
Initial description and license wikitext for a new file
--text-file <string>
Read the initial description and license wikitext from a file
--anon
Use anonymous access instead of saved credentials
--help
Help for this command
--no-interaction
Do not ask any interactive questions
--password <string>
Wiki login password (or bot password)
--password-file <string>
Read the login password from a file
--profile <string>
Saved profile name or REALM/NAME
--realm <string>
Shared-login realm (wikimedia and wikibase-world are built in)
--username <string>
Wiki login username (use Name@bot for a bot password)
-v, --verbose <count>
Increase output verbosity. Example: --verbose=2 or -vv
--wiki <string>
Wiki URL or API endpoint
Terminal window
# Upload a video with a description and license
mw wiki file upload demo.webm --wiki commons.wikimedia.org --profile wikimedia/addshore --text-file description.wiki
# Upload a new version under the same wiki filename
mw wiki file upload demo.webm --wiki commons.wikimedia.org --profile wikimedia/addshore --filename 'Demo.webm' --replace --comment 'Refresh walkthrough'
Report an issue with this page

Report a documentation issue

The report includes this page’s link, section and documentation version.

Review and submit on Phabricator, or run the command using your saved CLI profile. The command asks before creating the task.