How it works
For example, let’s say you have the following resources in your app:sst.config.ts
my-script.js
sst shell:
Run the command with
-- to pass arguments to it.--:
Opening a shell session
If no command is passed in, it opens a shell session with the linked resources:Targeting a component
Optionally, you can run this for a specific component by passing in the name of the component:MyComponent and its environment variables are available.
Options
--target
Only run it for the given component.
MyComponent.
Arguments
command
A command to run.
Examples
Open a shell session
Open an interactive shell with all resources linked:Run a Node.js script
Run a Python script
Pass arguments to the script
Use-- to pass arguments:
Run for a specific component
Run database migrations
Related
sst dev- Run commands in dev mode- Resource linking - Learn more about linking resources