@@ -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
@@ -51,12 +51,12 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
51
51
slogJSONPath string
52
52
slogStackdriverPath string
53
53
)
54
- cmd := & clibase .Cmd {
54
+ cmd := & serpent .Cmd {
55
55
Use : "agent" ,
56
56
Short : `Starts the Coder workspace agent.` ,
57
57
// This command isn't useful to manually execute.
58
58
Hidden : true ,
59
- Handler : func (inv * clibase .Invocation ) error {
59
+ Handler : func (inv * serpent .Invocation ) error {
60
60
ctx , cancel := context .WithCancel (inv .Context ())
61
61
defer cancel ()
62
62
@@ -326,20 +326,20 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
326
326
},
327
327
}
328
328
329
- cmd .Options = clibase .OptionSet {
329
+ cmd .Options = serpent .OptionSet {
330
330
{
331
331
Flag : "auth" ,
332
332
Default : "token" ,
333
333
Description : "Specify the authentication type to use for the agent." ,
334
334
Env : "CODER_AGENT_AUTH" ,
335
- Value : clibase .StringOf (& auth ),
335
+ Value : serpent .StringOf (& auth ),
336
336
},
337
337
{
338
338
Flag : "log-dir" ,
339
339
Default : os .TempDir (),
340
340
Description : "Specify the location for the agent log files." ,
341
341
Env : "CODER_AGENT_LOG_DIR" ,
342
- Value : clibase .StringOf (& logDir ),
342
+ Value : serpent .StringOf (& logDir ),
343
343
},
344
344
{
345
345
Flag : "script-data-dir" ,
@@ -352,43 +352,43 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
352
352
Flag : "pprof-address" ,
353
353
Default : "127.0.0.1:6060" ,
354
354
Env : "CODER_AGENT_PPROF_ADDRESS" ,
355
- Value : clibase .StringOf (& pprofAddress ),
355
+ Value : serpent .StringOf (& pprofAddress ),
356
356
Description : "The address to serve pprof." ,
357
357
},
358
358
{
359
359
Flag : "no-reap" ,
360
360
361
361
Env : "" ,
362
362
Description : "Do not start a process reaper." ,
363
- Value : clibase .BoolOf (& noReap ),
363
+ Value : serpent .BoolOf (& noReap ),
364
364
},
365
365
{
366
366
Flag : "ssh-max-timeout" ,
367
367
// tcpip.KeepaliveIdleOption = 72h + 1min (forwardTCPSockOpts() in tailnet/conn.go)
368
368
Default : "72h" ,
369
369
Env : "CODER_AGENT_SSH_MAX_TIMEOUT" ,
370
370
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." ,
371
- Value : clibase .DurationOf (& sshMaxTimeout ),
371
+ Value : serpent .DurationOf (& sshMaxTimeout ),
372
372
},
373
373
{
374
374
Flag : "tailnet-listen-port" ,
375
375
Default : "0" ,
376
376
Env : "CODER_AGENT_TAILNET_LISTEN_PORT" ,
377
377
Description : "Specify a static port for Tailscale to use for listening." ,
378
- Value : clibase .Int64Of (& tailnetListenPort ),
378
+ Value : serpent .Int64Of (& tailnetListenPort ),
379
379
},
380
380
{
381
381
Flag : "prometheus-address" ,
382
382
Default : "127.0.0.1:2112" ,
383
383
Env : "CODER_AGENT_PROMETHEUS_ADDRESS" ,
384
- Value : clibase .StringOf (& prometheusAddress ),
384
+ Value : serpent .StringOf (& prometheusAddress ),
385
385
Description : "The bind address to serve Prometheus metrics." ,
386
386
},
387
387
{
388
388
Flag : "debug-address" ,
389
389
Default : "127.0.0.1:2113" ,
390
390
Env : "CODER_AGENT_DEBUG_ADDRESS" ,
391
- Value : clibase .StringOf (& debugAddress ),
391
+ Value : serpent .StringOf (& debugAddress ),
392
392
Description : "The bind address to serve a debug HTTP server." ,
393
393
},
394
394
{
@@ -397,23 +397,23 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
397
397
Flag : "log-human" ,
398
398
Env : "CODER_AGENT_LOGGING_HUMAN" ,
399
399
Default : "/dev/stderr" ,
400
- Value : clibase .StringOf (& slogHumanPath ),
400
+ Value : serpent .StringOf (& slogHumanPath ),
401
401
},
402
402
{
403
403
Name : "JSON Log Location" ,
404
404
Description : "Output JSON logs to a given file." ,
405
405
Flag : "log-json" ,
406
406
Env : "CODER_AGENT_LOGGING_JSON" ,
407
407
Default : "" ,
408
- Value : clibase .StringOf (& slogJSONPath ),
408
+ Value : serpent .StringOf (& slogJSONPath ),
409
409
},
410
410
{
411
411
Name : "Stackdriver Log Location" ,
412
412
Description : "Output Stackdriver compatible logs to a given file." ,
413
413
Flag : "log-stackdriver" ,
414
414
Env : "CODER_AGENT_LOGGING_STACKDRIVER" ,
415
415
Default : "" ,
416
- Value : clibase .StringOf (& slogStackdriverPath ),
416
+ Value : serpent .StringOf (& slogStackdriverPath ),
417
417
},
418
418
}
419
419
0 commit comments