# Dx Org Trial Expiration Check

Check when Salesforce orgs expire (or already expired) and what to do about it, for one...

- Repository: https://github.com/forcedotcom/sf-skills (1134 stars)
- Category: DevOps
- License: Apache-2.0
- Last updated: 2026-10-30
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add forcedotcom/sf-skills --skill dx-org-trial-expiration-check -g -a claude-code -y`
Codex: `npx skills add forcedotcom/sf-skills --skill dx-org-trial-expiration-check -g -a codex -y`
Cursor: `npx skills add forcedotcom/sf-skills --skill dx-org-trial-expiration-check -g -a cursor -y`
Gemini CLI: `npx skills add forcedotcom/sf-skills --skill dx-org-trial-expiration-check -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add forcedotcom/sf-skills`

## Description

Check when Salesforce orgs expire (or already expired) and what to do about it, for one org, the default org, or across all authenticated orgs, using the Salesforce CLI (sf). Use when the user asks about org or trial expiration, \"when does my trial expire\", \"is my trial org still active\", \"how many days are left\", \"which orgs are expiring soon\", wants to filter orgs expiring within N days, needs machine-readable (JSON/CSV) output for cron or alerting, wants to back up an at-risk org before it lapses, or asks how to extend or renew an expiring trial or Developer Edition org. Covers trial editions, Developer Edition orgs (anything with a TrialExpirationDate), and scratch orgs (via sf org list). DO NOT TRIGGER for sandbox refresh timing, for creating, deleting, or switching the active org, or for non-Salesforce trials such as AWS, Netflix, or other vendors, this skill reads expiration and prints guidance, it does not modify orgs.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Org Expiration Check

Determine when a Salesforce org expires, how many days remain, and whether it
has already expired, for one org, the default org, or every authenticated org.
Results are **prioritized** (already-expired and soonest-expiring first) with a
one-line summary. The skill can also emit machine-readable output for alerting,
print **backup** commands for an at-risk org, and explain how to **renew** an
expiring trial or Developer Edition org.

## When to use

Trigger on requests like:

- "When does my trial org expire?" / "Is it still active or has it expired?"
- "How many days are left on my trial?"
- "Which of my orgs are expiring soon?" / "expiring within 30 days?"
- "Alert me / set up a cron job for expiring orgs" (use `--json` + `--fail-if-expiring`).
- "Back up my org before it expires" (use `--preserve`).
- "How do I extend / renew my trial (or Developer Edition) org?" (use `--renew`).

This skill covers **trial editions, Developer Edition orgs** (anything with a
`TrialExpirationDate`), and **scratch orgs** (via the `expirationDate` from
`sf org list`).

## When NOT to use

Do **not** trigger this skill for:

- **Sandbox refresh timing**, that is not an expiration date.
- **Creating, deleting, or switching orgs**, this skill only *reads*
  expiration and *prints* guidance; it never creates, deletes, refreshes, or
  changes the active/default org. (To switch the default org, use
  `dx-org-switch`.)
- **Non-Salesforce trials**, e.g. AWS free tier, Netflix, or any other
  vendor's trial. This skill is Salesforce-only.

## How expiration is determined

- **Trial / Developer Edition orgs:** the authoritative source is the org's
  `Organization.TrialExpirationDate` field, read via SOQL (`sf data query`).
  This field is `null` for paid/production orgs, which therefore report **no
  trial expiration**, that is expected, not an error.
- **Scratch orgs:** the `expirationDate` reported by `sf org list` (no SOQL
  query is issued for scratch orgs).

The rest: https://github.com/forcedotcom/sf-skills/blob/HEAD/plugins/builder/dx-org-lifecycle/skills/dx-org-trial-expiration-check/SKILL.md
