Skip to content

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
mainfrom
split/576-713a-cli-pkg-skeleton-analysis
Open

feat: add drift-cli package skeleton and core analysis commands (ADR-100 phase 5b-a)#717
mick-gsk wants to merge 1 commit into
mainfrom
split/576-713a-cli-pkg-skeleton-analysis

Conversation

@mick-gsk
Copy link
Copy Markdown
Owner

@mick-gsk mick-gsk commented May 3, 2026

Split from #576 (ADR-100 monorepo migration). Part of the PR decomposition into atomic, reviewable units.

Copilot AI review requested due to automatic review settings May 3, 2026 17:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-cli package 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
Comment thread pyproject.toml
[project]
name = "drift-analyzer"
version = "2.50.0"
version = "2.49.0"
Comment thread pyproject.toml
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:
@mick-gsk mick-gsk closed this May 4, 2026
@mick-gsk mick-gsk deleted the split/576-713a-cli-pkg-skeleton-analysis branch May 4, 2026 05:09
@mick-gsk mick-gsk restored the split/576-713a-cli-pkg-skeleton-analysis branch May 4, 2026 05:14
@mick-gsk mick-gsk reopened this May 4, 2026
@mick-gsk mick-gsk added release:feature Include this PR under Features in release notes size/XL Diff ≥ 500 lines — consider splitting labels May 4, 2026
@github-actions github-actions Bot added agent-review-requested Agent review was requested automatically lane/standard Fixes and features — standard review path has-conflicts PR has merge conflicts with the base branch labels May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-review-requested Agent review was requested automatically has-conflicts PR has merge conflicts with the base branch lane/standard Fixes and features — standard review path release:feature Include this PR under Features in release notes size/XL Diff ≥ 500 lines — consider splitting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants