How do I access the console in Portal 2?
To open the console in Portal 2, enable it first, then press the tilde key (~, the key under Esc). You can enable it in the game's keyboard settings or by adding -console to the game's launch options in Steam.
Method 1: in-game options
- Launch Portal 2 and open Options from the main menu.
- Go to Keyboard/Mouse.
- Set Allow Developer Console to Enabled.
- Apply, then press ~ to open or close the console.
Method 2: Steam launch options
- In your Steam Library, right-click Portal 2 > Properties.
- Under General, find Launch Options and type
-console. - Start the game; the console opens automatically and ~ toggles it.
Useful commands
map sp_a1_intro1loads a specific level by map name. Typemapand the console suggests names.restart_levelrestarts the current chamber.sv_cheats 1enables cheat commands such asnoclipandgod. Use it only offline in single-player, and expect it to affect achievements.fps_max 0or a number limits your frame rate.
If ~ doesn't work
On some keyboard layouts the console key is different. Bind it manually in Options > Keyboard under the console toggle, or type bind "F10" "toggleconsole" once the console is open.
FAQ
How do I play a specific level in Portal 2?
Open the console and type map followed by the level name, or use the Chapter select in the main menu.
How do I load custom maps?
Workshop maps are loaded from the Community Test Chambers menu. Maps you place in the game's maps folder can be loaded with the map command.
What are the controls in Portal 2?
On PC: WASD to move, Space to jump, Ctrl to crouch, left and right mouse buttons for the blue and orange portals, E to use or pick up.
Can I open the console from the main menu?
Yes. Once the console is enabled, press ~ on the main menu as well as in game.
How do I open the console in the first Portal?
Go to Options > Keyboard > Advanced and tick Enable developer console, or add -console to the launch options, then press ~.