@@ -31,12 +31,12 @@ import (
31
31
"github.com/coder/coder/v2/agent/agentproc"
32
32
"github.com/coder/coder/v2/agent/reaper"
33
33
"github.com/coder/coder/v2/buildinfo"
34
- "github.com/coder/coder/v2/cli/clibase"
35
34
"github.com/coder/coder/v2/codersdk"
36
35
"github.com/coder/coder/v2/codersdk/agentsdk"
36
+ "github.com/coder/serpent"
37
37
)
38
38
39
- func (r * RootCmd ) workspaceAgent () * clibase .Cmd {
39
+ func (r * RootCmd ) workspaceAgent () * serpent .Cmd {
40
40
var (
41
41
auth string
42
42
logDir string
@@ -50,12 +50,12 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
50
50
slogJSONPath string
51
51
slogStackdriverPath string
52
52
)
53
- cmd := & clibase .Cmd {
53
+ cmd := & serpent .Cmd {
54
54
Use : "agent" ,
55
55
Short : `Starts the Coder workspace agent.` ,
56
56
// This command isn't useful to manually execute.
57
57
Hidden : true ,
58
- Handler : func (inv * clibase .Invocation ) error {
58
+ Handler : func (inv * serpent .Invocation ) error {
59
59
ctx , cancel := context .WithCancel (inv .Context ())
60
60
defer cancel ()
61
61
@@ -322,62 +322,62 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
322
322
},
323
323
}
324
324
325
- cmd .Options = clibase .OptionSet {
325
+ cmd .Options = serpent .OptionSet {
326
326
{
327
327
Flag : "auth" ,
328
328
Default : "token" ,
329
329
Description : "Specify the authentication type to use for the agent." ,
330
330
Env : "CODER_AGENT_AUTH" ,
331
- Value : clibase .StringOf (& auth ),
331
+ Value : serpent .StringOf (& auth ),
332
332
},
333
333
{
334
334
Flag : "log-dir" ,
335
335
Default : os .TempDir (),
336
336
Description : "Specify the location for the agent log files." ,
337
337
Env : "CODER_AGENT_LOG_DIR" ,
338
- Value : clibase .StringOf (& logDir ),
338
+ Value : serpent .StringOf (& logDir ),
339
339
},
340
340
{
341
341
Flag : "pprof-address" ,
342
342
Default : "127.0.0.1:6060" ,
343
343
Env : "CODER_AGENT_PPROF_ADDRESS" ,
344
- Value : clibase .StringOf (& pprofAddress ),
344
+ Value : serpent .StringOf (& pprofAddress ),
345
345
Description : "The address to serve pprof." ,
346
346
},
347
347
{
348
348
Flag : "no-reap" ,
349
349
350
350
Env : "" ,
351
351
Description : "Do not start a process reaper." ,
352
- Value : clibase .BoolOf (& noReap ),
352
+ Value : serpent .BoolOf (& noReap ),
353
353
},
354
354
{
355
355
Flag : "ssh-max-timeout" ,
356
356
// tcpip.KeepaliveIdleOption = 72h + 1min (forwardTCPSockOpts() in tailnet/conn.go)
357
357
Default : "72h" ,
358
358
Env : "CODER_AGENT_SSH_MAX_TIMEOUT" ,
359
359
Description : "Specify the max timeout for a SSH connection, it is advisable to set it to a minimum of 60s, but no more than 72h." ,
360
- Value : clibase .DurationOf (& sshMaxTimeout ),
360
+ Value : serpent .DurationOf (& sshMaxTimeout ),
361
361
},
362
362
{
363
363
Flag : "tailnet-listen-port" ,
364
364
Default : "0" ,
365
365
Env : "CODER_AGENT_TAILNET_LISTEN_PORT" ,
366
366
Description : "Specify a static port for Tailscale to use for listening." ,
367
- Value : clibase .Int64Of (& tailnetListenPort ),
367
+ Value : serpent .Int64Of (& tailnetListenPort ),
368
368
},
369
369
{
370
370
Flag : "prometheus-address" ,
371
371
Default : "127.0.0.1:2112" ,
372
372
Env : "CODER_AGENT_PROMETHEUS_ADDRESS" ,
373
- Value : clibase .StringOf (& prometheusAddress ),
373
+ Value : serpent .StringOf (& prometheusAddress ),
374
374
Description : "The bind address to serve Prometheus metrics." ,
375
375
},
376
376
{
377
377
Flag : "debug-address" ,
378
378
Default : "127.0.0.1:2113" ,
379
379
Env : "CODER_AGENT_DEBUG_ADDRESS" ,
380
- Value : clibase .StringOf (& debugAddress ),
380
+ Value : serpent .StringOf (& debugAddress ),
381
381
Description : "The bind address to serve a debug HTTP server." ,
382
382
},
383
383
{
@@ -386,23 +386,23 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
386
386
Flag : "log-human" ,
387
387
Env : "CODER_AGENT_LOGGING_HUMAN" ,
388
388
Default : "/dev/stderr" ,
389
- Value : clibase .StringOf (& slogHumanPath ),
389
+ Value : serpent .StringOf (& slogHumanPath ),
390
390
},
391
391
{
392
392
Name : "JSON Log Location" ,
393
393
Description : "Output JSON logs to a given file." ,
394
394
Flag : "log-json" ,
395
395
Env : "CODER_AGENT_LOGGING_JSON" ,
396
396
Default : "" ,
397
- Value : clibase .StringOf (& slogJSONPath ),
397
+ Value : serpent .StringOf (& slogJSONPath ),
398
398
},
399
399
{
400
400
Name : "Stackdriver Log Location" ,
401
401
Description : "Output Stackdriver compatible logs to a given file." ,
402
402
Flag : "log-stackdriver" ,
403
403
Env : "CODER_AGENT_LOGGING_STACKDRIVER" ,
404
404
Default : "" ,
405
- Value : clibase .StringOf (& slogStackdriverPath ),
405
+ Value : serpent .StringOf (& slogStackdriverPath ),
406
406
},
407
407
}
408
408
0 commit comments