sf-cli-operations

Operates Salesforce CLI v2 commands, JSON output parsing, and CI authorization for Salesforce projects.

2|Updated Sep 12, 2026
One-click install
npx skills add https://github.com/grzmol/vibe-force --skill sf-cli-operations-grzmol
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sf-cli-operations
Source: https://github.com/grzmol/vibe-force/tree/main/skills/sf-cli-operations
Command: npx skills add https://github.com/grzmol/vibe-force --skill sf-cli-operations-grzmol

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing and debugging Salesforce CLI v2 (sf) commands is error-prone: retired sfdx force:* syntax, ambiguous org resolution, unparsable human output, and CI authorization failures routinely break pipelines. This Skill provides the deterministic command knowledge needed to run sf correctly in scripts, hooks, and CI gates. ## Core Features & Use Cases - Complete topic and flag reference: Covers sf org, sf project, sf apex, sf data, sf package, sf schema, sf config, sf alias, sf plugins, and sf code-analyzer, plus global flags like --json, --target-org, and --api-version. - Non-interactive CI authorization: Documents JWT bearer and sfdx-url login flows, connected app setup, and hardened environment variables for GitHub Actions, Jenkins, and CircleCI. - JSON automation recipes: Provides jq extraction patterns for org display, project deploy, apex run test, and data query payloads, plus exit-code semantics for gate scripting. - Use Case: A CI pipeline fails with expired access/refresh token during deployment. Use this Skill to diagnose the auth failure, reauthorize with sf org login jwt, and add --target-org plus --json guards so the deploy gate fails deterministically instead of silently targeting the wrong org. ## Quick Start Ask the assistant to write a CI script that authorizes a Salesforce org with JWT and validates a deployment using sf project deploy validate with JSON output parsing.

Frequently Asked Questions about sf-cli-operations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I authorize a Salesforce org from CI without a browser?

Use sf org login jwt with a connected app, private key file, and username, or sf org login sfdx-url with a captured authorization URL. JWT suits long-lived pipelines; sfdx-url works for short-lived jobs using a stored refresh token.

How to parse Salesforce CLI output in shell scripts?

Always pass --json and parse with jq; the envelope contains status, result, and warnings fields. Never grep human-readable tables, since Salesforce only guarantees additive changes to JSON shapes, not text output.

What is the difference between sfdx and sf commands?

sfdx is now an alias of sf v2, and retired force:* commands like force:source:deploy map to sf project deploy start. New scripts must use the sf topic names; the old syntax no longer exists in v2.

Why does sf org login fail in CI with a keychain error?

Headless Linux and macOS runners lack an OS keychain, so auth file encryption fails with a secret-service error. Export SF_USE_GENERIC_UNIX_KEYCHAIN=true in the CI image to store the key in ~/.sfdx/key.json instead.

Why does my sf command deploy to the wrong org?

A leftover target-org config or SF_TARGET_ORG variable overrides your intended org. Always pass --target-org explicitly on every command and verify resolution with sf config list before running deploys.

How do I fix a missing sf code-analyzer command?

sf code-analyzer ships as a just-in-time plugin that installs on first use. Pre-install it in CI images with sf plugins install @salesforce/plugin-code-analyzer to avoid npm latency and network failures during gate jobs.