webcontainer-core
webcontainer-core copied to clipboard
webcontainer how to use git command
webcontainer how to use git command?
Hi @zFitness, can you describe your problem?
We can't answer this question, since it is too vague and ambiguous.
Hi @zFitness, can you describe your problem?
We can't answer this question, since it is too vague(含糊) and ambiguous(暧昧).
sorry now, We can use the git command in the terminal of stackblitz, but not in webcontainer
in the terminal of stackblitz, but not in webcontainer
Hi, can you elaborate which terminals are you referring to?
on the stackblitz website there are additional libraries and capabilities available in the webcontainer running there. For example hooking up git, or running commands that generate zip files.
If running a web container elsewhere for example like https://hax.cloud/ and typing git status or running commands to generate a zip, these do not work. Is there a documented API for how to add additional capabilities to the container or are these proprietary container enhancements beyond the open source version here?
Is there a documented API for how to add additional capabilities to the container or are these proprietary container enhancements beyond the open source version here?
You should be able to add files to the WebContainer filesystem and make them executable.
Looks like $PATH is set to /bin:/usr/bin:/usr/local/bin, but adding a file to /usr/local/bin might not be possible. So you might need to add it somewhere else and call it with ./path/to/my-executable.
Since only Node.js and WASM code are supported, you would need to make it a Node script or a WASM executable (though I/O may be limited, unless WebContainer has some level of WASI support).
For Git, maybe isomorphic-git might work?