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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
//! CLI argument definitions for `life`.
use clap::{Parser, Subcommand};
use crate::relay::RelayCommand;
#[derive(Parser)]
#[command(
name = "life",
about = "Agent Operating System — deploy, configure, and manage agents",
version,
propagate_version = true
)]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Command>,
}
#[derive(Subcommand)]
pub enum Command {
/// Initialize a .life/ directory in the current project.
Init,
/// Interactive setup wizard — configure providers, keys, and modules.
Setup,
/// Deploy an agent to a cloud target.
Deploy(DeployArgs),
/// Check the status of a deployed agent.
Status(StatusArgs),
/// List all deployed agents.
List(ListArgs),
/// Tear down a deployed agent and all its services.
Destroy(DestroyArgs),
/// Manage agent templates.
Templates(TemplateArgs),
/// Show cost tracking for a deployed agent.
Cost(CostArgs),
/// Stream logs from a deployed agent's services.
Logs(LogsArgs),
/// Scale agent services based on Autonomic economic modes.
Scale(ScaleArgs),
/// Manage the relay daemon for remote agent sessions.
Relay {
#[command(subcommand)]
command: RelayCommand,
},
}
#[derive(clap::Args)]
pub struct DeployArgs {
/// Agent template name (e.g., coding-agent, data-agent, support-agent).
#[arg(long, short)]
pub agent: String,
/// Deployment target (railway, flyio, ecs).
#[arg(long, short, default_value = "railway")]
pub target: String,
/// LLM provider for the agent runtime (anthropic, openai, mock).
#[arg(long, default_value = "anthropic")]
pub provider: String,
/// Custom project name override (defaults to life-{agent}).
#[arg(long)]
pub project_name: Option<String>,
/// Path to custom template file (overrides built-in templates).
#[arg(long)]
pub template_path: Option<String>,
/// Skip health check polling after deployment.
#[arg(long)]
pub no_wait: bool,
/// Environment variables to pass to all services (KEY=VALUE).
#[arg(long, short = 'e')]
pub env: Vec<String>,
}
#[derive(clap::Args)]
pub struct StatusArgs {
/// Agent name or Railway project ID.
#[arg(long, short)]
pub agent: String,
/// Deployment target.
#[arg(long, short, default_value = "railway")]
pub target: String,
/// Output format (table, json).
#[arg(long, default_value = "table")]
pub format: String,
}
#[derive(clap::Args)]
pub struct ListArgs {
/// Output format (table, json).
#[arg(long, default_value = "table")]
pub format: String,
}
#[derive(clap::Args)]
pub struct DestroyArgs {
/// Agent name or Railway project ID.
#[arg(long, short)]
pub agent: String,
/// Deployment target.
#[arg(long, short, default_value = "railway")]
pub target: String,
/// Skip confirmation prompt.
#[arg(long, short = 'y')]
pub yes: bool,
}
#[derive(clap::Args)]
pub struct TemplateArgs {
#[command(subcommand)]
pub command: TemplateCommand,
}
#[derive(Subcommand)]
pub enum TemplateCommand {
/// List available agent templates.
List,
/// Show details of a specific template.
Show {
/// Template name.
name: String,
},
}
#[derive(clap::Args)]
pub struct CostArgs {
/// Agent name.
#[arg(long, short)]
pub agent: String,
/// Deployment target.
#[arg(long, short, default_value = "railway")]
pub target: String,
/// Time window for cost data (1h, 24h, 7d, 30d).
#[arg(long, default_value = "24h")]
pub window: String,
/// Output format (table, json).
#[arg(long, default_value = "table")]
pub format: String,
}
#[derive(clap::Args)]
pub struct LogsArgs {
/// Agent name.
#[arg(long, short)]
pub agent: String,
/// Specific service to stream logs from (streams all if omitted).
#[arg(long, short)]
pub service: Option<String>,
/// Deployment target.
#[arg(long, short, default_value = "railway")]
pub target: String,
/// Number of recent log lines to show (0 = stream live only).
#[arg(long, short, default_value = "50")]
pub lines: u32,
}
#[derive(clap::Args)]
pub struct ScaleArgs {
/// Agent name.
#[arg(long, short)]
pub agent: String,
/// Service to scale (scales arcan by default).
#[arg(long, short, default_value = "arcan")]
pub service: String,
/// Number of replicas (overrides auto-scaling).
#[arg(long, short)]
pub replicas: Option<u32>,
/// Use Autonomic economic mode to determine scale.
/// Queries the Autonomic service and scales based on its recommendation.
#[arg(long)]
pub auto: bool,
/// Deployment target.
#[arg(long, short, default_value = "railway")]
pub target: String,
}