AgentFlow

Clean · AgentFlow CLI

Nettoyer worktrees et artefacts

CLI path: agentflow clean

When to use

Workflow commands advance tracked features across spec → plan → implementation → verification → reporting guardrails before opening a merge request.

Original CLI synopsis: Nettoyer worktrees et artefacts

Usage

agentflow clean [flags]

Options

FlagScopeDefaultDescription
--dry-runInheritedfalseSimuler les exécutions sans lancer d'agent ni commandes externes
--failedLocalfalseNettoyer uniquement les tâches en échec
--mergedLocalfalseNettoyer uniquement les tâches mergées

Examples

agentflow clean

Wire richer samples through cobra.Command.Example when the happy path warrants copy/paste-friendly automation beyond this scaffold.

What happens internally

  • Validates CLI arity, honours the global --dry-run switch, resolves repository metadata, hydrates SQLite-backed bookkeeping, then calls façade orchestration wrappers for the requested lifecycle stage.
  • Persists deterministic run identifiers so status and resume can continue automation deterministically afterward.

Failure modes

  • Cobra rejects unknown flags or arity mismatches before any repository side effects occur.
  • AgentFlow cannot resolve scaffolding when the command is invoked outside an initialised checkout.
  • Delegated subprocesses (git, MCP hosts, editor agents, etc.) can exit non-zero and bubble errors verbatim.