Skip to content

mw wiki bulk apply

Releasev0.35.0 · cfeceb67

mw wiki bulk apply [flags]

Read one explicit edit object per line from –input FILE or –input -. Each record requires operation and summary; updates require a positive baserevid. Supported operations: page-put, entity-create, term-change, statement-add/update/remove, qualifier-add/remove, reference-add/remove. Page creation requires createonly=true and baserevid=0. Entity creation requires baserevid=0. Kind must be item or property for Wikibase operations.

Results are streamed as NDJSON: line, optional record_id, operation, status and result/error. –dry-run validates and reads preconditions but fetches no CSRF tokens and writes nothing. Errors are reported per record and cause a failing final exit status. An ambiguous POST outcome is marked error.ambiguous=true: inspect the wiki before retrying that record. No failed writes are retried automatically. There is no implicit bridge from page-list output to edits, and no transaction across records.

Example record: {“operation”:“term-change”,“kind”:“item”,“entity”:“Q42”,“term”:“label”,“change”:“set”,“language”:“en”,“values”:[“Example”],“baserevid”:123,“summary”:“Correct label”}

--dry-run
Preview validated records without CSRF requests or wiki writes
--input <string>
JSONL edit file, or - for stdin (required)
--stop-on-error
Stop after the first failed record (earlier successes remain applied)
--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
mw wiki bulk apply --input edits.jsonl --dry-run
mw wiki bulk apply --input - --stop-on-error
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.