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
lps validate Check local tracked files are well formed and push-ready, without contacting WordPress
lps dev Watch snippets, pages, API routes and plugins, pushing each change to the local environment automatically
lps push Push plugins, composer, ACF, API routes, forms, pages, SEO, and snippets to WordPress in one command
lps pull Pull plugins, composer, ACF, API routes, forms, pages, SEO, and snippets from WordPress in one command
lps promote Copy every tracked resource from one environment to another (lps pull from the source, then lps push to the target)
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
lps project rotate Rotate the WordPress application password for a project
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
  • API Routes: custom REST API endpoints
  • Plugins: installed WordPress.org plugins manifest
  • Composer: PHP dependencies, without SSH

Connecting an AI agent instead of a human? See the MCP server.

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 CLI installation and 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).