Site Navigation
gosite
Interactively select a Joomla site and navigate to its folder in one command.
Usage
gosite [sitename] [-h]
Options
| Option | Description |
|---|---|
sitename |
The name of the project to cd to (the project folder name) |
-h |
Display help |
Shell function requirement
Because a script cannot change the shell's working directory directly, gosite requires a wrapper function in your shell configuration file. The installer adds this automatically, but if you need to add it manually:
Add it to ~/.zshrc (zsh), ~/.bash_profile (bash on macOS) or ~/.bashrc (bash on Linux):
gosite() {
local RESULT
RESULT=$(command /usr/local/bin/gosite "$@")
if [ $? -eq 0 ]; then
cd "$RESULT"
else
return 1
fi
}
After adding it, reload your shell:
source ~/.zshrc # or the startup file you edited
What it does
- Scans the
ROOTFOLDER(up to 2 directory levels deep) for DDEV projects by looking for their.ddevfolders, resolves each project's document root, and keeps the projects that hold aconfiguration.php - If a
sitenameis specified, the working directory is changed to that project - If no
sitenamewas given, a numbered list of all found Joomla sites is displayed, sorted by project name - Prompts you to select a site by number
- Changes your working directory to the document root of the selected site - that is where the Joomla files are
Projects are matched and sorted by project folder name, so gosite mysite works the same whether or not the project uses a document root subfolder. When it does, you land in that subfolder. The scripts that need the project folder instead (such as jbackup and jphpswitch) find it themselves, so this is never a problem.
Examples
$ gosite
Found 3 Joomla website(s):
1) /Users/me/Development/Sites/client-a
2) /Users/me/Development/Sites/mysite
3) /Users/me/Development/Sites/testsite
Select a site to navigate to (1-3): 2
$ pwd
/Users/me/Development/Sites/mysite
$ gosite testsite
$ pwd
/Users/me/Development/Sites/testsite
For a project with a public document root you land one level deeper:
$ gosite mysite
$ pwd
/Users/me/Development/Sites/mysite/public
jlistjoomlas
List all Joomla installations found under the configured root folder, with version and database details.
Usage
jlistjoomlas [-s] [-r <release>] [-h]
Options
| Option | Description |
|---|---|
-s |
Short mode - only display path and Joomla version |
-r <release> |
Filter by major version prefix (e.g. 4 or 5) |
-h |
Display help |
What it does
Scans ROOTFOLDER (up to 2 directory levels) for DDEV projects by looking for their .ddev folders, resolves each project's document root from its .ddev/config.yaml, and reads the configuration.php found there. Projects that hold no Joomla site, or whose version cannot be determined, are skipped. Joomla 1.0 and up is supported.
The reported path is the document root, so it is the folder that holds the Joomla files.
Full output (default)
Sitename : My Joomla Site
Version : 5.2.3
DB Name : db
DB User : db
DB Password : db
DB Host : db
DB Prefix : abcde_
Path : /Users/me/Development/Sites/mysite
Short output (with -s)
/Users/me/Development/Sites/mysite 5.2.3
/Users/me/Development/Sites/client-a 4.4.1
Examples
List all Joomla sites with full details:
jlistjoomlas
List only Joomla 5 sites in short format:
jlistjoomlas -s -r 5