webcontainer-core icon indicating copy to clipboard operation
webcontainer-core copied to clipboard

how to add a command

Open zFitness opened this issue 2 years ago • 4 comments

Now that webcontainers supports commands such as ls and cat, I want to add commands now. How to implement them?

zFitness avatar Jan 25 '24 08:01 zFitness

Hi! Commands are built into the runtime itself, and there is no way for users to contribute to it.

I recommend that you open separate issues for each command you are interested in and detail your use case there.

jrvidal avatar Jan 25 '24 11:01 jrvidal

Hi! Commands are built into the runtime itself, and there is no way for users to contribute to it.

I recommend that you open separate issues for each command you are interested in and detail your use case there.

  1. Can you do this by configuring an alias for .jshrc?
  2. Will the project be open source?
  3. How to support persistence

zFitness avatar Jan 25 '24 11:01 zFitness

Hi! Commands are built into the runtime itself, and there is no way for users to contribute to it.

I recommend that you open separate issues for each command you are interested in and detail your use case there.

zFitness avatar Jan 25 '24 11:01 zFitness

Will the project be open source?

It might be one day, but there are no concrete plans to do that in the near future.

Can you do this by configuring an alias for .jshrc?

I created a small example project of stuff you can do https://stackblitz.com/edit/stackblitz-starters-q6awbx

It runs an export PATH command on startup and runs chmod +x to make the files in the bin folder executable. So after startup you are able to run foo or bar.

You could run the export and chmod in your .jshrc, but that only works then on your machine and you can't share the project.

How to support persistence

Not sure what you mean here. But do you want to create binaries that you can use on every single project? That's currently not available.

I hope this answers your questions.

SamVerschueren avatar Jan 26 '24 09:01 SamVerschueren