Skip to content

Commit

Permalink
docs: Add docs on output sub command
Browse files Browse the repository at this point in the history
  • Loading branch information
skierkowski authored and medikoo committed Jan 29, 2020
1 parent 2eae44b commit 8c100ad
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/dashboard/output-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,28 @@ stage:
${output::dev::my-service.var-key}
```

## Use outputs from the command line

Outputs can also be accessed on the CLI. You can use this at development time to look up the outputs without opening the dashboard, or in your CI/CD pipeline to use the outputs in custom scripts.

### List outputs

`sls output list [--org <org>] [--app <app>] [--service <service>] [--stage <stage>] [--region <region>]`

If you are in a working directory with a `serverless.yml` then the outputs will be listed for the org, app, and service specified in the serverless.yml file.

If you are not in a working directory, without a `serverless.yml`, or if you want to access outputs from another org, app, service, or stage, you can pass in the optional flags.

### Get an output

`sls output get --name <name> [--org <org>] [--app <app>] [--service <service>] [--stage <stage>] [--region region]`

Individual outputs can also be accessed from the CLI using the `output get` sub-command. This command requires the `--name <name>` flag to identify the output name.

It is possible for the output value to be a json object, in which case, we recommend using a tool like [jq](https://stedolan.github.io/jq/) to parse the JSON.

Like the `sls output list` command, you can optionally specify a different org, app, service, stage or region using flags.

## View outputs in the dashboard

The outputs for a service are made available on two different pages of the Serverless Framework Dashboard.
Expand Down

0 comments on commit 8c100ad

Please sign in to comment.