Terminal Integration
ForgeKit includes a built-in terminal integration for running commands inside your local development environment. The terminal when used correctly will always use the php version tied to the current project. This avoids global config issues while also not overwriting your global config.
This ensures:
- The correct PHP version is used
- Composer runs against the correct runtime
- No global PATH conflicts
How it works
There are 2 approaches:
- Click the Terminal button and select which project you would like to open a terminal window for. This will open a terminal window in the site's path where it has automatically aliased php to the version that site needs to use. This is simple and pretty straight forward.
- The second approach is a lot more powerful and works in any terminal. Click the Terminal button, which will automatically attempt to add the
/clifolder to your windows environment variables. Then whichever terminal window you open you will have access to thefkitcli command.
$ fkit
ForgeKit CLI
Usage:
fkit php <args...> Run site-scoped PHP (resolved from current directory)
fkit php -v
fkit which php Show which PHP would run for current directory
fkit composer <args...> Run Composer using the site-scoped PHP
fkit composer1 <args...> Run Composer version 1 using the site-scoped PHP
fkit php composer <args...> Alias of "fkit composer"
Notes:
- Run these commands from inside a ForgeKit site folder.
- For Composer, place composer.phar next to fkit.exe:
C:\ForgeKit\cli\composer.phar
The fkit command will automatically detect which site you're working in based on the current working directory and by doing fkit php, it will run the PHP version set to that project.
Example use cases:
fkit php artisan optimizefkit php composer installfkit php composer1 install
Why use the ForgeKit terminal approach?
On Windows, it’s common to have:
- Multiple PHP versions
- Conflicting PATH entries
- Global Composer tied to the wrong PHP version
- Global PHP version that is hard to overwrite
The ForgeKit terminal avoids this by:
- Binding to the active Instance or to the active project folder
- Using its configured PHP binary
- Providing a predictable local environment that does not get conflicted with global one