Salesforce CLI Command Reference
Salesforce CLI is a powerful command-line interface that streamlines every stage of the Salesforce development lifecycle. From building Agentforce agents to creating and managing development orgs to deploying metadata and running tests, Salesforce CLI provides the essential tools developers need to build, test, and ship applications and agents efficiently. Whether you're working locally or integrating with CI/CD pipelines, Salesforce CLI enables automation and version control best practices for modern Salesforce development.
Key Features
  • Org Management and Authentication
    Create, authenticate, and manage multiple Salesforce orgs from the command line. Work seamlessly across scratch orgs, sandboxes, Dev Hubs, and production environments. Set default orgs, create aliases, and switch between environments with simple commands.
  • Metadata Deployment and Retrieval
    Deploy source code and metadata to orgs and retrieve changes back to your local project. Track changes with source tracking, deploy specific components or entire projects, and validate deployments before pushing to production. Full support for Metadata API and Source Tracking API ensures reliable, efficient deployments.
  • Developer Productivity and Automation
    Execute Apex code, run tests, query data, and debug issues without leaving your terminal. Generate boilerplate code, scaffold projects, and integrate Salesforce CLI commands into scripts and CI/CD pipelines. Extensible plugin architecture allows you to customize and extend functionality to match your team's workflow.
  • Agentforce Agent Development
    Build, test, and publish Agentforce agents. Preview agents by having natural conversations, either simulated or live, and examine detailed trace information about each response. Integrate agent development into your automated workflows.