Skip to content

Commit

Permalink
Docs CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
jayair committed Mar 13, 2024
1 parent 097e563 commit f90373d
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 7 deletions.
37 changes: 34 additions & 3 deletions cmd/sst/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -756,13 +756,37 @@ This is useful if you want to run multiple commands, all while accessing the lin
Name: "add",
Description: Description{
Short: "Add a new provider",
Long: `
Adds a provider to your ` + "`sst.config.ts`" + ` and installs it. For example.
` + "```bash" + ` frame="none"
sst add aws
` + "```" + `
Adds the following to your config.
` + "```ts" + ` title="sst.config.ts"
{
providers: {
aws: true
}
}
` + "```" + `
:::tip
You can get the name of a provider from the URL of the provider in the [Pulumi Registry](https://www.pulumi.com/registry/).
:::
Running ` + "`sst add aws`" + ` above is the same as adding the provider to your config and running ` + "`sst install`" + `.
`,
},
Args: []Argument{
{
Name: "provider",
Required: true,
Description: Description{
Short: "The provider to add",
Long: "The provider to add.",
},
},
},
Expand Down Expand Up @@ -809,11 +833,18 @@ This is useful if you want to run multiple commands, all while accessing the lin
{
Name: "install",
Description: Description{
Short: "Install dependencies specified in sst.config.ts",
Short: "Install the providers specified in sst.config.ts",
Long: `
Installs the dependencies in ` + "`sst.config.ts`" + `.
Installs the providers in your ` + "`sst.config.ts`" + `. You'll need this command when:
1. You add a new provider to ` + "`providers`" + ` or ` + "`home`" + ` in your config.
2. Or, when you want to install new providers after you ` + "`git pull`" + ` some changes.
:::tip
The ` + "`sst install`" + ` command is similar to ` + "`npm install`" + `.
:::
You'll need to run this when you add a new provider to your config.
Behind the scenes it downloads the packages for the providers and adds the types to your project.
`,
},
Run: func(cli *Cli) error {
Expand Down
37 changes: 33 additions & 4 deletions www/src/content/docs/docs/reference/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,31 @@ sst add <provider>
<Section type="parameters">
#### Args
- <p><code class="key">provider</code></p>
The provider to add
The provider to add.
</Section>
Add a new provider

Adds a provider to your `sst.config.ts` and installs it. For example.

```bash frame="none"
sst add aws
```

Adds the following to your config.

```ts title="sst.config.ts"
{
providers: {
aws: true
}
}
```

:::tip
You can get the name of a provider from the URL of the provider in the [Pulumi Registry](https://www.pulumi.com/registry/).
:::

Running `sst add aws` above is the same as adding the provider to your config and running `sst install`.

</Segment>

### install
Expand All @@ -335,9 +357,16 @@ sst install
```
</Section>

Installs the dependencies in `sst.config.ts`.
Installs the providers in your `sst.config.ts`. You'll need this command when:

1. You add a new provider to `providers` or `home` in your config.
2. Or, when you want to install new providers after you `git pull` some changes.

:::tip
The `sst install` command is similar to `npm install`.
:::

You'll need to run this when you add a new provider to your config.
Behind the scenes it downloads the packages for the providers and adds the types to your project.

</Segment>

Expand Down

0 comments on commit f90373d

Please sign in to comment.