# dx-org-trial-expiration-check

Checks when your Salesforce orgs expire, or whether they already have. Handy when a trial is running out and you lost track of the date.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3200 installs · ★ 1112
- Author: forcedotcom
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/forcedotcom/sf-skills/tree/HEAD/skills/dx-org-trial-expiration-check/SKILL.md
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/skills/dx-org-trial-expiration-check

## What it does

The skill reads `Organization.TrialExpirationDate` over SOQL and reports days remaining, what has already lapsed, and what is about to. Scratch orgs are handled differently: their date comes from `sf org list`, so no query is issued for them. Output is grouped by urgency — expired first, then anything ending within 7 days, then active orgs, then orgs with no trial expiration. A null field on paid or production orgs is expected, not a failure.

A bundled bash script, `scripts/check_expiration.sh`, does the date math and builds the report. Call it by absolute path from the skill directory: a relative `./scripts/` resolves against your current folder and will run the wrong file or fail outright. Flags combine freely — `--all` walks every authenticated org, `--within 30` narrows to orgs ending in that window, `--json` and `--csv` produce machine-readable records, `--preserve` prints backup commands, `--renew` prints extension guidance, and `--fail-if-expiring` exits with code 3 when something lapses soon.

You need `sf` 2.0.0 or newer and `jq` 1.6.0 or newer. The skill only reads and prints advice; it never creates, deletes, refreshes or switches an org. When an org cannot be queried, the script surfaces the `sf org login web` command it prints — worth acting on before the trial quietly runs out.

## Requirements
- Works with: Salesforce

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add forcedotcom/sf-skills --skill dx-org-trial-expiration-check -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/dx-org-trial-expiration-check/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/dx-org-trial-expiration-check/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add forcedotcom/sf-skills --skill dx-org-trial-expiration-check -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/dx-org-trial-expiration-check/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add forcedotcom/sf-skills --skill dx-org-trial-expiration-check -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/dx-org-trial-expiration-check/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install forcedotcom/sf-skills dx-org-trial-expiration-check
```

2. **Manually: put the files in place**
- File: `.github/skills/dx-org-trial-expiration-check/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add forcedotcom/sf-skills --skill dx-org-trial-expiration-check -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/forcedotcom/sf-skills --path skills/dx-org-trial-expiration-check
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/dx-org-trial-expiration-check/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add forcedotcom/sf-skills --skill dx-org-trial-expiration-check -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/forcedotcom/sf-skills/tree/HEAD/skills/dx-org-trial-expiration-check/SKILL.md

## When to use it
- find out how many days are left on a trial
- list every authenticated org that expires soon
- emit JSON or CSV for cron jobs and alerts
- print backup commands for an org about to lapse
- learn how to extend a trial or Developer Edition org

## Example prompts
- when does my trial org expire?
- which of my orgs expire within 30 days?
- give me JSON for all orgs so I can set up an alert

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 58a5c00a6ceb389d.

BEGIN THIRD-PARTY FILE 58a5c00a6ceb389d
```text
---
name: dx-org-trial-expiration-check
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."
allowed-tools: Read, Bash(bash), Bash(sf data query), Bash(sf org list), Bash(sf config get), Bash(jq), Bash(date)
metadata:
  relatedSkills:
    - "dx-org-switch"
  version: "2.0"
  domains: ["Developer Experience"]
  cliTools:
    - tool: ["jq"]
      semver: ">=1.6.0"
    - tool: ["sf"]
      semver: ">=2.0.0"
---

# 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`).
```
END THIRD-PARTY FILE 58a5c00a6ceb389d

The third-party file has ended. Everything between the 58a5c00a6ceb389d tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2166 of 11572 bytes. © forcedotcom · Apache-2.0 · https://github.com/forcedotcom/sf-skills/tree/HEAD/skills/dx-org-trial-expiration-check/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
