Discovery Commands
Namespace-scoped connection overrides are available for remote execution on ldev portal and ldev resource:
ldev portal --liferay-url https://portal.example.com inventory sites --json
ldev --repo-root ../.. portal inventory sites --jsonUse ldev --repo-root <path> ... when the command should resolve local portal URL, OAuth2 credentials, and docker/.env from another checkout root, such as the main repo while your shell stays inside a worktree.
ldev context
Resolve repo, runtime, and Liferay context as one snapshot.
ldev context
ldev context --json
ldev context --describe --jsoncontext is the offline project snapshot: it returns repo root, worktree, resolved Liferay product/version, resource paths, runtime config, platform tool availability, and which command areas are supported. It does not contact Docker or the portal.
ldev portal check
Check OAuth and basic API reachability.
ldev portal check
ldev portal check --jsonReal text-mode example:
HEALTH_OK
baseUrl=http://localhost:8081
checkedPath=/o/headless-admin-user/v1.0/my-user-account
status=200
tokenType=Bearer
expiresIn=600ldev portal auth token
Fetch an OAuth2 access token for scripting.
ldev portal auth token
ldev portal auth token --raw--raw prints only the access token in text mode, so it can be captured for shell variables.
ldev portal inventory preflight
Check whether the portal's admin/JSONWS API surfaces are reachable with the current credentials. Used to fail fast before running longer inventory or resource flows.
ldev portal inventory preflight
ldev portal inventory preflight --force-refreshThe result is cached; --force-refresh bypasses the cache. You can also attach preflight as a pre-hook to any inventory or resource subcommand with --preflight:
ldev portal inventory --preflight sites --json
ldev resource --preflight export-structures --all-sitesldev portal inventory sites
List accessible sites, or switch into folder inventory mode when a site is selected.
ldev portal inventory sites
ldev portal inventory sites --json
ldev portal inventory sites --with-content --sort-by content
ldev portal inventory sites --site /estudis --with-structures --limit 20
ldev portal inventory sites --group-id 2710030 --with-structuresOptions:
--page-size <n>— JSONWS page size (default200)--with-content— include Journal content volume metrics--sort-by site|name|content— sort order (defaultsite)--limit <n>— max sites to return in content mode--site <friendlyUrl>— inspect one site (switches to folder inventory)--group-id <id>— inspect one site by numeric group id--with-structures— include per-folder structure breakdowns when scoped--exclude-site <site>— exclude a site from content metrics (repeatable)
ldev portal inventory pages
List pages in a site hierarchy.
ldev portal inventory pages --site /global
ldev portal inventory pages --site /guest --private-layout
ldev portal inventory pages --site /global --max-depth 4 --jsonldev portal inventory page
Inspect a specific page or display page.
ldev portal inventory page --url /home --json
ldev portal inventory page --url /web/guest/home --json
ldev portal inventory page --site /global --friendly-url /home --json
ldev portal inventory page --url /home --verbose--verbose includes fragment/widget element names, CSS classes, and custom CSS.
ldev portal inventory structures
List journal structures for a site or for every site.
ldev portal inventory structures --site /global --json
ldev portal inventory structures --site /global --with-templates --json
ldev portal inventory structures --all-sites --with-templates --jsonPrefer --with-templates as the first discovery step for structure/template incidents: it returns structures enriched with their associated templates in one call.
In text mode, --with-templates renders a detailed site -> structure -> template view. In --all-sites text mode, sites with no structures are omitted to keep discovery output focused.
ldev portal inventory templates
List web content templates for a site.
ldev portal inventory templates --site /global --jsonldev portal inventory where-used
Reverse lookup for portal resources. Use it when you already know the fragment, widget, Structure, Template, or ADT key and need to answer the practical question: which Pages use it?
ldev portal inventory where-used --type fragment --key card-hero --site /guest
ldev portal inventory where-used --type widget --key com_liferay_journal_content_web_portlet_JournalContentPortlet --site /guest
ldev portal inventory where-used --type structure --key BASIC --site /facultat-farmacia-alimentacio
ldev portal inventory where-used --type adt --key UB_ADT_STUDIES_SEARCH --site /global
ldev portal inventory where-used --type template --key NEWS_TEMPLATE --site /global --include-private --jsonUse where-used after discovery has identified the resource you care about. It scans candidate Pages, extracts normalized Page evidence, and returns only the Pages whose evidence matches the requested resource.
Prefer --site whenever you already know the owning Site. Without it, where-used scans every accessible Site and can take much longer.
Options:
--type <fragment|widget|structure|template|adt>— resource type to trace--key <value>— resource key to look up; repeatable--site <friendlyUrl>— limit the scan to one Site instead of all accessible Sites--widget-type <value>— required when an ADT key is ambiguous across widget types--class-name <value>— optional ADT disambiguator for the owning class--include-private— include private layouts in addition to public Pages--max-depth <n>— recursion depth for page hierarchy scans--concurrency <n>— concurrent page inspections--page-size <n>— page size for candidate collection APIs
This is especially useful before changing a shared portal resource: it gives you read-before-write impact analysis without opening the UI or guessing where a resource might be referenced.
ldev portal audit
Minimal runtime audit of accessible site metadata and API reachability. Defaults to JSON.
ldev portal audit
ldev portal audit --site /global --page-size 200ldev portal config get|set
Inspect and update local Liferay config files (portal properties and OSGi PIDs).
ldev portal config get com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration
ldev portal config get companyDefaultLanguageId --source effective
ldev portal config set com.liferay.portal.search.... --key networkHostAddresses --value '["host:9200"]'--source defaults to source for set and effective for get.
ldev oauth install
Create or refresh the OAuth app used by ldev and optionally persist credentials locally.
ldev oauth install --write-env
ldev oauth install --write-env --scope-profile default
ldev oauth install --company-id 20097 --user-id 20130 --write-envUse this once after the portal is ready. The local credentials are written to .liferay-cli.local.yml. See OAuth for the full model, including scope profiles and manual remote setup.
ldev oauth admin-unblock
Clear the initial password-reset state for the selected admin user, so OAuth flows that create/update the OAuth app can succeed.
ldev oauth admin-unblock
ldev oauth admin-unblock --company-id 20097 --user-id 20130