Skip to content

feat: Interactive onboarding CLI with Typer#128

Merged
Miyamura80 merged 29 commits intomainfrom
ralph/onboarding-cli
Feb 24, 2026
Merged

feat: Interactive onboarding CLI with Typer#128
Miyamura80 merged 29 commits intomainfrom
ralph/onboarding-cli

Conversation

@Miyamura80
Copy link
Owner

Summary

  • Replaces the old Makefile-based onboarding with an interactive Typer CLI (onboard.py) supporting subcommands: rename, deps, env, hooks, media, and a full onboard orchestrator
  • Refactors generate_banner.py and generate_logo.py to accept parameters (title, theme, project_name) for non-interactive use
  • Removes deprecated Makefile targets (rename, generate_banner, generate_logo, setup_hooks) and updates documentation

Changes

  • New: onboard.py — Typer CLI with 5 subcommands + full onboarding flow
  • Modified: init/generate_banner.py, init/generate_logo.py — accept parameters directly
  • Modified: Makefile — removed old targets, simplified to make onboard
  • Modified: CLAUDE.md, README.md — updated docs to reflect new CLI
  • Modified: pyproject.toml, uv.lock — added typer dependency

Test plan

  • Run uv run python onboard.py --help to verify CLI structure
  • Run individual subcommands (rename, deps, env, hooks, media)
  • Run make onboard for full flow
  • Verify make ci passes

🤖 Generated with Claude Code

Ralph Agent and others added 9 commits February 23, 2026 23:54
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 24, 2026

Greptile Summary

This PR replaces the old Makefile-based onboarding with a modern interactive Typer CLI. The new onboard.py provides 5 subcommands (rename, deps, env, hooks, media) plus a full orchestrator flow that guides users through project setup step-by-step.

Major Changes:

  • New CLI: Interactive prompts with rich formatting, validation, and error handling
  • Refactored generators: generate_banner.py and generate_logo.py now accept parameters for programmatic use
  • Data preservation: The _write_env_file function now preserves custom environment variables not in .env.example
  • Exit code fix: Orchestrator correctly handles step completion with code != 0 check
  • Dependencies: Added typer, questionary, and rich for CLI functionality
  • Documentation: Updated README.md and CLAUDE.md to reflect new workflow

Issues Found:

  • README tagline replacement targets a string that doesn't match the current file (line 172-173), causing silent failure when users run onboard rename

Confidence Score: 4/5

  • Safe to merge with one string replacement fix needed for full functionality
  • The implementation is solid with good error handling and recent fixes for data loss and exit code issues. However, the README tagline replacement will silently fail due to a mismatched target string, preventing users from customizing their project tagline during onboarding.
  • onboard.py needs the README replacement string fixed to match current content

Important Files Changed

Filename Overview
onboard.py New Typer CLI with 5 subcommands (rename, deps, env, hooks, media) and orchestrator. Data loss fix applied, but README tagline replacement has incorrect target string.
init/generate_banner.py Refactored to accept parameters (title, theme) instead of hardcoded values for non-interactive use.
init/generate_logo.py Refactored to accept parameters (project_name, theme, output_dir) for non-interactive use.
Makefile Simplified to call onboard.py CLI, removed deprecated targets (rename, generate_banner, generate_logo, setup_hooks).
pyproject.toml Added typer, questionary, and rich>=14.3.1 dependencies. Description reverted to clean template value.

Last reviewed commit: 2aa1add

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

8 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Ralph Agent and others added 2 commits February 24, 2026 09:41
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep only `make onboard` as the documented entry point.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

8 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Ralph Agent and others added 5 commits February 24, 2026 09:45
Covered by `make onboard` media step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

9 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Ralph Agent and others added 2 commits February 24, 2026 10:06
The .githooks directory was removed when migrating to pre-commit framework,
but the onboard CLI still referenced it via git config core.hooksPath.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

9 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Replace global dspy.configure() with scoped dspy.context() to avoid
cross-event-loop RuntimeError. Make LangFuse observability conditional
on credentials being present. Improve media step UX with spacing and
"Both" as default choice.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

10 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

10 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

- Remove garbled characters from README and pyproject.toml descriptions
- Add rich as direct dependency to fix DEP003 issues
- Add type annotations to fix langfuse type checker errors

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

14 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Move generate_banner and generate_logo imports from module scope to inside
_run_media_generation(). This prevents genai.Client instantiation at import
time, allowing all CLI commands to work without GEMINI_API_KEY configured.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Ralph Agent and others added 4 commits February 24, 2026 16:28
Restore original placeholder text so onboard rename can replace them:
- pyproject.toml description: "Add your description here"
- README.md title: "# Python-Template"
- README.md tagline: "Opinionated Python project stack. 🔋 Batteries included."

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Document why generate_banner and generate_logo are imported inside the
function rather than at module scope.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove automated agent tooling files no longer needed:
- scripts/ralph.sh (agent loop script)
- prd.json (feature PRD)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove Ralph agent directory and PRD documentation:
- scripts/ralph/ (progress.txt, prompt.md)
- tasks/prd-onboarding-cli.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

