Skip to content

Commit 67a8ef2

Browse files
committed
docs(cli): add docs for all remaining commands
1 parent 5b573fd commit 67a8ef2

File tree

24 files changed

+115
-3
lines changed

24 files changed

+115
-3
lines changed

packages/toolchain/cli/src/commands/actor/create.rs

+18-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,14 @@ struct Port {
2929
host: bool,
3030
}
3131

32+
/// Create a new actor
3233
#[derive(Parser)]
3334
pub struct Opts {
35+
/// Specify the environment to create the actor in (will prompt if not specified)
3436
#[clap(long, alias = "env", short = 'e')]
3537
environment: Option<String>,
3638

39+
/// Specify the region to create the actor in (will auto-select if not specified)
3740
#[clap(long, short = 'r')]
3841
region: Option<String>,
3942

@@ -42,54 +45,67 @@ pub struct Opts {
4245
#[clap(long = "tags", short = 't')]
4346
universal_tags: Option<String>,
4447

48+
/// Tags specific to the actor (key=value format)
4549
#[clap(long, short = 'a')]
4650
actor_tags: Option<String>,
4751

48-
/// Build ID.
52+
/// Specific build ID to use for this actor
4953
#[clap(long)]
5054
build: Option<String>,
5155

56+
/// Tags to identify the build to use (key=value format)
5257
#[clap(long, short = 'b')]
5358
build_tags: Option<String>,
5459

60+
/// Override the automatically generated version name
5561
#[clap(
5662
long,
5763
short = 'v',
5864
help = "Override the automatically generated version name"
5965
)]
6066
version: Option<String>,
6167

68+
/// Environment variables to pass to the actor (key=value format)
6269
#[clap(long = "env-var")]
6370
env_vars: Option<Vec<String>>,
6471

72+
/// Network mode for the actor: bridge (default, isolated network) or host (shares host network stack)
6573
#[clap(long, value_enum)]
6674
network_mode: Option<NetworkMode>,
6775

76+
/// Ports to expose from the actor (name=protocol:port format)
6877
#[clap(long = "port", short = 'p')]
6978
ports: Option<Vec<String>>,
7079

80+
/// CPU resource limit for the actor (in mCPU)
7181
#[clap(long)]
7282
cpu: Option<i32>,
7383

84+
/// Memory resource limit for the actor (in MiB)
7485
#[clap(long)]
7586
memory: Option<i32>,
7687

88+
/// Time in seconds to wait before forcefully killing the actor
7789
#[clap(long)]
7890
kill_timeout: Option<i64>,
7991

92+
/// Create a durable actor that persists until explicitly destroyed
8093
#[clap(long)]
8194
durable: bool,
8295

83-
/// If included, the `current` tag will not be automatically inserted to the build tag.
96+
/// If included, the `current` tag will not be automatically inserted to the build tag
8497
#[clap(long)]
8598
no_build_current_tag: bool,
8699

100+
/// Stream logs after the actor is created
87101
#[clap(long)]
88102
logs: bool,
89103

104+
/// Specify which log stream to display
90105
#[clap(long)]
91106
log_stream: Option<crate::util::actor::logs::LogStream>,
92107

108+
/// Deploy the build before creating the actor
93109
#[clap(long)]
94110
deploy: bool,
95111
}

packages/toolchain/cli/src/commands/actor/destroy.rs

+4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ use clap::Parser;
33
use toolchain::{errors, rivet_api::apis};
44
use uuid::Uuid;
55

6+
/// Destroy an existing actor
67
#[derive(Parser)]
78
pub struct Opts {
9+
/// The ID of the actor to destroy
810
#[clap(index = 1)]
911
id: String,
1012

13+
/// Specify the environment the actor is in (will prompt if not specified)
1114
#[clap(long, alias = "env", short = 'e')]
1215
environment: Option<String>,
1316

17+
/// Override the kill timeout for the actor (in seconds)
1418
#[clap(long)]
1519
override_kill_timeout: Option<i64>,
1620
}

packages/toolchain/cli/src/commands/actor/get.rs

+3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ use clap::Parser;
33
use toolchain::rivet_api::apis;
44
use uuid::Uuid;
55

6+
/// Get details of a specific actor
67
#[derive(Parser)]
78
pub struct Opts {
9+
/// The ID of the actor to retrieve
810
#[clap(index = 1)]
911
id: String,
1012

13+
/// Specify the environment the actor is in (will prompt if not specified)
1114
#[clap(long, alias = "env", short = 'e')]
1215
environment: Option<String>,
1316
}

packages/toolchain/cli/src/commands/actor/list.rs

+5
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,22 @@ use clap::Parser;
33
use std::collections::HashMap;
44
use toolchain::rivet_api::apis;
55

