Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/06-concepts/cli/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"label": "CLI",
"position": 23,
"collapsed": true,
"className": "sidebar-icon-tools"
}
8 changes: 8 additions & 0 deletions docs/06-concepts/cli/_generated/.markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
MD001: false
MD013: false
MD014: false
MD024: false
MD041: false # MD041/first-line-heading/first-line-h1: First line in a file should be a top-level heading
# Temporarily disable MD012/no-multiple-blanks because the cli_tools adds
# an extra newline for commands without sub commands
MD012: false
Empty file.
52 changes: 52 additions & 0 deletions docs/06-concepts/cli/_generated/completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## Usage

```console
Command line completion commands

Usage: serverpod completion <subcommand> [arguments]
-h, --help Print this usage information.

Available subcommands:
generate Generate a command line completion specification
install Install a command line completion script

Run "serverpod help" to see global options.
```

### Sub commands

#### `generate`

```console
Generate a command line completion specification

Usage: serverpod completion generate [arguments]
-h, --help Print this usage information.
-t, --tool (mandatory) The completion tool to target

[completely] Use the `completely` tool (https://github.com/bashly-framework/completely)
[carapace] Use the `carapace` tool (https://carapace.sh/)

-e, --exec-name Override the name of the executable
-f, --file Write the specification to a file instead of stdout

Run "serverpod help" to see global options.
```

#### `install`

```console
Install a command line completion script

Usage: serverpod completion install [arguments]
-h, --help Print this usage information.
-t, --tool (mandatory) The completion tool to target

[completely] Use the `completely` tool (https://github.com/bashly-framework/completely)
[carapace] Use the `carapace` tool (https://carapace.sh/)

-e, --exec-name Override the name of the executable
-d, --write-dir Override the directory to write the script to

Run "serverpod help" to see global options.
```
14 changes: 14 additions & 0 deletions docs/06-concepts/cli/_generated/create-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Usage

```console
Creates a migration from the last migration to the current state of the database.

Usage: serverpod create-migration [arguments]
-h, --help Print this usage information.
--empty Creates the migration even if there are no database changes.
-f, --force Creates the migration even if there are warnings or information that may be destroyed.
-t, --tag Add a tag to the revision to easier identify it.

Run "serverpod help" to see global options.
```

16 changes: 16 additions & 0 deletions docs/06-concepts/cli/_generated/create-repair-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Usage

```console
Repairs the database by comparing the target state to what is in the live database instead of comparing to the latest migration.

Usage: serverpod create-repair-migration [arguments]
-h, --help Print this usage information.
-f, --force Creates the migration even if there are warnings or information that may be destroyed.
-t, --tag Add a tag to the revision to easier identify it.
-v, --version The target version for the repair. If not specified, the latest migration version will be repaired.
-m, --mode Used to specify which database configuration to use when fetching the live database definition.
[development (default), staging, production]

Run "serverpod help" to see global options.
```

22 changes: 22 additions & 0 deletions docs/06-concepts/cli/_generated/create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Usage

```console
Creates a new Serverpod project, specify project name (must be lowercase with no special characters).

Usage: serverpod create [arguments]
-h, --help Print this usage information.
-f, --force Create the project even if there are issues that prevent it from running out of the box.
-n, --name (mandatory) The name of the project to create.
Can also be specified as the first argument.

Project Template
--mini Shortcut for --template mini.
-t, --template Template to use when creating a new project

[mini] Mini project with minimal features and no database
[server] (default) Server project with standard features including database
[module] Serverpod Module project

Run "serverpod help" to see global options.
```

15 changes: 15 additions & 0 deletions docs/06-concepts/cli/_generated/generate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Usage

```console
Generate code from yaml files for server and clients.

Usage: serverpod generate [arguments]
-h, --help Print this usage information.
-w, --watch Watch for changes and continuously generate code.
-d, --directory The directory to generate code for (defaults to current directory).
(defaults to "")
-f, --force Regenerate even when the output looks up to date. Use this to rebuild after hand-editing or reverting generated files.

Run "serverpod help" to see global options.
```

34 changes: 34 additions & 0 deletions docs/06-concepts/cli/_generated/global_options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Usage

