DevCommand
Reference doc for the `sst.experimental.DevCommand` component.
The DevCommand
lets you run a command in a separate pane when you run sst dev
.
The sst dev
CLI starts a multiplexer with panes for separate processes. This component allows you to add a process to it.
This component only works in sst dev
. It does not do anything in sst deploy
.
Example
For example, you can use this to run Drizzle Studio locally.
Here npx drizzle-kit studio
will be run in sst dev
and will show up under the Studio tab. It’ll also have access to the links from rds
.
Constructor
Parameters
-
name
string
-
args
DevCommandArgs
-
opts?
ComponentResourceOptions
DevCommandArgs
dev?
Type Object
dev.autostart?
Type Input
<
boolean
>
Default true
Configure if you want to automatically start this when sst dev
starts. You can still
start it manually later.
dev.command?
Type Input
<
string
>
Default “npm run dev”
The command that sst dev
runs to start this in dev mode.
dev.directory?
Type Input
<
string
>
Default The project root.
Change the directory from where the command
is run.
dev.title?
Type Input
<
string
>
Default The name of the component.
The title of the tab in the multiplexer.
environment?
Type Input
<
Record
<
string
, Input
<
string
>
>
>
Set environment variables for this command.
link?
Type Input
<
any
[]
>
Link resources to your command. This will allow you to access it in your command using the SDK.
Takes a list of resources to link.