reqsync supports direct Python embedding, CLI automation, and a built-in MCP server for local AI model clients.
from reqsync.api import run_sync_payload
payload = {
"path": "requirements.txt",
"dry_run": True,
"no_upgrade": True,
"show_diff": True,
"policy": "lower-bound",
}
result = run_sync_payload(payload)
print(result["changed"])Returned keys:
changed: boolfiles: list[{file, role, changed, change_count}]changes: list[{file, package, installed_version, old_line, new_line}]backup_paths: list[str]diff: str | null
reqsync run --no-upgrade --dry-run --json-report .artifacts/reqsync.json --show-diff# stdio transport (default)
reqsync mcp
# alternate transport
reqsync mcp --transport ssereqsync_sync- Input params:
path,dry_run,check,show_diff,no_upgrade,policy,follow_includes,update_constraints,allow_prerelease,keep_local,allow_hashes,system_ok,allow_dirty,pip_args,pip_timeout_sec - Return shape:
{ "ok": bool, "exit_code": int, "error": str|null, "result": JsonResult|null }
- Input params:
reqsync run --check --no-upgrade --path requirements.txtruff check .ruff format --check .mypy src/reqsyncpytest -qpython -m buildpython -m twine check dist/*
- Prefer
--no-upgradein CI for deterministic speed. - Use
--stdout-jsonor--json-reportfor agent orchestration. - Keep
--allow-hashesdisabled unless you intentionally want hash lines skipped.