pub struct ProjectPurgeCommand { /* private fields */ }Expand description
Delete all Claude Code state for a project.
Wraps claude project purge [path]. Removes transcripts, tasks,
file history, and the project’s config entry. Use Self::path
to target a specific project, or Self::all to purge every
known project (the two are mutually exclusive at the CLI level;
passing both lets the CLI decide).
Headless callers should pass Self::yes – the CLI
requires -y whenever stdin/stdout isn’t a TTY and otherwise
waits on a confirmation prompt that no one is around to answer.
Combine with Self::dry_run to preview without deleting.
§Example
use claude_wrapper::{Claude, ClaudeCommand, ProjectPurgeCommand};
let claude = Claude::builder().build()?;
// Dry-run, no confirmation needed since nothing changes:
let preview = ProjectPurgeCommand::new()
.path("/some/project/path")
.dry_run()
.execute(&claude)
.await?;
println!("{}", preview.stdout);Implementations§
Source§impl ProjectPurgeCommand
impl ProjectPurgeCommand
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new purge command. Without Self::path or
Self::all, the CLI defaults to the current directory.
Sourcepub fn path(self, path: impl Into<String>) -> Self
pub fn path(self, path: impl Into<String>) -> Self
Purge state for the project at this path (positional [path]).
Mutually exclusive with Self::all at the CLI level.
Sourcepub fn all(self) -> Self
pub fn all(self) -> Self
Purge state for every known project (--all). Mutually
exclusive with Self::path at the CLI level.
Sourcepub fn dry_run(self) -> Self
pub fn dry_run(self) -> Self
List what would be deleted without deleting anything
(--dry-run). Safe to combine with Self::all for a
preview of full-purge scope.
Sourcepub fn interactive(self) -> Self
pub fn interactive(self) -> Self
Prompt for each item before deleting (-i, --interactive).
Only useful in TTY contexts; headless callers should leave
this off and pair Self::dry_run with Self::yes for
scoped automation.
Trait Implementations§
Source§impl ClaudeCommand for ProjectPurgeCommand
impl ClaudeCommand for ProjectPurgeCommand
Source§impl Clone for ProjectPurgeCommand
impl Clone for ProjectPurgeCommand
Source§fn clone(&self) -> ProjectPurgeCommand
fn clone(&self) -> ProjectPurgeCommand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProjectPurgeCommand
impl Debug for ProjectPurgeCommand
Source§impl Default for ProjectPurgeCommand
impl Default for ProjectPurgeCommand
Source§fn default() -> ProjectPurgeCommand
fn default() -> ProjectPurgeCommand
Auto Trait Implementations§
impl Freeze for ProjectPurgeCommand
impl RefUnwindSafe for ProjectPurgeCommand
impl Send for ProjectPurgeCommand
impl Sync for ProjectPurgeCommand
impl Unpin for ProjectPurgeCommand
impl UnsafeUnpin for ProjectPurgeCommand
impl UnwindSafe for ProjectPurgeCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClaudeCommandSyncExt for Twhere
T: ClaudeCommand<Output = CommandOutput>,
impl<T> ClaudeCommandSyncExt for Twhere
T: ClaudeCommand<Output = CommandOutput>,
Source§fn execute_sync(&self, claude: &Claude) -> Result<CommandOutput, Error>
fn execute_sync(&self, claude: &Claude) -> Result<CommandOutput, Error>
ClaudeCommand::execute for commands
producing CommandOutput.