```console
Manage your serverpod app development

Usage: serverpod <command> [arguments]

Global options:
-h, --help Print this usage information.
-q, --quiet Suppress all cli output. Is overridden by -v, --verbose.
-v, --verbose Prints additional information useful for development. Overrides --q, --quiet.
-a, --[no-]analytics Toggles if analytics data is sent.
(defaults to on)
--[no-]interactive Enable interactive prompts. Automatically disabled in CI environments.
--version Prints the active version of the Serverpod CLI.
--experimental-features Enable experimental features. Experimental features might be removed at any time.

Available commands:
cloud Manage Serverpod Cloud projects through the Serverpod Cloud.
completion Command line completion commands
create Creates a new Serverpod project, specify project name (must be lowercase with no special characters).
create-migration Creates a migration from the last migration to the current state of the database.
create-repair-migration Repairs the database by comparing the target state to what is in the live database instead of comparing to the latest migration.
generate Generate code from yaml files for server and clients.
language-server Launches a serverpod language server communicating with JSON-RPC-2 intended to be used with a client integrated in an IDE.
mcp-server Start an MCP bridge to the `serverpod start` runner of one server project.
quickstart Creates a new Serverpod project with basic options.
run Run a script defined in the "serverpod/scripts" section of pubspec.yaml.
upgrade Upgrade Serverpod to the latest version.
version Prints the active version of the Serverpod CLI.

Run "serverpod help <command>" for more information about a command.
```

12 changes: 12 additions & 0 deletions docs/06-concepts/cli/_generated/language-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Usage

```console
Launches a serverpod language server communicating with JSON-RPC-2 intended to be used with a client integrated in an IDE.

Usage: serverpod language-server [arguments]
-h, --help Print this usage information.
--[no-]stdio (defaults to on)

Run "serverpod help" to see global options.
```

12 changes: 12 additions & 0 deletions docs/06-concepts/cli/_generated/mcp-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Usage

```console
Start an MCP bridge to the `serverpod start` runner of one server project.

Usage: serverpod mcp-server
-h, --help Print this usage information.
-s, --server-dir Path to the server project directory (the package that contains a `serverpod` dependency). Auto-detected from the current working directory if omitted. Pass this flag explicitly in monorepos with multiple server projects.

Run "serverpod help" to see global options.
```

21 changes: 21 additions & 0 deletions docs/06-concepts/cli/_generated/quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Usage

```console
Creates a new Serverpod project with basic options.
Suitable for a simple project or quick experiment.
Specify project name (must be lowercase with no special characters).

Usage: serverpod quickstart [arguments]
-h, --help Print this usage information.
-f, --force Create the project even if there are issues that prevent it from running out of the box.
-t, --template Template to use when creating a new project

[server] (default) Server project with standard features including database
[module] Serverpod Module project

-n, --name (mandatory) The name of the project to create.
Can also be specified as the first argument.

Run "serverpod help" to see global options.
```

13 changes: 13 additions & 0 deletions docs/06-concepts/cli/_generated/run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Usage

```console
Run a script defined in the "serverpod/scripts" section of pubspec.yaml.

Usage: serverpod run <script-name>
-h, --help Print this usage information.
--script The name of the script to run.
-l, --[no-]list List all available scripts.

Run "serverpod help" to see global options.
```

11 changes: 11 additions & 0 deletions docs/06-concepts/cli/_generated/upgrade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Usage

```console
Upgrade Serverpod to the latest version.

Usage: serverpod upgrade [arguments]
-h, --help Print this usage information.

Run "serverpod help" to see global options.
```

11 changes: 11 additions & 0 deletions docs/06-concepts/cli/_generated/version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Usage

```console
Prints the active version of the Serverpod CLI.

Usage: serverpod version [arguments]
-h, --help Print this usage information.

Run "serverpod help" to see global options.
```

5 changes: 5 additions & 0 deletions docs/06-concepts/cli/commands/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"collapsed": false,
"label": "Commands",
"position": 4
}
1 change: 1 addition & 0 deletions docs/06-concepts/cli/commands/cloud/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"label": "cloud"}
5 changes: 5 additions & 0 deletions docs/06-concepts/cli/commands/cloud/_cloud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# serverpod cloud

`serverpod cloud` forwards everything after it to the Serverpod Cloud CLI (`scloud`), so you can manage Serverpod Cloud projects without installing `scloud` separately.

For the full set of Cloud commands and options, see the [Serverpod Cloud CLI reference](/cloud/reference/cli/introduction).
9 changes: 9 additions & 0 deletions docs/06-concepts/cli/commands/cloud/cloud.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: ""
---
import MaintainedCommandIntro from './_cloud.md';
import Cloud from '../../_generated/cloud.md';

<MaintainedCommandIntro/>

<Cloud/>
1 change: 1 addition & 0 deletions docs/06-concepts/cli/commands/completion/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"label": "completion"}
5 changes: 5 additions & 0 deletions docs/06-concepts/cli/commands/completion/_completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# serverpod completion

`serverpod completion` sets up shell tab-completion for the `serverpod` command. Use the `install` subcommand to add completion to your shell, or `generate` to print a completion specification you can wire up yourself.

Both subcommands target a completion tool with `--tool`, either [`completely`](https://github.com/bashly-framework/completely) or [`carapace`](https://carapace.sh/). For a walkthrough, see [Shell completion](/tools/shell-completion).
9 changes: 9 additions & 0 deletions docs/06-concepts/cli/commands/completion/completion.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: ""
---
import MaintainedCommandIntro from './_completion.md';
import Completion from '../../_generated/completion.md';

<MaintainedCommandIntro/>

<Completion/>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"label": "create-migration"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# serverpod create-migration

`serverpod create-migration` compares your current models and database definition to the last migration and writes a new migration for the difference. Run it after changing your model files.

Use `--force` to proceed when a change may drop data, `--tag` to label the revision, or `--empty` to create a migration even when nothing has changed. For the full workflow, see [Migrations](/concepts/database/migrations).
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: ""
---
import MaintainedCommandIntro from './_create-migration.md';
import CreateMigration from '../../_generated/create-migration.md';

<MaintainedCommandIntro/>

<CreateMigration/>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"label": "create-repair-migration"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# serverpod create-repair-migration

`serverpod create-repair-migration` builds a migration by comparing the target state to what is actually in the live database, rather than to the latest migration. Use it to bring a database back in sync when it has drifted from your migration history.

Select which database to inspect with `--mode` (`development`, `staging`, or `production`), and target a specific version with `--version`. See [Migrations](/concepts/database/migrations).
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: ""
---
import MaintainedCommandIntro from './_create-repair-migration.md';
import CreateRepairMigration from '../../_generated/create-repair-migration.md';

<MaintainedCommandIntro/>

<CreateRepairMigration/>
1 change: 1 addition & 0 deletions docs/06-concepts/cli/commands/create/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"label": "create"}
5 changes: 5 additions & 0 deletions docs/06-concepts/cli/commands/create/_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# serverpod create

`serverpod create` scaffolds a new Serverpod project. By default it generates a full server project with a database, a server package, a client package, and a Flutter app.

Pass `--template mini` for a minimal project without a database, or `--template module` to create a shareable module. To set up the prerequisites first, see [Installation](../../../../04-get-started/01-installation.md).
9 changes: 9 additions & 0 deletions docs/06-concepts/cli/commands/create/create.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: ""
---
import MaintainedCommandIntro from './_create.md';
import Create from '../../_generated/create.md';

<MaintainedCommandIntro/>

<Create/>
1 change: 1 addition & 0 deletions docs/06-concepts/cli/commands/generate/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"label": "generate"}
5 changes: 5 additions & 0 deletions docs/06-concepts/cli/commands/generate/_generate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# serverpod generate

`serverpod generate` reads your model and endpoint definitions and generates the server and client Dart code that connects them. Run it whenever you add or change a model or an endpoint.

Pass `--watch` to regenerate automatically as you edit, or `--force` to rebuild after hand-editing generated files. For what gets generated, see [Working with endpoints](/concepts/working-with-endpoints) and [Models](/concepts/models).
9 changes: 9 additions & 0 deletions docs/06-concepts/cli/commands/generate/generate.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: ""
---
import MaintainedCommandIntro from './_generate.md';
import Generate from '../../_generated/generate.md';

<MaintainedCommandIntro/>

<Generate/>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"label": "language-server"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# serverpod language-server

`serverpod language-server` starts a Serverpod language server that communicates over JSON-RPC 2.0. It is meant to be launched by an IDE integration rather than run directly, and it powers features like diagnostics in your model and endpoint files.

See [Language server](/tools/lsp).
Loading
Loading