Skip to content

Commit

Permalink
Docs: CLI commands
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Sep 16, 2023
1 parent 291c7ef commit f0c9a59
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/default/cli-commands.mdx
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# CLI commands

We can run CLI commands and scripts on AWS Lambda by deploying a "console" function with `serverless.yml`.

```yml
functions:
cli:
handler: the-php-script-to-run.php
runtime: php-81-console
```
The function uses the [Console runtime](../runtimes/console.mdx).
To execute the script on Lambda, run the command below:
```bash
serverless bref:cli
```

We can also pass arguments to the script:

```bash
serverless bref:cli --args="extra command line arguments and options"
```

Our script will be invoked inside AWS Lambda and the result will be printed to the console.

To learn more, read [the "Console" guide](../runtimes/console.mdx).

0 comments on commit f0c9a59

Please sign in to comment.