{"record":{"id":"024de425d91a7835","repo":"astral-sh/uv","slug":"pip-sync-s-ask-is-unsupported-uv-never-asks-f","errorCode":null,"errorMessage":"pip-sync's `--ask` is unsupported (uv never asks for confirmation)","messagePattern":"pip-sync's `--ask` is unsupported \\(uv never asks for confirmation\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/uv-cli/src/compat.rs","lineNumber":213,"sourceCode":"    #[clap(long, hide = true)]\n    config: Option<String>,\n\n    #[clap(long, hide = true)]\n    no_config: bool,\n\n    #[clap(long, hide = true)]\n    pip_args: Option<String>,\n}\n\nimpl CompatArgs for PipSyncCompatArgs {\n    /// Validate the arguments passed for `pip-sync` compatibility.\n    ///\n    /// This method will warn when an argument is passed that has no effect but matches uv's\n    /// behavior. If an argument is passed that does _not_ match uv's behavior, this method will\n    /// return an error.\n    fn validate(&self) -> Result<()> {\n        if self.ask {\n            return Err(anyhow!(\n                \"pip-sync's `--ask` is unsupported (uv never asks for confirmation)\"\n            ));\n        }\n\n        if self.python_executable.is_some() {\n            return Err(anyhow!(\n                \"pip-sync's `--python-executable` is unsupported (to install into a separate Python environment, try setting `VIRTUAL_ENV` instead)\"\n            ));\n        }\n\n        if self.user {\n            return Err(anyhow!(\n                \"pip-sync's `--user` is unsupported (use a virtual environment instead)\"\n            ));\n        }\n\n        if self.client_cert.is_some() {\n            return Err(anyhow!(","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv-cli/src/compat.rs#L195-L231","documentation":"pip-sync's `--ask` prompts for confirmation before it installs/uninstalls to make the environment match the requirements file. uv never asks for confirmation (its sync commands apply changes immediately), so `PipSyncCompatArgs::validate()` rejects the flag instead of silently not prompting — a silent no-op would be dangerous, since you would expect a safety gate that never fires.","triggerScenarios":"`uv pip sync --ask requirements.txt`, typically in a script or alias ported from pip-tools' pip-sync.","commonSituations":"Operators who used `pip-sync --ask` as a guardrail against destructive syncs; wrapper scripts that pass the same flags to both pip-sync and uv; Makefile targets that prompt in interactive use.","solutions":["Remove `--ask` and run `uv pip sync` only after reviewing the plan (or use `--dry-run` to preview changes).","If you need a human gate, add your own confirmation step in the surrounding script before invoking uv.","Consider `uv pip sync --dry-run` in CI to see what would change without applying it."],"exampleFix":"# before\nuv pip sync --ask requirements.txt\n\n# after\nuv pip sync --dry-run requirements.txt  # review\nuv pip sync requirements.txt             # apply","handlingStrategy":"validation","validationCode":"def check_sync_safety_flags(argv: list[str]) -> None:\n    if \"--ask\" in argv:\n        raise ValueError(\"uv pip sync never prompts; use --dry-run to preview changes\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use `uv pip sync --dry-run` as the review step in pipelines that used `pip-sync --ask`.","Wrap destructive syncs in your own confirmation in the calling script.","Run syncs only in disposable environments (CI, containers) so no gate is needed."],"tags":["cli","pip-tools","compatibility","sync","confirmation"],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}