CARVIEW |
Select Language
HTTP/2 200
date: Wed, 23 Jul 2025 22:54:46 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"fb2dbe8261cad11e2430c8e0982df443"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=kCYz2fse2o4DIyW77waNkZB%2FL5%2F3snhqv4DChJt1UEMviwpAI9yKtF6CF%2F%2B7aJg5N7KA2gshWMJCdwNGwRJuv7Gq91rAaVpNf9YlLiH3u%2Fx5miTqQLVI%2Bme1J4K50npOtxjIov10n8qj2IGfQFAqu0J%2FQ9AXdBR2hV3fpr3OkdP2kk0iGmE%2BPH46jR4cYSvQJFOXIRhndSOwn%2BNnX5PZlbC0MJqeBHXy5u6wYb5OjN9f1%2F2xMSiRwMxAjEC2wshEf8%2FPJqHYGV6Ndydn9jhFTA%3D%3D--UeShv5x%2BZx7VjykM--yjxIMygbAiHeW7yib0uhMA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.80608453.1753311286; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 22:54:46 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 22:54:46 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: B1FC:36131:113D9CA:14AA33F:68816836
Shell integration Β· bobthecow/psysh Wiki Β· GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 318
Shell integration
Justin Hileman edited this page Jun 3, 2017
·
1 revision
It can be super useful to access a system shell from inside a REPL session. PsySH fully supports this β¦Β but mostly because PHP supports this π.
To execute arbitrary shell commands, wrap the command in backticks.
>>> `pwd`
=> "/Projects/psysh\n"
>>> `ls`
=> """
CONTRIBUTING.md\n
LICENSE\n
README.md\n
bin\n
composer.json\n
composer.lock\n
phpunit.xml.dist\n
src\n
test\n
vendor\n
"""
>>>
PHP variables can be interpolated into shell commands as well.
>>> $readme = 'README.md'
=> "README.md"
>>> `ls -al $readme`
=> "-rw-r--r-- 1 justin staff 9649 May 28 13:34 README.md\n"
>>>
Some commandsβsuch as doc
, dump
, ls
and show
βupdate the $__file
, $__dir
and $__line
magic variables after they run. These variables are especially useful when interpolated into shell commands.
For example, after using doc
to show the documentation for a class or method, you can use the subl
shell command to open that file in Sublime Text and jump to the definition.
>>> doc Psy\Shell
class Psy\Shell extends Symfony\Component\Console\Application
Description:
The Psy Shell application.
Usage:
$shell = new Shell;
$shell->run();
Author: Justin Hileman <justin@justinhileman.info>
>>> $__file
=> "/Projects/psysh/src/Psy/Shell.php"
>>> `subl $__file:$__line`
=> null
>>>
This. Is. So. Good.
Clone this wiki locally
You canβt perform that action at this time.