Tired of manually looking up usernames and passwords and login URLs from a database? Can't remember the URL of that site exactly? What if you could open /wp-admin
with a one-liner right from the terminal? Well now you can.
NodeJS: >=18 Chromium: >=85
- Clone the repository:
git clone https://github.com/mjones129/puppeteer.git
- Install the dependencies:
npm install
-
Make the WP Login file executable
chmod +x /path/to/puppeteer/WPlogin.mjs
-
Add this repo to your
$PATH
and create an alias for the wp login file by adding the following lines to your.bashrc
or.zshrc
file.4a.
export PATH="$PATH:/path/to/puppeteer"
4b.
alias login='node /path/to/puppeteer/WPlogin.mjs
4c. Save your file and reload it with
source ~/.bashrc
orsource ~/.zshrc
-
Add real credentials to a new
.mjs
file. Use theexample-creds.mjs
file as a reference. -
Import your new creds file at the top of
WPlogin.mjs
(line 2) -
Save your new creds file and any modifications you might have made to
WPlogin.mjs
.
Call the main program and pass in the site alias that you defined in your creds file. An example login might look like this:
login site-alias1