6+
/// List all actors in the current project
67
#[derive(Parser)]
78
pub struct Opts {
9+
/// Specify the environment to list actors from (will prompt if not specified)
810
#[clap(long, alias = "env", short = 'e')]
911
environment: Option<String>,
1012

13+
/// Filter actors by tags (key=value format)
1114
#[clap(long)]
1215
tags: Option<String>,
1316

17+
/// Include destroyed actors in the results
1418
#[clap(long)]
1519
include_destroyed: bool,
1620

21+
/// Pagination cursor for retrieving the next page of results
1722
#[clap(long)]
1823
cursor: Option<String>,
1924
}

packages/toolchain/cli/src/commands/actor/logs.rs

+6
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,26 @@ use clap::Parser;
33
use toolchain::errors;
44
use uuid::Uuid;
55

6+
/// Stream logs from a specific actor
67
#[derive(Parser)]
78
pub struct Opts {
9+
/// The ID of the actor to stream logs from
810
#[clap(index = 1)]
911
id: String,
1012

13+
/// Specify the environment the actor is in (will prompt if not specified)
1114
#[clap(long, alias = "env", short = 'e')]
1215
environment: Option<String>,
1316

17+
/// Specify which log stream to display (stdout, stderr, or all)
1418
#[clap(long, short = 's')]
1519
stream: Option<crate::util::actor::logs::LogStream>,
1620

21+
/// Disable timestamp display in logs
1722
#[clap(long)]
1823
no_timestamps: bool,
1924

25+
/// Display logs and exit (do not continue following new logs)
2026
#[clap(long)]
2127
no_follow: bool,
2228
}

packages/toolchain/cli/src/commands/actor/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub mod logs;
77
use anyhow::*;
88
use clap::Subcommand;
99

