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 and plugins between your local machine and any WordPress instance.

The Loopress WordPress plugin must be installed and active on the site you want to manage.

Commands for managing the tool itself, your projects, and your Loopress account:

Group Command Description
Auth lps login Log in to the Loopress console
lps logout Log out from the Loopress console
Setup lps init Create a loopress.json config file interactively
lps status Show which project and environment commands will target
lps doctor Diagnose connectivity, plugin and credential problems
Project lps project config Add or update a WordPress project environment
lps project list List configured WordPress projects
lps project switch Switch the active project and environment
lps project remove Remove one or more WordPress projects or environments
lps project push Push locally configured projects, environments and credentials to your Loopress account
lps project pull Pull projects and environments from your Loopress account that aren’t configured locally yet
Telemetry lps telemetry enable Enable error reporting to Sentry
lps telemetry disable Disable error reporting to Sentry

Each of these syncs one kind of WordPress data as files in Git. See its own page for commands, flags, and file format:

  • Snippets: PHP/CSS/JS code snippets (Code Snippets or WPCode)
  • ACF: Advanced Custom Fields configuration
  • SEO: SEO settings, post meta, and redirects (RankMath or Yoast)
  • Forms: WPForms forms
  • Pages: WordPress pages
  • API Routes: custom REST API endpoints
  • Plugins: installed WordPress.org plugins manifest
  • Composer: PHP dependencies, without SSH
Terminal window
# 1. Connect to your WordPress site
lps project config
# 2. Initialize your project config
lps init
# 3. Pull your snippets
lps snippet pull
# 4. Edit, commit, push
git add snippets/ && git commit -m "update snippet"
lps snippet push

Full 3-minute setup guide

All commands authenticate against WordPress using an Application Password. By default, lps project config creates one automatically by authorizing in your browser. Generating one manually under Users → Profile → Application Passwords is available as a fallback.

The CLI supports managing multiple projects (lps project config) and switching between them (lps project switch).