Skip to content

Conversation

@fubuloubu
Copy link
Member

@fubuloubu fubuloubu commented Dec 19, 2025

What I did

Refactored the discovery of ape scripts to make them slightly "lazier" and adding support for "subfolder groups", which composes a click.Group from script files (and/or further subfolder groups) for a non-module path

fixes: #2735

Also tried to fix this issue w/ using --interactive where a successful script doesn't actually launch the terminal

fixes: #2693

How I did it

By refactoring the discovery process, we add a lot more flexibility on how we handle the scripts/ folder, allowing the potential for other types of scripts (remote or dependency scripts, non-Python scripts, etc.)

Also, in theory it should now support loading scripts from a Python module, as long as that module exposes either a main function or cli click.Command|Group

How to verify it

Run this branch on any Ape project and see if it works

Checklist

  • All changes are completed
  • Change is covered in tests
  • Documentation is complete

@fubuloubu fubuloubu force-pushed the feat/scripts/multilevel-groups branch 2 times, most recently from 8ae8dde to 85f9b1c Compare December 19, 2025 01:22
@fubuloubu fubuloubu force-pushed the feat/scripts/multilevel-groups branch from 85f9b1c to 2378078 Compare January 16, 2026 03:44
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.

Support handling subfolders in scripts as subcommands Allow --interactive for successful scripts

1 participant