Skip to content

Advanced Commands ​

OSGi runtime ​

bash
ldev osgi status com.acme.foo.web
ldev osgi diag com.acme.foo.web
ldev osgi thread-dump --count 6 --interval 3
ldev osgi heap-dump
ldev osgi gogo
  • status <bundle> / diag <bundle> — inspect a bundle symbolic name
  • gogo — open an interactive Gogo Shell session
  • thread-dump — collect one or more thread dumps
  • heap-dump — generate a heap dump

Worktrees ​

Create an isolated git worktree and (optionally) prepare its local env.

bash
ldev worktree setup --name incident-123 --with-env
ldev worktree setup --name feature-x --base origin/main --with-env
ldev worktree setup --name feature-x --with-env --stop-main-for-clone
ldev worktree setup --name feature-x --with-env --stop-main-for-clone --restart-main-after-clone
cd .worktrees/feature-x
ldev worktree setup --with-env
cd .worktrees/incident-123
ldev start

ldev worktree start incident-123
ldev worktree env --name incident-123
ldev worktree list
ldev worktree status incident-123
ldev worktree clean incident-123 --force
ldev worktree clean incident-123 --force --delete-branch
ldev worktree gc --days 14
ldev worktree gc --days 14 --apply
  • setup — create or reuse a worktree; --name is optional when running inside the target worktree
  • setup prefers .worktrees/<name> for managed worktrees, but can also reuse a registered external linked worktree whose checkout folder matches <name>
  • setup --stop-main-for-clone — opt-in: stop main automatically when a non-Btrfs clone needs exclusive access
  • setup --restart-main-after-clone — opt-in: after an automatic stop, start main again without waiting for full portal readiness
  • start — prepare and start the worktree's local env
  • env — prepare or inspect the worktree's local env wiring
  • list — show registered worktrees with Compose project, runtime status and ports
  • status — inspect one worktree without relying on generic port scans
  • clean — destructive; requires --force; optionally deletes fix/<name> branch
  • gc — preview (default) or --apply removal of stale worktrees older than --days

Dashboard ​

Open a local browser dashboard for worktree and environment operations.

bash
ldev dashboard
ldev dashboard --port 4242 --no-open
  • shows worktree inventory, recent commits, changed files, ahead/behind state, and env status
  • queues long-running actions into a live activity rail instead of blocking the terminal
  • exposes guided flows for diagnose, deploy status, DB tools, maintenance preview, and resource export
  • is best used as a local operational console; the CLI remains the canonical automation surface

BTRFS snapshots (Linux) ​

On Linux with BTRFS filesystems, ldev uses subvolume snapshots to accelerate worktree environment creation.

bash
ldev worktree btrfs-refresh-base

Re-seeds BTRFS_BASE from the current main env data root. env restore uses this as the source when available.

Reindex ​

Inspect or temporarily tune portal reindex execution.

bash
ldev portal reindex status
ldev portal reindex watch --interval 5 --iterations 60
ldev portal reindex tasks
ldev portal reindex speedup-on
ldev portal reindex speedup-off

speedup-on sets refresh_interval=-1 while a reindex is running; speedup-off restores it to 1s.

Direct Elasticsearch inspection, broader than portal reindex status.

bash
ldev portal search indices
ldev portal search mappings --index liferay-0
ldev portal search query --index liferay-0 --query '*'
ldev portal search query --index liferay-0 --body '{"query":{"match_all":{}}}'

Page layout ​

Export and diff content pages.

bash
ldev portal page-layout export --url /web/guest/home --output pages/home.json
ldev portal page-layout diff --url /web/guest/home --file pages/home.json
ldev portal page-layout diff --url /web/guest/home --reference-url /web/guest/home-candidate

diff exits with code 1 when pages differ, for use in pipelines.

Theme check ​

Validate Clay icon coverage for a deployed theme.

bash
ldev portal theme-check --theme ub-theme --json

Verify page ​

Browser-driven post-change visual verification, replacing the manual login/navigate/screenshot/console-check sequence with one command. Requires playwright as a local dependency (npm install --save-dev playwright && npx playwright install chromium) — it is intentionally not a hard ldev dependency, so installing ldev never forces a Chromium download.

bash
ldev verify page --url /web/guest/home
ldev verify page --url /web/guest/home --skip-login --json
ldev verify page --url /web/guest/home --screenshot .tmp/verify/home.png
  • --url <friendlyUrl> — required; a friendly URL or full http(s) URL
  • --skip-login — for public pages that do not require authentication
  • --login-email / --login-password — override LDEV_VERIFY_LOGIN_EMAIL / LDEV_VERIFY_LOGIN_PASSWORD (default test@liferay.com / test)
  • --screenshot <path> — output path (default .tmp/verify/<slug>-<timestamp>.png)

Runs login, navigation, console error capture, a screenshot, and DOM sanity checks, then — when the project tracks a local resource catalog under liferay/resources — diffs the rendered page's structures/templates/adts/fragments against those files. Returns a structured pass/fail report and exits non-zero on failure.

@mordonezdev/ldev for operational Liferay maintenance workflows. Built by Miguel Ordóñez