10+
/// Commands for managing actors
1011
#[derive(Subcommand)]
1112
pub enum SubCommand {
1213
Create(create::Opts),

packages/toolchain/cli/src/commands/build/get.rs

+3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ use clap::Parser;
33
use toolchain::{errors, rivet_api::apis};
44
use uuid::Uuid;
55

6+
/// Get details of a specific build
67
#[derive(Parser)]
78
pub struct Opts {
9+
/// The ID of the build to retrieve
810
#[clap(index = 1)]
911
id: String,
1012

13+
/// Specify the environment the build is in (will prompt if not specified)
1114
#[clap(long, alias = "env", short = 'e')]
1215
environment: Option<String>,
1316
}

packages/toolchain/cli/src/commands/build/list.rs

+3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ use clap::Parser;
33
use std::collections::HashMap;
44
use toolchain::rivet_api::apis;
55

6+
/// List all builds in the current project
67
#[derive(Parser)]
78
pub struct Opts {
9+
/// Specify the environment to list builds from (will prompt if not specified)
810
#[clap(long, alias = "env", short = 'e')]
911
environment: Option<String>,
1012

13+
/// Filter builds by tags (key=value format)
1114
#[clap(long)]
1215
tags: Option<String>,
1316
}

packages/toolchain/cli/src/commands/build/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ mod list;
66
mod patch_tags;
77
pub mod publish;
88

9+
/// Commands for managing builds
910
#[derive(Subcommand)]
1011
pub enum SubCommand {
1112
Publish(publish::Opts),

packages/toolchain/cli/src/commands/build/patch_tags.rs

+5
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,22 @@ use clap::Parser;
33
use std::collections::HashMap;
44
use toolchain::rivet_api::{apis, models};
55

6+
/// Update tags for a specific build
67
#[derive(Parser)]
78
pub struct Opts {
9+
/// The ID of the build to update tags for
810
#[clap(index = 1)]
911
build: String,
1012

13+
/// Specify the environment the build is in (will prompt if not specified)
1114
#[clap(long, alias = "env", short = 'e')]
1215
environment: Option<String>,
1316

17+
/// Tags to set on the build (key=value format)
1418
#[clap(short = 't', long = "tag")]
1519
tags: Option<String>,
1620

21+
/// Comma-separated list of tag keys to make exclusive (will remove these tags from other builds)
1722
#[clap(short = 'e', long = "exclusive-tags")]
1823
exclusive_tags: Option<String>,
1924
}

packages/toolchain/cli/src/commands/build/publish.rs

+20
Original file line numberDiff line numberDiff line change
@@ -12,69 +12,89 @@ use toolchain::{
1212

1313
use crate::util::task::{run_task, TaskOutputStyle};
1414

15+
/// Publish a new build from local files or a Docker image
1516
#[derive(Parser)]
1617
pub struct Opts {
18+
/// Name of the build to publish
1719
#[clap(index = 1)]
1820
name: String,
1921

22+
/// Path to the files or directory to publish (must be a valid JS/TS file or directory with Dockerfile)
2023
#[clap(index = 2)]
2124
path: String,
2225

26+
/// Specify the environment to publish to (will prompt if not specified)
2327
#[clap(long, alias = "env", short = 'e')]
2428
environment: Option<String>,
2529

2630
// Common options
31+
/// Tags to apply to the build (key=value format)
2732
#[clap(long = "tags", short = 't')]
2833
tags: Option<String>,
2934

35+
/// Override the automatically generated version name
3036
#[clap(
3137
long,
3238
short = 'v',
3339
help = "Override the automatically generated version name"
3440
)]
3541
version: Option<String>,
3642

43+
/// Control the access level for the build (public or private)
3744
#[clap(long)]
3845
access: Option<config::BuildAccess>,
3946

47+
/// Allow running container as root (unstable, Docker builds only)
4048
#[clap(long)]
4149
unstable_allow_root: bool,
4250

51+
/// Specify the build method for Docker builds (unstable)
4352
#[clap(long)]
4453
unstable_build_method: Option<config::build::docker::BuildMethod>,
4554

55+
/// Specify the bundle kind for the build output (unstable)
4656
#[clap(long)]
4757
unstable_bundle: Option<config::build::docker::BundleKind>,
4858

59+
/// Specify the compression algorithm for the build output (unstable)
4960
#[clap(long)]
5061
unstable_compression: Option<config::build::Compression>,
5162

5263
// Docker options
64+
/// Specify a pre-built Docker image instead of building from a Dockerfile
5365
#[clap(long)]
5466
docker_image: Option<String>,
5567

68+
/// Specify a custom Dockerfile path (relative to path)
5669
#[clap(long)]
5770
dockerfile: Option<String>,
5871

72+
/// Specify a Docker build target for multi-stage builds
5973
#[clap(long)]
6074
build_target: Option<String>,
6175

76+
/// Pass build arguments to Docker (key=value format)
6277
#[clap(long)]
6378
build_arg: Option<Vec<String>>,
6479

6580
// JS options
81+
/// Enable minification of JavaScript code (unstable)
6682
#[clap(long)]
6783
unstable_minify: Option<bool>,
6884

85+
/// Enable result analysis for JavaScript builds (unstable)
6986
#[clap(long)]
7087
unstable_analyze_result: Option<bool>,
7188

89+
/// Set the log level for esbuild (unstable)
7290
#[clap(long)]
7391
unstable_esbuild_log_level: Option<String>,
7492

93+
/// Dump the build output for debugging (unstable)
7594
#[clap(long)]
7695
unstable_dump_build: Option<bool>,
7796

97+
/// Skip bundling for JavaScript builds (unstable)
7898
#[clap(long)]
7999
unstable_no_bundler: Option<bool>,
80100
}

packages/toolchain/cli/src/commands/config.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
use anyhow::*;
22
use clap::Subcommand;
33

4+
/// Commands for managing Rivet configuration
45
#[derive(Subcommand)]
56
pub enum SubCommand {
7+
/// Validate the current configuration file
68
Validate {
9+
/// Output the validated configuration as JSON
710
#[clap(long)]
811
json: bool,
912
},

packages/toolchain/cli/src/commands/deno.rs

+3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ use toolchain::{errors, rivet_api::apis, tasks::get_bootstrap_data};
55

66
use crate::util::task::{run_task, TaskOutputStyle};
77

8+
/// Execute Deno commands with Rivet environment variables
89
#[derive(Parser, Serialize)]
910
#[serde(rename_all = "camelCase")]
1011
pub struct Opts {
12+
/// Populate Rivet-specific environment variables (service token, endpoint, etc.)
1113
#[clap(long)]
1214
populate_env: bool,
1315

16+
/// Arguments to pass directly to Deno
1417
#[clap(trailing_var_arg = true)]
1518
#[clap(allow_hyphen_values = true)]
1619
#[clap(value_parser)]

packages/toolchain/cli/src/commands/deploy.rs

+3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ use anyhow::*;
22
use clap::Parser;
33
use std::collections::HashMap;
44

5+
/// Deploy a build to a specific environment
56
#[derive(Parser)]
67
pub struct Opts {
8+
/// Specify the environment to deploy to (will prompt if not specified)
79
#[clap(long, alias = "env", short = 'e')]
810
environment: Option<String>,
911

12+
/// Tags to identify the build to deploy (key=value format)
1013
#[clap(long, short = 't')]
1114
tags: Option<String>,
1215

packages/toolchain/cli/src/commands/environment/list.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use anyhow::Result;
22
use clap::Parser;
33

4+
/// List all available environments
45
#[derive(Parser)]
56
pub struct Opts {
67
#[clap(long, short)]

0 commit comments

Comments
 (0)