Updated:

Minecraft Bedrock command generator

Build commands for Bedrock Edition by choosing options. Switch, mobile, PlayStation, Xbox and Windows all run Bedrock, so the same commands work on each. In every tool, choose Bedrock in the version list to get Bedrock syntax.

Generators that support Bedrock

Where Bedrock differs from Java

TaskBedrockJava
Give an item/give @p diamond_sword 1/give @p minecraft:diamond_sword 1
Apply an effect/effect @p speed 30 1/effect give @p minecraft:speed 30 1
Enchant the held item/enchant @p sharpness 5/enchant @p minecraft:sharpness 5
Select nearby targets@e[type=zombie,r=10]@e[type=minecraft:zombie,distance=..10]
Select only one@e[type=zombie,c=1]@e[type=minecraft:zombie,limit=1,sort=nearest]
Select by game mode@a[m=creative]@a[gamemode=creative]
Show a message/tellraw @a {"rawtext":[{"text":"Hello"}]}/tellraw @a {"text":"Hello"}
Remove dropped items/kill @e[type=item]/kill @e[type=minecraft:item]

More differences are listed in Java vs Bedrock commands.

Before you use commands on Bedrock

  1. Turn on Cheats in the world settings. Commands do not run while it is off.
  2. Open chat and type the command with a leading /. This works on Switch and mobile too.
  3. Put long commands in a command block. Get one with /give @s command_block.

What Bedrock commands cannot do

Check which IDs work on Bedrock

Each ID page says whether the same ID works on Bedrock: item IDs, mob IDs, enchantment IDs and effect IDs.

Questions

Do commands work on Nintendo Switch?

Yes. The Switch version is Bedrock Edition, so commands made with these tools work as they are.

Why does nothing happen when I enter a command?

Cheats may be off, or you may not have permission on a multiplayer world. Check the world settings and that you are an operator.

Can I use a Java command as it is?

Simple commands are close, but IDs and selectors are often written differently. Paste it into the converter to rewrite it for Bedrock.