Skip to content

feat(cli,api): difyctl version probes server and reports compat verdict#36356

Open
lin-snow wants to merge 1 commit into
langgenius:feat/clifrom
lin-snow:feat/cli-version
Open

feat(cli,api): difyctl version probes server and reports compat verdict#36356
lin-snow wants to merge 1 commit into
langgenius:feat/clifrom
lin-snow:feat/cli-version

Conversation

@lin-snow
Copy link
Copy Markdown
Contributor

@lin-snow lin-snow commented May 18, 2026

Summary

  • New GET /openapi/v1/_version meta endpoint (no auth, mirrors _health) exposes server version + edition so the CLI can probe compatibility without a session.
  • difyctl version becomes a kubectl-style three-block report (client / server / compat). New flags: -o text|json|yaml, --client to skip the probe, --short for scripting, --check-compat exits 64 when status ≠ compatible.
  • resolveBuildInfo now also falls back to package.json#difyctl.compat, so pnpm dev / pnpm build / pnpm test all carry a real compat range without depending on release-pipeline env vars.

Probe degrades gracefully: server unreachable → (unreachable), compat verdict unknown. Default exit code stays 0 unless --check-compat is passed.

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

Adds GET /openapi/v1/_version (no auth, mirrors _health) and reshapes
difyctl version into a kubectl-style three-block report (client / server /
compat) with -o text|json|yaml, --client to skip the probe, --short for
scripting, and --check-compat to exit 64 when status != compatible.

resolveBuildInfo now also falls back to package.json#difyctl.compat so
pnpm dev/build/test all carry a real compat range without needing the
release pipeline env vars.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lin-snow lin-snow requested review from a team, QuantumGhost and laipz8200 as code owners May 18, 2026 15:29
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. javascript Pull requests that update javascript code labels May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 0.00% 43.73% +43.73%
Strict coverage 0.00% 43.26% +43.26%
Typed symbols 0 22,545 +22,545
Untyped symbols 0 29,329 +29,329
Modules 0 2642 +2,642

@lin-snow lin-snow self-assigned this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant