-
Notifications
You must be signed in to change notification settings - Fork 89
docs(cloud): Rewrite CLI reference introduction and rename category to CLI #597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
developerjamiu
wants to merge
1
commit into
main
Choose a base branch
from
docs/cloud-cli-reference-intro
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+33
−29
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "label": "CLI reference", | ||
| "label": "CLI", | ||
| "collapsed": true, | ||
| "position": 9, | ||
| "className": "sidebar-icon-tools" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,49 +1,53 @@ | ||
| --- | ||
| title: Introduction | ||
| description: How to find any scloud command, read its documentation, and use the global options and environment variables that apply across every command. | ||
| sidebar_position: 1 | ||
| --- | ||
|
|
||
| The Serverpod Cloud CLI provides all you need to create, manage, and deploy your | ||
| Serverpod projects in Serverpod Cloud. | ||
| The Serverpod Cloud CLI (`scloud`) creates, manages, and deploys your Serverpod projects on Cloud. This reference covers every command, option, and flag. | ||
|
|
||
| > If you're new to developing with Serverpod, check out the [create a Serverpod project guide](https://docs.serverpod.dev/get-started) in the Serverpod framework docs! | ||
| ## Install and authenticate | ||
|
|
||
| Before running any command: | ||
|
|
||
| ## Getting started | ||
| - Install `scloud`. See [Install scloud](/cloud/getting-started/installation). | ||
| - Authenticate with `scloud auth login` interactively, or pass a personal access token in non-interactive contexts. See [Personal access tokens](/cloud/concepts/personal-access-tokens). | ||
|
|
||
| Run the following to install the CLI: | ||
| ## Command syntax | ||
|
|
||
| ```sh | ||
| dart pub global activate serverpod_cloud_cli | ||
| Every `scloud` invocation follows the same shape: | ||
|
|
||
| ```text | ||
| scloud [global options] <command> [<subcommand>] [arguments] [options] | ||
| ``` | ||
|
|
||
| Log in to your Serverpod Cloud account using the CLI: | ||
| <br/>(If you don't have a Serverpod Cloud account yet, visit [Serverpod Cloud](https://serverpod.cloud/).) | ||
| Global options can appear anywhere on the line; `scloud --token foo deploy` and `scloud deploy --token foo` are equivalent. When you run a command from a project directory containing `scloud.yaml`, the project ID is picked up automatically; pass `-p <project-id>` from anywhere else. | ||
|
|
||
| ```sh | ||
| scloud auth login | ||
| ``` | ||
| ## Global options | ||
|
|
||
| Go to your Serverpod server directory (e.g. `./myproject/myproject_server`) | ||
| and run the [`launch` command](/cloud/reference/cli/commands/launch) | ||
| to get an interactive, guided set up of a new Serverpod Cloud project: | ||
| A small set of options applies to every command: authentication (`--token`), project selection (`-p` / `--project`), output verbosity (`-v` / `--verbose`), and analytics (`-a` / `--analytics`). The full list, including timeouts and config-file overrides, lives on the [Global options](/cloud/reference/cli/global_options) page. | ||
|
|
||
| ```sh | ||
| scloud launch | ||
| ``` | ||
| ## Environment variables | ||
|
|
||
| If the project requires any environment variables, secrets, or passwords, they can be added with the [`variable`](/cloud/reference/cli/commands/variable), [`secret`](/cloud/reference/cli/commands/secret), and [`password`](/cloud/reference/cli/commands/password) commands. See the [Passwords, secrets, and environment variables](/cloud/concepts/passwords-secrets-env-vars) concept page for details on when to use each. Once the project is ready to be deployed, run the following command: | ||
| Most global options have an environment-variable equivalent so workflows and CI don't need flags everywhere. The two you'll reach for most often: | ||
|
|
||
| ```sh | ||
| scloud deploy | ||
| ``` | ||
| - **Authentication in CI:** `SERVERPOD_CLOUD_TOKEN` (equivalent to `--token`). | ||
| - **Project selection:** `SERVERPOD_CLOUD_PROJECT_ID` (equivalent to `-p`). | ||
|
|
||
| To follow the progress of the deployment, use the [`deployment show` command](/cloud/reference/cli/commands/deployment): | ||
| The full list is on the [CLI environment variables](/cloud/reference/cli/env_vars) page. | ||
|
|
||
| ```sh | ||
| scloud deployment show | ||
| ``` | ||
| ## Where the concepts live | ||
|
|
||
| Command pages describe *what* a command does. For the *why* and *when*, the concept pages are the home: | ||
|
|
||
| - Deploying, validating, rolling back: [Deployments](/cloud/concepts/deployments). | ||
| - Pre- and post-deploy automation: [Deployment hooks](/cloud/concepts/deployment-hooks). | ||
| - Runtime and build logs: [Logs](/cloud/concepts/logs). | ||
| - Default and custom domains: [Custom domains](/cloud/concepts/custom-domains). | ||
| - Managed PostgreSQL: [Database](/cloud/concepts/database). | ||
| - Sensitive values and runtime config: [Passwords, secrets, and environment variables](/cloud/concepts/passwords-secrets-env-vars). | ||
| - CI and headless authentication: [Personal access tokens](/cloud/concepts/personal-access-tokens). | ||
|
|
||
| That's it, you have now deployed your Serverpod app! 🚀 | ||
| ## How this reference is organized | ||
|
|
||
| For more information on the different commands, see the commands section in the side menu. For instance, to view the service's domains or to add your own custom domains, see the [`domain` command](/cloud/reference/cli/commands/domain). | ||
| Each command page combines a hand-written introduction with auto-generated subcommand and option listings drawn from `scloud --help`. The sidebar lists commands alphabetically. Use the search box for fast lookup by flag or argument name. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this description could be something else apart from how to