Skip to content

Loopress CLI

The Loopress CLI (lps) is a Node.js command-line tool that connects to the WordPress REST API to sync code snippets between your local machine and any WordPress instance.

GroupCommandDescription
Snippetslps snippets pullDownload snippets from WordPress
lps snippets pushUpload local .php files to WordPress
lps snippets listList all snippets on the site
Sitelps site configAdd or update a site credential
lps site switchSwitch the active site
lps site removeRemove a saved site
Terminal window
# 1. Configure your first site
lps site config
# 2. Pull your snippets
lps snippets pull
# 3. Edit, commit, push
git add snippets/ && git commit -m "update snippet"
lps snippets push

Full setup guide

All commands authenticate using a WordPress Application Password. These are generated in Users → Profile → Application Passwords.

The CLI supports managing multiple sites (lps site config) and switching between them (lps site switch). For CI environments, credentials can be passed as environment variables (WP_URL, WP_USERNAME, WP_APP_PASSWORD).