Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 11, 2025

Implements stellar scaffold clean subcommand to remove scaffold-generated artifacts from target/stellar, packages/*, and src/contracts/*.

Changes

  • New clean subcommand (src/commands/clean.rs)

    • Removes target/stellar directory entirely
    • Cleans packages/* except git-tracked files and .gitkeep
    • Cleans src/contracts/* except git-tracked files and util.ts
    • Falls back to preserving common template files when git unavailable
  • Command registration (src/commands/mod.rs)

    • Wired into CLI with proper error handling
  • Test coverage (tests/it/unit.rs)

    • Verifies artifact removal and file preservation

Usage

stellar scaffold clean
stellar scaffold clean --manifest-path path/to/Cargo.toml

Output Example

🧹 Cleaning scaffold artifacts from /path/to/project
  Removing target/stellar/
  Cleaning packages/ (preserving git-tracked files)
    Removed packages/my-package
  Cleaning src/contracts/ (preserving git-tracked files)
    Removed src/contracts/generated.ts
✨ Clean complete!
Original prompt

This section details on the original issue you should resolve

<issue_title>stellar scaffold reset to clear all artifacts</issue_title>
<issue_description>Add stellar scaffold reset command to clear all scaffold-generated artifacts from:

  • target/stellar
  • contract aliases (used to be able to just rm .stellar directory, but with only-global config this no longer works; we will need to find a different way)
  • packages/* (but not checked-into-git files like .gitkeep)
  • src/contracts/* (but not checked-into-git files like util.ts)</issue_description>

<agent_instructions>Create a new sub command in stellar-scaffold-cli called clean. Ignore the issues around contract aliases. Also add a test.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@willemneal I prefer `clean`. @tupui > I prefer `clean`.

cargo clean I guess ;) But git reset. I get both are fine. </comment_new>
<comment_new>@pselle
What if this were written out as a small design proposal?

Problem Statement

Proposed Solution

Alternative solutions & Rejected ideas</comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 11, 2025
Copilot AI changed the title [WIP] Add clean command to clear scaffold-generated artifacts Add stellar scaffold clean command to remove build artifacts Nov 11, 2025
Copilot finished work on behalf of willemneal November 11, 2025 20:47
Copilot AI requested a review from willemneal November 11, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stellar scaffold reset to clear all artifacts

2 participants