Terminal in Chrome Devtools — Dmitry Filimonov


How do I install it?

If you’re on a Mac, just download this Chrome extension. Install it, and you good to go.
No need to read any further.

Oh, but I am not on a Mac

If you’re not on a Mac, you can connect to your system’s terminal via Node.js proxy. It can be localhost or some other remote server.

Install the app:

npm install -g devtools-terminal

Start the server:

Open Developer Tools (Win/Linux: F12; Mac: Cmd + Opt + I ), click the “Terminal” tab and connect to the server. The default port is 8080.

Okay, how do I configure it?

Here is the default configuration:

exports.config = {
  users: {
    admin: {
      password: "",
      cwd: process.cwd() //working directory
    }
  },
  port: 8080
};

This is a JavaScript file. You can pass your config like this:

devtools-terminal --config /path/to/config.js 

If you want something custom, I encourage you to check out the server’s source code, it is a very simple Node.js app.

Security

Passwords are not stored on the client, but they are transmitted in plain text. So if you want to use it in production environment, I strongly recommend you to use HTTPS.

Possible Use Cases

  • tail -f log/development.log
  • rails console
  • psql
  • and many more

Thanks to

Christopher Jeffrey for his term.js library which is awesome.

If you like it

I encourage you to follow me on Twitter and GitHub