Revision 529475 of Developer Toolbar

  • Revision slug: Tools/GCLI
  • Revision title: Developer Toolbar
  • Revision id: 529475
  • Created:
  • Creator: wbamberg
  • Is current revision? No
  • Comment

Revision Content

The Developer Toolbar gives you command-line access to a number of developer tools from within Firefox. The Developer Toolbar is a Graphical Command Line Interpreter: it has the power and conciseness of a command line, but provides integrated help for its commands and can display rich output. It's also extensible: you can add your own local commands and even convert them to add-ons so other people can install them too.

Opening the Developer Toolbar

To open the Developer Toolbar press Shift+F2, or go to the Web Developer menu (which is a submenu in the Tools menu on Mac OSX and Linux) and choose "Developer Toolbar". It appears attached to the bottom of the browser, like this:

The prompt for the command line takes up most of the toolbar, with a "Close" button on the left and a button to toggle the Toolbox on the right.

Apart from the "Close" button, Shift+F2 or the "Developer Toolbar" menu item both toggle the toolbar off.

Using the command line

Like a normal command line, you execute commands by typing them at the prompt and pressing Enter.

As you type, the Developer Toolbar suggests a possible completion to your command:

If there is more than one possible completion, the Up and Down arrow keys cycle through the suggestions. Pressing Tab selects the current suggestion.

Pressing F1 will display all the suggestions in a list, with a summary of what each command will do:

Typing "help" will show a list of all commands:

Typing "help <command>" will give you the help for <command>:

Commands

Since the Developer Toolbar provides built-in help for the commands it supports, we haven't provided complete documentation for the supported commands here. To get complete documentation for <command>, type "help <command>" into the toolbar.

addon List all installed add-ons, disable or enable a specific add-on.
appcache View and manipulate appcache entries.
break List, add, and remove breakpoints.
calllog Log function calls to the Console.
connect Connect to a remote server: subsequent commands will be run on the server.
console Open, close, and clear the Console.
context Add a prefix to future commands.
cookie List, remove, and set cookies.
dbg Commands to control the Debugger.
disconnect Disconnect from a remote server.
edit Edit one of the resources loaded by the page.
export Export the page.
help Show all available commands.
inspect Examine a node in the Inspector.
jsb Pretty-print a JavaScript file.
listen Enable remote debugging.
media Emulate the given media type for the current page.
pagemod Remove and replace attributes and elements in the current page.
paintflashing Switch paint flashing on and off.
pref Set, reset, and display preferences.
profiler Start/stop profiling, and open/close the Profiler.
resize Control Responsive Design View.
restart Restart the browser.
screenshot Take a screenshot.
tilt Open, close, and manipulate 3D view.
tools Load devtools from a local checkout.

Adding commands

You can add commands to the Toolbar in two ways:

Also see documentation about writing commands.

Contributing to the Command Line

The Firefox command line is built using the GCLI project, which has a significant section of documentation on GCLI and how it works. There is also documentation specific to integrating GCLI and Firefox on MDN.

Revision Source

