Salesforce DX projects — sfdx-project.json, source vs metadata format, folders and suffixes, .forceignore, manifests, API version precedence, project templates including agent

How a Salesforce DX project is laid out and how the CLI decides what to deploy — the sfdx-project.json the CLI generates (packageDirectories, namespace, sfdcLoginUrl, sourceApiVersion), source format vs metadata (MDAPI) format and converting between them, how folders and file suffixes map to metadata types, .forceignore, generating package.xml, which API version a deploy uses, and the standard and agent project templates.

markdownreferencev13BCQ-VCP5stage: buildtrust: officialservice: dxinterface: clisfdx-project.jsonpackageDirectoriessourceApiVersionsfdcLoginUrlnamespacesource formatmetadata formatMDAPI formatsf project convert sourcesf project convert mdapiforce-app/main/default-meta.xmlmetadata registry folders suffixesdecomposed Bot BotVersionbundle types.forceignorepackage.xml manifestsf project generate manifest--from-orgsf project generate --template agentsf project generate --template standardAPI version precedence--api-version deploysourceApiVersion 67.0 CLI defaultsource-deploy-retrieve

Created 23 Oct 2026 · Modified 23 Oct 2026 · 1 version

Salesforce DX projects

The project file

sf project generate --name demo --template standard writes this sfdx-project.json (CLI 2.155.7):

{
  "packageDirectories": [{ "path": "force-app", "default": true }],
  "name": "demo",
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "67.0"
}
  • packageDirectories: where source lives. More than one is allowed; Coral Cloud splits its app into cc-base-app, cc-employee-app and cc-service-app. Exactly one is default.
  • sourceApiVersion: the metadata shape your files are written in. The CLI generated 67.0 even though Salesforce's docs list Winter '27 as 68.0: set it deliberately (reference/orgs/orgs-and-editions.md).
  • --template agent creates an Agentforce DX starter project (guides/agentforce/build-agent-with-agentforce-dx.md). It includes an Agent Script authoring bundle, Apex and flow actions, a prompt template, permission sets and permission set groups, and a scratch definition.

Source format vs metadata format

Source format (what you commit)Metadata format (what the Metadata API deploys)
Layoutforce-app/main/default/<folder>/<Name>.<suffix>-meta.xml, large types split upOne file per component plus package.xml
Examplebots/Agent/Agent.bot-meta.xml plus bots/Agent/v1.botVersion-meta.xmlbots/Agent.bot holding every version
Convertsf project convert source --source-dir force-app --output-dir mdapi-outsf project convert mdapi --root-dir mdapi-out --output-dir force-app

The CLI maps folders and suffixes to types through Salesforce's metadata registry. Three strategies matter for agents:

StrategyMeaningExamples
PlainOne <Name>.<suffix>-meta.xml filegenAiPlugins/X.genAiPlugin-meta.xml, genAiPromptTemplates/X.genAiPromptTemplate-meta.xml, flows/X.flow-meta.xml
DecomposedOne parent file plus child files in a folderBot → bots/<Agent>/<Agent>.bot-meta.xml + v1.botVersion-meta.xml
BundleA folder that deploys as one componentaiAuthoringBundles/<Agent>/ (<Agent>.agent + <Agent>.bundle-meta.xml); genAiFunctions/<Action>/ (meta file + input/schema.json + output/schema.json); genAiPlannerBundles/<Agent>/
Matching contentCode plus a meta fileclasses/X.cls + X.cls-meta.xml

The full list of Agentforce types: reference/dx/agentforce-metadata-types.md.

Ignoring and listing

  • .forceignore keeps files out of deploys and retrieves, with the same syntax as .gitignore. The generated one ignores package.xml, LWC config files, **/__tests__/** and node_modules/.
  • sf project generate manifest --source-dir force-app --name package writes a package.xml from your source. --from-org <alias> lists everything in an org instead.

Which API version a deploy uses

sf project deploy start --api-version <v> overrides the default, which per the CLI's help is "the latest version supported by the CLI". sourceApiVersion says which shape the files are in. The hub's reading: keep sourceApiVersion at or below the target org's maximum, and pass --api-version when an org is a release behind, as sandboxes are during preview windows.

Read this document as markdown — the same bytes an agent receives.