1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(
name = "partiri",
version,
about = "Deploy and manage services on Partiri Cloud",
long_about = None,
)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
/// Configure your Partiri API key
Auth,
/// Run the interactive setup wizard and create .partiri.jsonc
Init,
/// Validate the local .partiri.jsonc config file
Validate,
/// Service management
#[command(subcommand)]
Service(ServiceCommands),
/// Project management
#[command(subcommand)]
Projects(ProjectCommands),
/// Workspace management
#[command(subcommand)]
Workspaces(WorkspaceCommands),
}
#[derive(Subcommand)]
pub enum ServiceCommands {
/// Register the service on Partiri and update .partiri.jsonc
Create,
/// Pull an existing service from Partiri and save it as .partiri.jsonc
Pull,
/// Push local config changes to the existing service
Push,
/// Show current service metrics and recent jobs
Metrics,
/// Show the last 35 log lines for this service
Logs,
/// List jobs for this service
Jobs,
/// Trigger a deploy job
Deploy,
/// Pause the service
Pause,
/// Resume a paused service
Unpause,
/// Kill the service (requires confirmation)
Kill,
/// Link an authentication token to this service (for private repositories or registries)
Token,
}
#[derive(Subcommand)]
pub enum ProjectCommands {
/// List all projects in a workspace
List,
/// Create a new project in a workspace
Create,
}
#[derive(Subcommand)]
pub enum WorkspaceCommands {
/// List all workspaces
List,
}