<p>The Developer Toolbar gives you command-line access to a number of developer tools from within Firefox. The Developer Toolbar is a <a href="https://github.com/joewalker/gcli/">Graphical Command Line Interpreter</a>: it has the power and conciseness of a command line, but provides integrated help for its commands and can display rich output. It's also extensible: you can add your own local commands and even convert them to add-ons so other people can install them too.</p>
<h2 id="Opening_the_Developer_Toolbar">Opening the Developer Toolbar</h2>
<p>To open the Developer Toolbar press Shift+F2, or go to the Web Developer menu (which is a submenu in the Tools menu on Mac OSX and Linux) and choose "Developer Toolbar". It appears attached to the bottom of the browser, like this:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7275/gcli-annotated.png" style="display: block; margin-left: auto; margin-right: auto;" />The prompt for the command line takes up most of the toolbar, with a "Close" button on the left and a button to toggle the <a href="/en-US/docs/Tools_Toolbox" title="/en-US/docs/Tools_Toolbox">Toolbox</a> on the right.</p>
<p>Apart from the "Close" button, Shift+F2 or the "Developer Toolbar" menu item both toggle the toolbar off.</p>
<h2 id="Using_the_command_line">Using the command line</h2>
<p>Like a normal command line, you execute commands by typing them at the prompt and pressing Enter.</p>
<p>As you type, the Developer Toolbar suggests a possible completion to your command:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7277/gcli-completion.png" style="display: block; margin-left: auto; margin-right: auto;" />If there is more than one possible completion, the Up and Down arrow keys cycle through the suggestions. Pressing Tab selects the current suggestion.</p>
<p>Pressing F1 will display all the suggestions in a list, with a summary of what each command will do:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7279/gcli-f1.png" style="display: block; margin-left: auto; margin-right: auto;" /></p>
<p>Typing "help" will show a list of all commands:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7281/gcli-help.png" style="display: block; margin-left: auto; margin-right: auto;" />Typing "help &lt;command&gt;" will give you the help for &lt;command&gt;:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/7283/gcli-help-command.png" style="display: block; margin-left: auto; margin-right: auto;" /></p>
<h2>Commands</h2>
<p>Since the Developer Toolbar provides built-in help for the commands it supports, we haven't provided complete documentation for the supported commands here. To get complete documentation for &lt;command&gt;, type "help &lt;command&gt;" into the toolbar.</p>
<table class="standard-table">
 <tbody>
  <tr>
   <td>addon</td>
   <td>List all installed add-ons, disable or enable a specific add-on.</td>
  </tr>
  <tr>
   <td>appcache</td>
   <td>View and manipulate <a href="/en/docs/HTML/Using_the_application_cache">appcache</a> entries.</td>
  </tr>
  <tr>
   <td>break</td>
   <td>List, add, and remove breakpoints.</td>
  </tr>
  <tr>
   <td>calllog</td>
   <td>Log function calls to the <a href="/en-US/docs/Tools/Web_Console">Console</a>.</td>
  </tr>
  <tr>
   <td>connect</td>
   <td>Connect to a remote server: subsequent commands will be run on the server.</td>
  </tr>
  <tr>
   <td>console</td>
   <td>Open, close, and clear the <a href="/en-US/docs/Tools/Web_Console">Console</a>.</td>
  </tr>
  <tr>
   <td>context</td>
   <td>Add a prefix to future commands.</td>
  </tr>
  <tr>
   <td>cookie</td>
   <td>List, remove, and set cookies.</td>
  </tr>
  <tr>
   <td>dbg</td>
   <td>Commands to control the <a href="/en-US/docs/Tools/Debugger">Debugger</a>.</td>
  </tr>
  <tr>
   <td>disconnect</td>
   <td>Disconnect from a remote server.</td>
  </tr>
  <tr>
   <td>edit</td>
   <td>Edit one of the resources loaded by the page.</td>
  </tr>
  <tr>
   <td>export</td>
   <td>Export the page.</td>
  </tr>
  <tr>
   <td>help</td>
   <td>Show all available commands.</td>
  </tr>
  <tr>
   <td>inspect</td>
   <td>Examine a node in the <a href="/en-US/docs/Tools/Page_Inspector">Inspector</a>.</td>
  </tr>
  <tr>
   <td>jsb</td>
   <td>Pretty-print a JavaScript file.</td>
  </tr>
  <tr>
   <td>listen</td>
   <td>Enable remote debugging.</td>
  </tr>
  <tr>
   <td>media</td>
   <td>Emulate the given <a href="/en-US/docs/Web/CSS/@media">media type</a> for the current page.</td>
  </tr>
  <tr>
   <td>pagemod</td>
   <td>Remove and replace attributes and elements in the current page.</td>
  </tr>
  <tr>
   <td>paintflashing</td>
   <td>Switch <a href="/en-US/docs/Tools/Paint_Flashing_Tool">paint flashing</a> on and off.</td>
  </tr>
  <tr>
   <td>pref</td>
   <td>Set, reset, and display preferences.</td>
  </tr>
  <tr>
   <td>profiler</td>
   <td>Start/stop profiling, and open/close the <a href="/en-US/docs/Tools/Profiler">Profiler</a>.</td>
  </tr>
  <tr>
   <td>resize</td>
   <td>Control <a href="/en-US/docs/Tools/Responsive_Design_View">Responsive Design View</a>.</td>
  </tr>
  <tr>
   <td>restart</td>
   <td>Restart the browser.</td>
  </tr>
  <tr>
   <td>screenshot</td>
   <td>Take a screenshot.</td>
  </tr>
  <tr>
   <td>tilt</td>
   <td>Open, close, and manipulate <a href="/en-US/docs/Tools/3D_View">3D view</a>.</td>
  </tr>
  <tr>
   <td>tools</td>
   <td>Load devtools from a local checkout.</td>
  </tr>
 </tbody>
</table>
<h2 id="Extending_the_Command_Line">Adding commands</h2>
<p>You can add commands to the Toolbar in two ways:</p>
<ul>
 <li><a href="/en-US/Tools/GCLI/Scratchpad">Using Scratchpad</a>, you can add commands that don't persist, but can be converted to add-ons</li>
 <li><a href="/en-US/Tools/GCLI/Customization">Using a 'mozcmd' directory</a> you can create local persistent commands</li>
</ul>
<p>Also see <a href="/en-US/Tools/GCLI/Writing_GCLI_Commands" title="en-US/Tools/GCLI/Writing_GCLI_Commands">documentation about writing commands</a>.</p>
<h2 id="Contributing_to_the_Command_Line">Contributing to the Command Line</h2>
<p>The Firefox command line is built using the <a href="https://github.com/joewalker/gcli/" title="https://github.com/joewalker/gcli/">GCLI</a> project, which has a significant <a href="https://github.com/joewalker/gcli/blob/master/docs/index.md" title="https://github.com/joewalker/gcli/blob/master/docs/index.md">section of documentation on GCLI</a> and how it works. There is also documentation specific to <a href="/en-US/docs/Tools/GCLI/Building_GCLI_For_Firefox" title="/en-US/Tools/GCLI/Building_GCLI_For_Firefox">integrating GCLI and Firefox on MDN</a>.</p>
Revert to this revision