Agent skill

Dx Org Trial Expiration Check

by forcedotcom in forcedotcom/sf-skills

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).

Apache-2.0Auto-check passedSales & Support

Install Dx Org Trial Expiration Check

skills CLI
$ npx skills add forcedotcom/sf-skills --skill dx-org-trial-expiration-check -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install forcedotcom/sf-skills dx-org-trial-expiration-check --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/forcedotcom/sf-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/dx-org-trial-expiration-check .claude/skills/dx-org-trial-expiration-check && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dx-org-trial-expiration-check
GitHub stars
1.1k
Token cost
~2.9k tokens
SKILL.md length
1,157 words
Files
2 (incl. scripts)
Skills in repo
252
Repo updated
First seen
Licence
Apache-2.0

At a glance

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).

  • Works in 2 steps: CRITICAL: Run the bundled helper script,… → Relay the script output to the user.…
  • The user asks about org
  • SKILL.md covers When to use, When NOT to use, How expiration is determined and Steps, plus 9 more sections
  • Runs Shell scripts from its folder; calls sf and bash; reaches test.salesforce.com

What it does

Dx Org Trial Expiration Check is an agent skill from forcedotcom/sf-skills. 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…

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/check_expiration.sh`).

It sits in Sales & Support, covering CRM management, Scheduled and recurring tasks and CSV and tabular files. It works with Salesforce and Amazon Web Services. The repository describes itself as: Salesforce's curated collection of agent skills for building applications. Optimized for Agentforce Vibes, compatible with all AI tools. The licence is Apache-2.0.

When your agent uses it

  • The user asks about org
  • Trial expiration
  • Does my trial expire
  • Is my trial org still active

Example prompts

  • “when does my trial expire”
  • “is my trial org still active”
  • “how many days are left”
  • “/dx-org-trial-expiration-check”

Requirements

  • A Bash shell
  • Pre-approved tools (allowed-tools): Read, Bash(bash), Bash(sf data query), Bash(sf org list), Bash(sf config get), Bash(jq), Bash(date)

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. CRITICAL: Run the bundled helper script, which handles date math (days
  2. Relay the script output to the user. When an org could not be queried,

What it can do on your machine

Read from SKILL.md and the folder at commit 4bbae5c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Bash(bash)
    • Bash(sf data query)
    • Bash(sf org list)
    • Bash(sf config get)
    • Bash(jq)
    • Bash(date)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • sf
    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • test.salesforce.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dx Org Trial Expiration Check loads about 2.9k tokens when it runs. Until then it costs about 243 tokens; SKILL.md has 1,157 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~243
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from forcedotcom/sf-skills at commit 4bbae5c, republished under its Apache-2.0 licence (© forcedotcom). 1,157 words, ~2,884 tokens.

Download SKILL.mdSave it as .claude/skills/dx-org-trial-expiration-check/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
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
metadata.version
2.0
metadata.domains
Developer Experience

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).

Steps

  1. CRITICAL: Run the bundled helper script, which handles date math (days remaining, expired, expiring-soon warnings), prioritized sorting, and structured output, and works on macOS and Linux. Always invoke it by absolute path from the skill directory — never ./scripts/, which resolves against the user's current directory and will either run the wrong script or fail.

    Before executing, verify:

    • <skill_dir> is an absolute path (starts with /), not a relative path
    • The path points at this skill's own directory (the one containing this SKILL.md)
    bash
    bash "<skill_dir>/scripts/check_expiration.sh" <alias-or-username>   # one org
    bash "<skill_dir>/scripts/check_expiration.sh"                       # default org (target-org config)
    bash "<skill_dir>/scripts/check_expiration.sh" --all                 # every authenticated org
    bash "<skill_dir>/scripts/check_expiration.sh" --all --within 30     # only orgs expiring within 30 days

    <skill_dir> is the absolute path to the directory containing this SKILL.md.

  2. Relay the script output to the user. When an org could not be queried, surface the sf org login web command the script prints so the user can authenticate. Pick optional flags based on what the user asked for (see below): --preserve when they want to save their work, --renew when they ask how to extend, --json/--csv for automation, --fail-if-expiring for a cron/CI gate.

Options

FlagPurpose
--all, -aCheck every authenticated org.
--within <days>, -wShow only orgs expiring within N days (includes already-expired; omits paid/production). --within=30 also works.
--jsonEmit a JSON array of org records (data only).
--csvEmit CSV rows (data only).
--preservePrint backup commands for expiring/expired orgs.
--renewPrint trial/DE extension & reactivation guidance.
--fail-if-expiring[=N]Exit 3 if any org expires within N days (default 7).
--no-scratchExclude scratch orgs (trial/DE only).
--help, -hShow usage.

Flag order is flexible and flags combine (e.g. --all --within 30 --json).

Prioritized output

Human output is grouped by urgency — Expired first, then Expiring soon (within 7 days, flagged Warning), then Active, then No trial expiration, then any orgs that could not be queried — and ends with a one-line summary:

text
Org expiration status for all authenticated orgs:

Expired:
  old-trial                       trial/DE edition expired 2026-06-20  (EXPIRED 19 day(s) ago)

Expiring soon (within 7 day(s)):
  almost-up                       trial/DE edition expires 2026-07-14  (expires in 5 day(s)  Warning)

Active (not expiring soon):
  acme-trial                      trial/DE edition expires 2026-08-15  (expires in 37 day(s))
  my-scratch                      scratch org expires 2026-07-25  (expires in 16 day(s))

No trial expiration (paid/production):
  prod                            no trial expiration (paid/production org)

Summary: 1 expired, 1 expiring within 7 day(s), 2 active, 1 with no expiration.

Structured output for alerting and cron (--json / --csv)

For dashboards, spreadsheets, or scheduled jobs, use --json or --csv to get machine-readable records (no prose). Each record has org, kind, expirationDate, daysRemaining (negative = expired, null = no expiration), status, and orgId. This is deterministic and needs no LLM in the loop.

bash
# JSON, filtered to orgs expiring within 30 days:
bash "<skill_dir>/scripts/check_expiration.sh" --all --within 30 --json

Cron watchdog — --fail-if-expiring[=N] exits 3 (and prints an ALERT: line to stderr) if any org expires within N days (default 7), so a scheduled job can page you before an org lapses:

bash
# crontab: every morning at 9, alert if anything expires within 7 days
0 9 * * *  bash "<skill_dir>/scripts/check_expiration.sh" --all --fail-if-expiring 7 \
             || mail -s "Salesforce org expiring soon" me@example.com

Preserve your work before an org lapses (--preserve)

When an org expires you lose access to its metadata and data. --preserve prints ready-to-run backup commands (metadata manifest + retrieve, and a bulk data export) for each expiring or already-expired org. It only prints the commands — review and run them yourself:

bash
bash "<skill_dir>/scripts/check_expiration.sh" my-trial --preserve
Show full SKILL.md (453 more words)Show less

Extend or renew a trial / Developer Edition org (--renew)

--renew prints the current guidance for keeping an org alive, and surfaces the Org IDs of at-risk orgs so the steps are actionable:

  • Partners: request a Trial Org extension (up to +12 months) via partners.salesforce.com → Ask Agentforce → "I want to extend my Trial Org", providing the Org ID. Eligible while active or expired < 30 days; not for LDV orgs. (Salesforce Help article 000387818.)
  • Nonprofits: email your Account Executive with subject "Trial Extension" and the trial-starter email, Org ID, and username; AMER the Power of Us Desk, other regions My Account support / 1-800-NO-SOFTWARE. Works even if already expired. (Article 004754220.)
  • Developer Edition: DE orgs have no subscription clock but are deactivated after prolonged inactivity (~180 days without a login); log in periodically. If locked (not yet deleted), open a Salesforce Customer Support case to reactivate — once permanently deleted, an org cannot be recovered.
  • To keep a standard trial's data/config, convert/subscribe to a paid edition before it lapses.

Exit codes

  • 0 success
  • 1 an org could not be queried (auth/connection error)
  • 2 bad usage or a missing dependency (sf or jq)
  • 3 --fail-if-expiring threshold breached (at least one org expiring)

When both apply, a --fail-if-expiring breach (3) takes precedence over an auth error (1): the alerting signal wins so a watchdog still fires. If your job must also detect unreachable orgs, run --json and inspect the records for status: "auth_error" in addition to checking the exit code. Note that an org whose credentials fail cannot be date-checked, so it never counts toward a --fail-if-expiring breach on its own.

--fail-if-expiring with no explicit number treats a following all-numeric argument as the day count (e.g. --fail-if-expiring 12345). In the rare case an org's alias is purely numeric, pass the org first (check_expiration.sh 12345 --fail-if-expiring 7) so it isn't mistaken for the threshold.

Authentication

If an org isn't authenticated (no saved credentials, or an expired/revoked token), the script does not fail silently — it prints the exact command to log in and then re-run:

text
  my-trial                       not authenticated — no saved credentials for this org

  To authenticate, run one of:
    sf org login web --alias "my-trial"
    sf org login web --alias <my-alias> --instance-url https://test.salesforce.com
  Then re-run this check. List existing logins with:  sf org list

sf org login web opens a browser to complete the OAuth flow. Use --instance-url https://test.salesforce.com for sandboxes, or a custom My Domain URL where applicable.

Manual fallback (if the script is unavailable)

bash
# Trial/DE expiration for one org (null = not a trial / paid org):
sf data query --query "SELECT Id, TrialExpirationDate FROM Organization" --target-org <org> --json

# Scratch org expiration comes from the org list, not SOQL:
sf org list --json

Notes

  • Requires the Salesforce CLI (sf) and jq on the PATH, plus at least one authenticated org (sf org login web).
  • Avoid launching many sf commands concurrently — the CLI can be slow under contention. The script queries orgs sequentially for this reason.
  • sf org list exposes a trailExpirationDate (note the typo) field that is often null; the script does not rely on it for trial/DE orgs — it uses the SOQL TrialExpirationDate, which is reliable. It does use expirationDate from the list for scratch orgs.

© forcedotcom, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in skills/dx-org-trial-expiration-check of forcedotcom/sf-skills.

  • SKILL.md
  • scripts/check_expiration.sh

Open the folder on GitHubat commit 4bbae5c

Compare with similar skills

Dx Org Trial Expiration Check next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dx Org Trial Expiration Check compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dx Org Trial Expiration Check this skillforcedotcom/sf-skills1.1k—~2.9kAutomated safety check: PassApache-2.0
Pipeline Reviewgooseworks-ai/goose-skills1.2k1 repos~6.9kAutomated safety check: PassMIT
Google Maps Exportgmapsscraper/google-maps-agent-skills132—~1.2kAutomated safety check: PassMIT
Sf ApexJaganpro/sf-skills424—~2kAutomated safety check: PassMIT
Salesforce Automationdavepoon/buildwithclaude3.6k7 repos~1.7kAutomated safety check: PassMIT
Sf DebugJaganpro/sf-skills424—~1.3kAutomated safety check: PassMIT

Similar skills

  • Pipeline Review

    gooseworks-ai/goose-skills

    Pipeline analysis composite. An agent skill from gooseworks-ai/goose-skills.

    1.2k GitHub starsUsed in 1 repo~6.9k tokens
    Sales & SupportAuto-check passed
  • Google Maps Export

    gmapsscraper/google-maps-agent-skills

    Export Google Maps business data to CSV, JSON, or CRM format (HubSpot, Pipedrive, Salesforce).

    132 GitHub stars~1.2k tokensUpdated 4 mo ago
    Sales & SupportAuto-check passed
  • Sf Apex

    Jaganpro/sf-skills

    Generates and reviews Salesforce Apex code with 150-point scoring.

    424 GitHub stars~2k tokensUpdated 5 mo ago
    Sales & SupportAuto-check passed
  • Salesforce Automation

    davepoon/buildwithclaude

    Automate Salesforce tasks via Rube MCP (Composio): leads, contacts, accounts, opportunities, SOQL queries.

    3.6k GitHub starsUsed in 7 repos~1.7k tokens
    Sales & SupportAuto-check passed
  • Sf Debug

    Jaganpro/sf-skills

    Salesforce debug log analysis and troubleshooting with 100-point scoring.

    424 GitHub stars~1.3k tokensUpdated 5 mo ago
    Sales & SupportAuto-check passed
  • Integrations

    butterbase-ai/butterbase-skills

    Use BEFORE recommending or installing any third-party SaaS SDK for email (Resend, SendGrid, Postmark, Mailgun), SMS (Twilio), messaging (Slack), calendar (Google Calendar), CRM (HubSpot…

    534 GitHub stars~832 tokensUpdated 6 days ago
    Sales & SupportAuto-check passed

More from forcedotcom/sf-skills

All 252 skills in this repo
  • Agentforce Architecture Analyze

    forcedotcom/sf-skills

    Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins.

    1.1k GitHub stars~4.5k tokensUpdated yesterday
    Auto-check passed
  • Agentforce D360 Analyze

    forcedotcom/sf-skills

    Data Cloud 360° view of a single Agentforce session. An agent skill from forcedotcom/sf-skills.

    1.1k GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.3k tokensUpdated yesterday
    Auto-check: notes
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.4k tokensUpdated yesterday
    Auto-check: notes
  • Design Systems Slds Apply

    forcedotcom/sf-skills

    Apply SLDS-compliant UI using the correct blueprints, styling hooks, utility classes, and icons.

    1.1k GitHub stars~3.7k tokensUpdated yesterday
    Auto-check passed
  • Experience Lwc Generate

    forcedotcom/sf-skills

    Lightning Web Components with PICKLES methodology and 165-point scoring.

    1.1k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed

Questions about Dx Org Trial Expiration Check

What does Dx Org Trial Expiration Check do?

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). Dx Org Trial Expiration Check is an agent skill from forcedotcom/sf-skills. 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).

When should I use Dx Org Trial Expiration Check?

Dx Org Trial Expiration Check fits situations like: the user asks about org; trial expiration; does my trial expire; is my trial org still active.

How do I install Dx Org Trial Expiration Check in Claude Code?

Run `npx skills add forcedotcom/sf-skills --skill dx-org-trial-expiration-check -a claude-code`. Or copy the skill folder (skills/dx-org-trial-expiration-check in forcedotcom/sf-skills) into .claude/skills/dx-org-trial-expiration-check in your project. Claude Code loads it when a task matches its description.

How do I install Dx Org Trial Expiration Check in Codex?

Run `npx skills add forcedotcom/sf-skills --skill dx-org-trial-expiration-check -a codex`. Or copy the skill folder (skills/dx-org-trial-expiration-check in forcedotcom/sf-skills) into .agents/skills/dx-org-trial-expiration-check in your project. Codex loads it when a task matches its description.

Can I use Dx Org Trial Expiration Check in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add forcedotcom/sf-skills --skill dx-org-trial-expiration-check -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dx-org-trial-expiration-check, .gemini/skills/dx-org-trial-expiration-check, .github/skills/dx-org-trial-expiration-check and .opencode/skills/dx-org-trial-expiration-check in your project.

What does Dx Org Trial Expiration Check need to run?

Going by SKILL.md and its folder, Dx Org Trial Expiration Check needs a shell for the scripts in its folder and the command-line tools its instructions call (sf and bash). Our summary lists: A Bash shell. Its frontmatter pre-approves these tools: Read, Bash(bash), Bash(sf data query), Bash(sf org list), Bash(sf config get), Bash(jq), Bash(date).

Does Dx Org Trial Expiration Check access the network?

SKILL.md names 1 domain. In commands or code: test.salesforce.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Dx Org Trial Expiration Check safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Dx Org Trial Expiration Check use?

Dx Org Trial Expiration Check is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dx Org Trial Expiration Check use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dx Org Trial Expiration Check?

Skills that share tags, products or a category with Dx Org Trial Expiration Check: Pipeline Review (gooseworks-ai/goose-skills, 1.2k stars), Google Maps Export (gmapsscraper/google-maps-agent-skills, 132 stars), Sf Apex (Jaganpro/sf-skills, 424 stars) and Salesforce Automation (davepoon/buildwithclaude, 3.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dx Org Trial Expiration Check?

forcedotcom (a GitHub organization) maintains it in forcedotcom/sf-skills, which has 1,067 GitHub stars. The repository holds 252 skills in this directory. The repository was last updated on October 9, 2026.

Source: forcedotcom/sf-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.