# Automatic Site Shell, auto context switching in ZSH terminal

**URL:** <https://community.localwp.com/t/automatic-site-shell-auto-context-switching-in-zsh-terminal/45785>\
**Category:** Support\
**Created:** [November 28, 2024, 2:15pm UTC](https://community.localwp.com/t/automatic-site-shell-auto-context-switching-in-zsh-terminal/45785 "2024-11-28T14:15:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmpel](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/rmpel/32/4529_2.png) [@rmpel](https://community.localwp.com/u/rmpel)\
**Post date:** [November 28, 2024, 2:15pm UTC](https://community.localwp.com/t/automatic-site-shell-auto-context-switching-in-zsh-terminal/45785/1 "2024-11-28T14:15:10Z")

</div>

I wanted to share this with you all, it’s not a bug or request 🙂

I was tired of opening site shells for everything, so I created a ZSH add-on to automatically switch the site-shell context based on the working directory.

You can find it here;

> <https://gist.github.com/rmpel/f5c220b5e49baf0df4f5bbf5b7e76fdf>

If the `local-cli` dependency is installed, it will even auto-start a site when entering the directory for it. (LocalWP must already be running, though)

I hope you like it.

For discussion, please use the github page.

Suggestions, improvements but also criticism, all will be appreciated.

(p.s., currently only supports MacOS with the Apple Terminal emulator)

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [February 26, 2025, 2:15pm UTC](https://community.localwp.com/t/automatic-site-shell-auto-context-switching-in-zsh-terminal/45785/2 "2025-02-26T14:15:39Z")

</div>

Closed on February 26, 2025, 2:15pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
