Skip to content

Add dusk-forge CLI: new, build, test, check#11

Merged
HDauven merged 2 commits intomainfrom
cli-core
Mar 13, 2026
Merged

Add dusk-forge CLI: new, build, test, check#11
HDauven merged 2 commits intomainfrom
cli-core

Conversation

@HDauven
Copy link
Copy Markdown
Member

@HDauven HDauven commented Feb 14, 2026

Summary

  • Introduces dusk-forge CLI binary (cli/ crate) with core contract development commands
  • new: scaffold a project from counter or empty template
  • build: compile contract and/or data-driver WASM (defaults to both)
  • test: build contract WASM then run cargo test --release
  • check: validate project structure, deps, and toolchain
  • Updates contract-template/ with working test harness and simplified counter

Stack

  • PR 1/3 (this) core functionality
  • PR 2/3: expand, clean, completions
  • PR 3/3: schema, call, verify (through wasmtime)

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

This PR introduces the dusk-forge CLI tool for Dusk contract development, providing scaffolding and build automation capabilities. The CLI adds four core commands (new, build, test, check) for managing contract projects, along with template rendering, toolchain management, and build orchestration. The PR also updates the contract template with working test harnesses and simplified counter examples.

Changes:

  • Adds new cli/ crate with dusk-forge binary and core contract development commands
  • Updates contract template with functional test harness and simplified event emission
  • Adds workspace dependencies for CLI tooling (clap, colored, cargo_metadata, etc.)

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
cli/Cargo.toml Defines CLI package with required dependencies
cli/src/main.rs Main entry point routing commands to handlers
cli/src/cli.rs Command-line argument definitions using clap
cli/src/commands/*.rs Implementation of new, build, test, and check commands
cli/src/template/*.rs Template rendering engine with name validation
cli/src/project/*.rs Project detection and metadata loading
cli/src/toolchain.rs Rust toolchain version management
cli/src/build_runner/*.rs WASM build orchestration and optimization
cli/src/tools.rs Executable path discovery
cli/src/ui.rs User interface utilities for formatted output
cli/src/error.rs Error type definitions
cli/tests/new_command.rs Integration tests for the new command
cli/README.md CLI documentation and usage examples
contract-template/Cargo.toml Updates dusk-forge to 0.2.2 and adds pinned dependencies
contract-template/src/lib.rs Simplifies event emission from structs to tuples
contract-template/tests/contract.rs Adds complete test harness with deployment and mutation tests
Cargo.toml Adds cli to workspace members and defines shared dependencies
tests/test-bridge/Cargo.toml Adds uuid dependency for transitive pinning

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@moCello moCello left a comment

Choose a reason for hiding this comment

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

Apart from the copilot findings on the toml import I can only remark that the changelog entry is missing

@HDauven
Copy link
Copy Markdown
Member Author

HDauven commented Mar 12, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef7ad9708a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

};

const CONTRACT_FEATURE: &str = "contract";
const DATA_DRIVER_FEATURE: &str = "data-driver-js";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use supported data-driver feature for data-driver builds

The data-driver build path is hardcoded to data-driver-js, but this commit’s own validation treats data-driver and data-driver-js as acceptable project shapes. That means projects that only define data-driver (a valid configuration per the checker and template docs) will pass check and then consistently fail dusk-forge build data-driver with an unknown feature error.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

@moCello moCello left a comment

Choose a reason for hiding this comment

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

LGTM

@HDauven HDauven merged commit 52fc353 into main Mar 13, 2026
2 checks passed
@HDauven HDauven deleted the cli-core branch March 13, 2026 14:11
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.

3 participants