Reference patterns for running depfresh in CI and tool ecosystems.
Want a ready-made workflow instead of copy-paste therapy?
- GitHub Action -- Composite action for CI with structured JSON output and 4 workflow recipes.
- Repository workflow:
.github/workflows/dependency-freshness.yml
Looking for taze comparisons? Those live in docs/compare/.
Minimal workflow that runs depfresh in gate mode and uploads the JSON report as an artifact.
name: Dependency Freshness
on:
pull_request:
schedule:
- cron: '0 6 * * 1'
jobs:
depfresh:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- run: corepack enable
- run: pnpm install --frozen-lockfile
- run: npx depfresh --output json --fail-on-outdated > depfresh-report.json
- uses: actions/upload-artifact@v4
if: always()
with:
name: depfresh-report
path: depfresh-report.jsonExit handling:
0: up to date or successful writes1: outdated dependencies found with--fail-on-outdated2: fatal/config/runtime error
If you want depfresh exposed as a tool in an MCP server, keep the wrapper thin:
- Accept tool input (cwd, mode, write, failOnOutdated).
- Execute depfresh with
--output json. - Return parsed JSON directly to the MCP client.
- Preserve depfresh exit codes in tool errors/status.
Example wrapper command:
depfresh --output json --cwd /path/to/workspaceRecommended mapping:
- Tool success payload: full depfresh JSON envelope
- Tool warning state: exit code
1with parsed JSON attached - Tool error state: exit code
2with stderr/error message
For dynamic tool UIs, discover flags and enum values via:
depfresh --help-json