13 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 24, 2026

Additional Comments (1)

Makefile
make ralph target references deleted scripts

This PR deletes scripts/ralph.sh and scripts/ralph/prompt.md, but the ralph Makefile target on lines 109-116 still references ./scripts/ralph.sh. Running make ralph will fail with a "No such file or directory" error.

Either remove this target entirely (since the Ralph artifacts were intentionally cleaned up in commits a4b8c64 and d14657b), or keep it if Ralph is still intended to be used and restore the scripts.

Prompt To Fix With AI
This is a comment left during a code review.
Path: Makefile
Line: 109-116

Comment:
**`make ralph` target references deleted scripts**

This PR deletes `scripts/ralph.sh` and `scripts/ralph/prompt.md`, but the `ralph` Makefile target on lines 109-116 still references `./scripts/ralph.sh`. Running `make ralph` will fail with a "No such file or directory" error.

Either remove this target entirely (since the Ralph artifacts were intentionally cleaned up in commits a4b8c64 and d14657b), or keep it if Ralph is still intended to be used and restore the scripts.

```suggestion
```

How can I resolve this? If you propose a fix, please make it concise.

Restore scripts needed for Ralph agent workflow:
- scripts/ralph.sh (agent loop runner)
- scripts/ralph/prompt.md (agent prompt template)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

11 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Simplify condition from 'if code and code != 0' to 'if code != 0'.
Previous logic was correct but unnecessarily complex.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

11 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Copy link
Owner Author

@Miyamura80 Miyamura80 left a comment

Choose a reason for hiding this comment

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

Review Response: Unresolved Comments

I've analyzed all unresolved Greptile comments. Here's the status:

✅ INVALID (Already Resolved)

README tagline replacement (line 176)

  • Status: Already fixed in commit ee29587
  • Explanation: README was reverted to original placeholder text "<b>Opinionated Python project stack. 🔋 Batteries included. </b>" which matches the replacement string in onboard.py line 173

✅ VALID but FIXED

Exit code handling (lines 97, 107)

  • Status: Fixed in commit c51732a
  • Explanation: Simplified if code and code != 0: to if code != 0: for clearer logic. Exit code 0 (success) now correctly marks steps as completed

❌ VALID - BLOCKING ISSUE

_write_env_file data loss (line 335-356) - CRITICAL

  • Status: Unresolved - blocks merge
  • Issue: Function rebuilds .env from scratch using only .env.example keys, silently deleting custom user variables
  • Impact: Data loss if users add custom environment variables not in template
  • Fix needed: Preserve custom variables by reading existing .env, identifying untracked keys, and appending them under "# Custom variables" section

Summary: 1 blocking issue remains (env file data loss). Exit code and README issues are resolved.

@Miyamura80
Copy link
Owner Author

Individual Comment Responses

Comment on line 176 (README tagline replacement)

Status: INVALID - Already resolved in commit ee29587

The README was reverted back to original placeholder:

<b>Opinionated Python project stack. 🔋 Batteries included. </b>

This matches onboard.py line 173, so replacement works correctly.


Comments on lines 97, 107 (Exit code handling)

Status: VALID but FIXED - Resolved in commit c51732a

Simplified if code and code != 0:if code != 0:
Exit code 0 (success) now properly marks steps as completed.


Comments on lines 335-356 (_write_env_file)

Status: VALID - BLOCKING

Critical data loss issue:

  • Function rebuilds .env from scratch
  • Only writes keys from .env.example
  • Silently deletes custom user variables

Must fix before merge. Suggested approach:

  1. Read existing .env before overwriting
  2. Identify custom keys not in template
  3. Append under "# Custom variables" section

View full analysis in my review comment above.

Preserve custom environment variables when running `onboard env`:
- Load existing .env before overwriting
- Identify custom keys not in .env.example
- Append under "# Custom variables" section

Fixes critical data loss bug where user-added env vars were silently
deleted. Addresses Greptile review feedback on lines 335-356.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

11 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link
Owner Author

@Miyamura80 Miyamura80 left a comment

Choose a reason for hiding this comment

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

Response to Unresolved Greptile Comments

Replying to each unresolved review comment with current status:

@Miyamura80 Miyamura80 merged commit 7bc9a40 into main Feb 24, 2026
12 checks passed
@github-actions github-actions bot deleted the ralph/onboarding-cli branch February 24, 2026 18:55
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.

1 participant