Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Local Project entry
How-to guide

Create and work with a Local Project

The basic workflow: generate the project, authenticate orgs, retrieve or deploy metadata, commit to git, iterate.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 21, 2026

The basic workflow: generate the project, authenticate orgs, retrieve or deploy metadata, commit to git, iterate.

  1. Generate the project

    Run sf project generate -n my-project. The CLI creates the folder structure with sfdx-project.json and the force-app directory.

  2. Authenticate against an org

    Run sf org login web -a my-org-alias. The browser opens; complete the OAuth handshake. The org token is stored locally.

  3. Set the default org

    Run sf config set target-org=my-org-alias. Subsequent commands default to this org without needing the -o flag.

  4. Retrieve metadata

    Run sf project retrieve start to pull metadata from the org into the Local Project. Pick specific metadata types via the -m flag.

  5. Open in VS Code

    Open the project folder in VS Code with the Salesforce Extensions Pack installed. The IDE recognizes the SFDX structure automatically.

  6. Edit, commit, deploy

    Edit source files; commit changes via git; deploy with sf project deploy start. Iterate.

Mandatory fields
sfdx-project.jsonrequired

The root manifest declaring project structure.

Package directoryrequired

Typically force-app, holding all metadata source files.

Salesforce CLIrequired

The command-line tool that operates against the project.

Authenticated orgrequired

An org alias the CLI can deploy to.

Git repository (recommended)required

Version control for the Local Project.

Gotchas
  • Legacy Metadata API-format projects do not work with modern SFDX commands without conversion. Use sf project convert source to migrate.
  • Source tracking is available only on scratch orgs and developer sandboxes. Production deployments need explicit manifest-based deploys.
  • Salesforce CLI authentication is local. Loss of the developer machine means re-authenticating; tokens cannot be recovered remotely.
  • The Salesforce CLI evolves quickly. Stay on the latest version to access new commands and bug fixes.

See the full Local Project entry

Local Project includes the definition, worked example, deep dive, related terms, and a quiz.