feat: add drift-cli package skeleton and core analysis commands (ADR-100 phase 5b-a)#717
Open
mick-gsk wants to merge 1 commit into
Open
feat: add drift-cli package skeleton and core analysis commands (ADR-100 phase 5b-a)#717mick-gsk wants to merge 1 commit into
mick-gsk wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Introduces a new drift-cli workspace package and ports core CLI commands into it as part of the ADR-100 monorepo migration decomposition.
Changes:
- Add
packages/drift-clipackage skeleton with Click command implementations (analyze/check/ci/status/scan/diff/brief/baseline/explain/start). - Add UV workspace configuration and wire workspace member dependencies into the root
pyproject.toml. - Add smoke tests to validate importing the extracted CLI module and legacy alias behavior.
Reviewed changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 32 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Adds workspace member deps + UV workspace configuration; adjusts project version. |
| packages/drift-cli/pyproject.toml | Defines the new drift-cli package metadata and workspace dependencies. |
| packages/drift-cli/src/drift_cli/cli.py | New top-level CLI group and subcommand registration / error handling. |
| packages/drift-cli/src/drift_cli/commands/* | New command implementations and shared CLI helpers (I/O, last-scan snapshot, filtering/output). |
| packages/drift-cli/tests/test_drift_cli_smoke.py | Smoke tests for module import and legacy alias mapping. |
| import click | ||
|
|
||
| from drift import __version__ | ||
| from drift.commands import console |
Comment on lines
+287
to
+331
| from drift.commands.adr_cmd import adr | ||
| from drift.commands.analyze import analyze | ||
| from drift.commands.badge import badge | ||
| from drift.commands.baseline import baseline | ||
| from drift.commands.brief import brief | ||
| from drift.commands.cache_cmd import cache | ||
| from drift.commands.calibrate import calibrate | ||
| from drift.commands.check import check | ||
| from drift.commands.ci import ci | ||
| from drift.commands.completions import completions | ||
| from drift.commands.config_cmd import config | ||
| from drift.commands.context_cmd import context | ||
| from drift.commands.copilot_context import copilot_context | ||
| from drift.commands.diff_cmd import diff | ||
| from drift.commands.explain import explain | ||
| from drift.commands.export_context import export_context | ||
| from drift.commands.feedback import feedback | ||
| from drift.commands.fix_plan import fix_plan | ||
| from drift.commands.generate_skills_cmd import generate_skills | ||
| from drift.commands.import_cmd import import_report | ||
| from drift.commands.init_cmd import init | ||
| from drift.commands.intent_cmd import intent | ||
| from drift.commands.kit_cmd import kit | ||
| from drift.commands.mcp import mcp | ||
| from drift.commands.patch_cmd import patch | ||
| from drift.commands.patterns import patterns | ||
| from drift.commands.precision_cmd import precision | ||
| from drift.commands.preset import preset | ||
| from drift.commands.roi_estimate import roi_estimate | ||
| from drift.commands.scan import scan | ||
| from drift.commands.self_analyze import self_analyze | ||
| from drift.commands.self_improve import self_improve | ||
| from drift.commands.serve import serve | ||
| from drift.commands.session_report import session_report | ||
| from drift.commands.setup import setup | ||
| from drift.commands.start import start | ||
| from drift.commands.status import status | ||
| from drift.commands.suppress import suppress | ||
| from drift.commands.synthesize_cmd import synthesize | ||
| from drift.commands.timeline import timeline | ||
| from drift.commands.trend import trend | ||
| from drift.commands.validate_cmd import validate | ||
| from drift.commands.verify import verify | ||
| from drift.commands.visualize import visualize | ||
| from drift.commands.watch import watch |
| [project] | ||
| name = "drift-analyzer" | ||
| version = "2.50.0" | ||
| version = "2.49.0" |
Comment on lines
65
to
75
| "pydantic>=2.0", | ||
| "gitpython>=3.1", | ||
| "networkx>=3.0", | ||
| "drift-config", | ||
| "drift-sdk", | ||
| "drift-engine", | ||
| "drift-output", | ||
| "drift-session", | ||
| "drift-mcp", | ||
| "drift-cli", | ||
| ] |
| first_run, | ||
| ) | ||
| click.echo(json.dumps(payload, ensure_ascii=False, indent=2)) | ||
| sys.exit(0) |
| "MAZ": { | ||
| "signal_type": "missing_authorization", | ||
| "name": "Missing Authorization", | ||
| "weight": "0.02", |
| "ISD": { | ||
| "signal_type": "insecure_default", | ||
| "name": "Insecure Default", | ||
| "weight": "0.01", |
| "HSC": { | ||
| "signal_type": "hardcoded_secret", | ||
| "name": "Hardcoded Secret", | ||
| "weight": "0.01", |
| "abbreviation": abbr, | ||
| "name": _SIGNAL_INFO[abbr]["name"], | ||
| "signal_type": _SIGNAL_INFO[abbr]["signal_type"], | ||
| "weight": _SIGNAL_INFO[abbr]["weight"], |
| "abbreviation": abbr, | ||
| "name": info["name"], | ||
| "signal_type": info["signal_type"], | ||
| "weight": info["weight"], |
| path=path, | ||
| signal_scope=signal_scope_label( | ||
| selected=resolve_signal_names(select_signals) if select_signals else None, | ||
| ignored=resolve_signal_names(ignore_signals) if ignore_signals else None, |
| context="diff", | ||
| path=target_path, | ||
| signal_scope=signal_scope_label( | ||
| selected=resolve_signal_names(select_signals) if select_signals else None, |
| path=target_path, | ||
| signal_scope=signal_scope_label( | ||
| selected=resolve_signal_names(select_signals) if select_signals else None, | ||
| ignored=resolve_signal_names(ignore_signals) if ignore_signals else None, |
| import click | ||
|
|
||
| from drift import __version__ | ||
| from drift.commands import console |
| import click | ||
|
|
||
| from drift.api_helpers import build_drift_score_scope | ||
| from drift_cli.commands import console, fail_glyph, ok_glyph |
| main.add_command(_plugin_cmd) | ||
| _plugin_logger.debug("Registered plugin command: %s", _plugin_cmd.name) | ||
| except Exception: # noqa: BLE001 | ||
| import logging as _logging |
| def configure_machine_output_console(output_format: str) -> None: | ||
| """Route the shared console to stderr for machine-readable formats.""" | ||
| if output_format != "rich": | ||
| import drift_cli.commands as _cmds |
|
|
||
| def build_effective_console(no_color: bool) -> Console: | ||
| """Create a console that respects --no-color and ASCII fallback needs.""" | ||
| import drift_cli.commands as _cmds |
| if output_format != "rich": | ||
| from rich.console import Console | ||
|
|
||
| import drift_cli.commands as _cmds |
| if snippet is not None: | ||
| console.print(Rule("[bold]Affected Code[/bold]", style="dim")) | ||
| console.print(snippet) | ||
| except Exception: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split from #576 (ADR-100 monorepo migration). Part of the PR decomposition into atomic, reviewable units.