cli icon indicating copy to clipboard operation
cli copied to clipboard

Feature Request: Final Hook for Statamic CLI

Open JelleGroenendal opened this issue 11 months ago • 0 comments

Summary

Add a final hook to the Statamic CLI that executes after all setup steps, including git init.

Current Limitation

Currently, there is only one hook available: StarterKitPostInstall.php. However, this hook runs before git init, which limits its usefulness for actions that require a fully initialized repository.

Proposed Solution

Introduce a final hook that runs after all installation steps are completed, including git init.

Use Cases

1. Push to a Git Repository (GitLab, GitHub, etc.)

Automatically add a remote Git repository and push the initialized project.

Example:

git remote add origin [email protected]:username/repository.git
git push -u origin main

2. Run Additional Setup Scripts

Execute project-specific scripts after installation (e.g., CI/CD setup, permissions adjustments).

3. Notify External Services

Send a webhook or notification to an external service to confirm that project creation is complete.

4. Initialize Additional Tools

Set up tools like Laravel Envoyer, Forge, or deploy keys after Git setup.

Implementation Suggestion

  • Introduce a new hook, e.g., StarterKitFinalInstall.php, that runs at the very end of the process.
  • Ensure that it executes after git init and any other finalization steps.

JelleGroenendal avatar Feb 21 '25 12:02 JelleGroenendal