Skip to content

Add post_create_script config option#20

Merged
blipinsk merged 5 commits intomainfrom
mob/xenial-habanero
Mar 26, 2026
Merged

Add post_create_script config option#20
blipinsk merged 5 commits intomainfrom
mob/xenial-habanero

Conversation

@blipinsk
Copy link
Copy Markdown
Member

Summary

  • New post_create_script config field - path to a shell script that runs automatically after every codemob new, before the agent launches
  • Script runs with cwd set to the new worktree, useful for installing dependencies or copying gitignored files
  • If the script fails (non-zero exit), the mob is cleaned up (worktree, branch, config entry removed) and the agent is not launched
  • Relative paths resolved against repo root; empty string (default) is a no-op

Test plan

  • Script runs successfully on mob creation
  • Relative path resolution works
  • Failed script produces error and cleans up the mob
  • Missing script file produces clear error
  • Empty string (default) is a no-op
  • Full test suite passes

Run a user-provided shell script after every mob creation, before the
agent launches. The script runs with cwd set to the new worktree.
Useful for installing dependencies or setting up the environment.

If the script exits non-zero, mob creation stops and the agent is not
launched. Empty string (default) is a no-op.
If the post-create script exits non-zero, remove the worktree, branch,
and config entry instead of leaving an orphaned mob behind.
Return a clear error with chmod +x hint instead of a cryptic
"permission denied" when the script file lacks the executable bit.
When init detects an already-configured repo, re-save the config so
that new fields like post_create_script appear in existing configs
without requiring reinit.
Indent script output with │ prefix, wrap in ╭─/╰─ brackets, and
clear leftover agent UI before printing session-ended message.
@blipinsk blipinsk merged commit c58c6b4 into main Mar 26, 2026
1 check passed
@blipinsk blipinsk deleted the mob/xenial-habanero branch March 26, 2026 10:52
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