VS Code + SFDX
In order to configure Visual Studio Code and SFDX to work with the Copado CLI, you need the following elements:
- Visual Studio Code.
- Salesforce Extension Pack Extension.
- A Copado Git Repository record in DX source format.
- Make sure you have a .gitignore file in the root of your repository that contains the following folders/files (this is the .gitignore file that VS Code writes + Copado exclusions): .gitignore.
- Use Git to clone the repository to any folder:
- Go to VS Code, open the Command Palette and select SFDX: Create Project:
- Set the same name as the folder name created when the repository was cloned:
- Select the parent folder where the Git repository was cloned:
- VS Code will show a warning: “A folder with the specified project name already exists in the selected directory. Do you want to overwrite it?”. Accept this
- If you get this error “ERROR running force:project:create: A name parameter is required to create a storage”:
- Create a file in the same path as the project folder package.json.
- Add the following body and repeat step 5:
- VS Code will open a new window and will override some files, like the .gitignore file that was already configured in step 1. Right-click and discard the changes for the following files:
- README.md (if exists)
- Open the Command Palette and select SFDX Authorize an Org:
- Select your org type:
- Give a name to the developer org/sandbox :
- This will prompt you to the web authentication, use your credentials to log in.
- You can save the changes to the server by doing right click on the changed metadata and selecting SFDX Deploy Source to Org:
You are all set to start using the Copado CLI!