Skip to content

fix(init): show usage menu when called without arguments#235

Open
deanq wants to merge 2 commits intomainfrom
deanq/ae-1544-flash-init-correction
Open

fix(init): show usage menu when called without arguments#235
deanq wants to merge 2 commits intomainfrom
deanq/ae-1544-flash-init-correction

Conversation

@deanq
Copy link
Member

@deanq deanq commented Feb 28, 2026

Summary

  • flash init with no arguments now shows a usage panel with examples and exits instead of silently initializing in the current directory
  • flash init . continues to initialize in the current directory (unchanged)
  • flash init <name> continues to create a new project folder (unchanged)

Before: flash init and flash init . had identical behavior -- both initialized in cwd.
After: flash init shows usage menu; flash init . is the explicit way to initialize in cwd.

Test plan

  • Added 3 new tests for no-args behavior (exits with code 0, does not create skeleton, prints usage panel)
  • Updated existing test that asserted None creates skeleton (removed -- behavior changed)
  • All 18 init tests pass
  • Full make quality-check passes (1261 tests, 73.75% coverage)
  • Manual verification of all three modes: flash init, flash init ., flash init <name>

Previously `flash init` with no arguments silently initialized in the
current directory (same as `flash init .`). Now it shows a usage panel
with examples and exits, matching expected CLI behavior:
- `flash init` prints usage menu
- `flash init .` initializes in current directory
- `flash init <name>` creates new project folder
Copy link
Contributor

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

Updates the flash init CLI behavior so invoking it without a project argument shows a usage/help panel and exits, making “initialize in current directory” an explicit flash init ..

Changes:

  • Added an early-exit usage panel for flash init when called with no positional argument.
  • Updated init logic so only flash init . initializes the current directory (no longer the default when omitted).
  • Added/updated unit tests to cover the new no-args behavior (exit code, no skeleton creation, usage output).

Reviewed changes

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

File Description
src/runpod_flash/cli/commands/init.py Adds no-args usage panel + exit and adjusts current-directory branching to require ..
tests/unit/cli/commands/test_init.py Adds tests validating no-args exit behavior, output, and that no skeleton is created.

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

Replace hand-crafted usage text with ctx.get_help() to prevent drift
when CLI options change. Update argument help text to clarify that '.'
must be explicitly passed for current-directory init.
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.

2 participants