Commit Graph

41 Commits

Author SHA1 Message Date
Ammar Bandukwala b4c0fa80d8
chore(cli): rename Cmd to Command (#12616)
I think Command is cleaner and my original decision to use "Cmd"
a mistake.

Plus this creates better parity with cobra.
2024-03-17 09:45:26 -05:00
Ammar Bandukwala 496232446d
chore(cli): replace clibase with external `coder/serpent` (#12252) 2024-03-15 11:24:38 -05:00
Cian Johnston eeef56a655
feat(cli): show workspace favorite status in list output (#11878) 2024-01-29 14:14:12 +00:00
Garrett Delfosse 3d54bc06f6
feat: display current version on coder list (#11450)
* feat: display current version on coder list

* fix make gen

* update golden
2024-01-05 15:33:08 -05:00
Cian Johnston a4f1319108
feat(cli): allow showing schedules for multiple workspaces (#10596)
* coder list: adds information about next start / stop to available columns (not default)
* coder schedule: show now essentially coder list with a different set of columns
* Updates cli schedule unit tests to use new dbfake

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
2023-11-10 13:51:49 +00:00
Cian Johnston 8a7f0e9eb9
refactor(cli): extract workspace list parameters (#10605)
Extracts the --search and --all parameters to a separate struct in cliui.
2023-11-09 12:16:43 +00:00
Ammar Bandukwala dd97fe2bce
chore(cli): replace lipgloss with coder/pretty (#9564)
This change will improve over CLI performance and "snappiness" as well as
substantially reduce our test times. Preliminary benchmarks show
`coder server --help` times cut from 300ms to 120ms on my dogfood
instance.

The inefficiency of lipgloss disproportionately impacts our system, as all help
text for every command is generated whenever any command is invoked.

The `pretty` API could clean up a lot of the code (e.g., by replacing
complex string concatenations with Printf), but this commit is too
expansive as is so that work will be done in a follow up.
2023-09-07 16:28:22 -05:00
Mathias Fredriksson ad23d33f28
refactor(coderd/schedule): move cron schedule to cron package (#9507)
This removes an indirect import of `coderd/database` from the CLI and
results in a logical separation between server related and generalized
schedule.

No size change (yet).

Ref: #9380
2023-09-04 16:48:25 +03:00
Ammar Bandukwala 6b8102cf4c
feat(cli): add daily_cost to `coder ls` (#9200) 2023-08-19 12:56:08 -05:00
Kyle Carberry 22e781eced
chore: add /v2 to import module path (#9072)
* chore: add /v2 to import module path

go mod requires semantic versioning with versions greater than 1.x

This was a mechanical update by running:
```
go install github.com/marwan-at-work/mod/cmd/mod@latest
mod upgrade
```

Migrate generated files to import /v2

* Fix gen
2023-08-18 18:55:43 +00:00
Mathias Fredriksson dfac0745f3
feat(cli): show workspace health in list (#8541)
Ref #6461
2023-07-17 15:04:06 +03:00
Ammar Bandukwala 5eaf809851
fix(cli): speed up CLI over SSH (#7885)
By caching the terminal's color profile, we avoid myriad round trips during command execution.
2023-06-07 05:22:58 +00:00
Ammar Bandukwala 2bd6d2908e
feat: convert entire CLI to clibase (#6491)
I'm sorry.
2023-03-23 17:42:20 -05:00
Dean Sheather 66a6b590a1
feat: add template max_ttl (#6114)
Co-authored-by: Bruno Quaresma <bruno@coder.com>
2023-03-07 14:14:58 +00:00
Dean Sheather d60ec3e4bf
feat: add JSON output format to many CLI commands (#6082) 2023-02-08 17:09:38 +00:00
Ammar Bandukwala 91973e1e88
cli: remove redundant client creation requests (#5264) 2022-12-02 15:40:23 -06:00
Steven Masley 894953db3d
fix: Workspace `ls` show only me by default (#5107) 2022-11-16 17:58:50 +00:00
Garrett Delfosse 88f3691dcc
feat: add count to get users endpoint (#5016) 2022-11-14 17:22:57 -05:00
Garrett Delfosse 766a2ad590
chore: refactor workspace count to single route (#4809)
Co-authored-by: Presley Pizzo <presley@coder.com>
2022-11-10 13:25:46 -05:00
Cian Johnston e6f568fcac
refactor: cli: address comments from #4240 (#4259) 2022-09-29 11:04:37 +01:00
Ali Diamond 0c75ea6286
feat: `coder ls` should show possible columns to filter by (#4240)
* added showing columns in help call, need to format to make pretty

* finished formatting column  strings for print of list /ls command

Co-authored-by: Ali Diamond <user@ali.dev>
2022-09-28 16:39:44 -04:00
Kyle Carberry 6f82ad09c8
fix: Improve consistency on CLI help (#4112)
This makes the english consistent on flags, and improves
the contrast for the placeholder color on dark themes.
2022-09-19 11:36:18 -05:00
Kyle Carberry 2b0fcf3ece
fix: Show the users workspaces by default on `coder ls` (#3947)
Fixes #3945.
2022-09-07 17:30:49 -05:00
Mathias Fredriksson 78a24941fe
feat: Add `codersdk.NullTime`, change workspace build deadline (#3552)
Fixes #2015

Co-authored-by: Joe Previte <jjprevite@gmail.com>
2022-08-25 19:10:42 +03:00
Steven Masley 6e496077ae
feat: Support search query and --me in workspace list (#3667) 2022-08-24 17:43:41 -04:00
Spike Curtis 184f0625e1
coder licenses add CLI command (#3632)
* coder licenses add CLI command

Signed-off-by: Spike Curtis <spike@coder.com>

* Fix up lint

Signed-off-by: Spike Curtis <spike@coder.com>

* Fix t.parallel call

Signed-off-by: Spike Curtis <spike@coder.com>

* Code review improvements

Signed-off-by: Spike Curtis <spike@coder.com>

* Lint

Signed-off-by: Spike Curtis <spike@coder.com>

Signed-off-by: Spike Curtis <spike@coder.com>
2022-08-23 13:55:39 -07:00
Dean Sheather 3610402cd8
Use new table formatter everywhere (#3544) 2022-08-19 02:41:00 +10:00
Mathias Fredriksson d7ec407a7c
fix: Improve coder list and show CLI help (#3167) 2022-07-25 16:56:20 +03:00
Abhineet Jain de1fc40000
fix: consistent workspace status b/w CLI and UI (#2743) 2022-07-01 14:40:03 +00:00
Cian Johnston c9691eafcb
feat: cli: consolidate schedule-related commands (#2402)
* feat: cli: consolidate schedule-related commands

This commit makes the following changes:
- renames autostart -> schedule starat
- renames ttl -> schedule stop
- renames bump -> schedule override
- adds schedule show command
- moves some cli-related stuff to util.go
2022-06-16 18:24:10 +01:00
Cian Johnston c28b7ecdf2
fix: coderd: decouple ttl and deadline (#2282)
This commit makes the following changes:

- Partially reverts the changes of feat: update workspace deadline when workspace ttl updated #2165, making the deadline of a running workspace build independant of TTL, once started.
- CLI: updating a workspace TTL no longer updates the deadline of the workspace.
- UI: updating a workspace TTL no longer updates the deadline of the workspace.
- Drive-by: API: When creating a workspace, default TTL to min(12 hours, template max_ttl) if not instructed otherwise.
- Drive-by: CLI: list: measure workspace extension correctly (+X in last column) from the time the provisioner job was completed
- Drive-by: WorkspaceSchedule: show timezone of schedule if it is set, defaulting to dayjs guess otherwise.
- Drive-by: WorkspaceScheduleForm: fixed an issue where deleting the "TTL" value in the form would show the text "Your workspace will shut down a few seconds after start".
2022-06-14 17:09:24 +01:00
Cian Johnston dcf03d8ba3
chore: refactor time.Duration -> int64 milliseconds for FE consumption (#1944)
* Changes all public-facing codersdk types to use a plain int64 (milliseconds) instead of time.Duration.
* Makes autostart_schedule a *string as it may not be present.
* Adds a utils/ptr package with some useful methods.
2022-06-02 11:23:34 +01:00
Cian Johnston ff542afe87
feat: allow bumping workspace deadline (#1828)
* Adds a `bump` command to extend workspace build deadline
 * Reduces WARN-level logging spam from autobuild executor
 * Modifies `cli/ssh` notifications to read from workspace build deadline and to notify relative time instead (sidestepping the problem of figuring out a user's timezone across multiple OSes)
 * Shows workspace extension time in `coder list` output e.g.
    ```
    WORKSPACE        TEMPLATE  STATUS   LAST BUILT  OUTDATED  AUTOSTART        TTL        
    developer/test1  docker    Running  4m          false     0 9 * * MON-FRI  15m (+5m)  
    ```
2022-05-27 20:04:33 +01:00
Cian Johnston d72c45e483
refactor: workspace autostop_schedule -> ttl (#1578)
Co-authored-by: G r e y <grey@coder.com>
2022-05-19 15:09:27 -04:00
Steven Masley 6c1117094d
chore: Force codersdk to not import anything from database (#1576)
* chore: Force codersdk to not import anything from database (linter rule)
* chore: Move all database types in codersdk out
2022-05-19 13:04:44 -05:00
Steven Masley a3556b12da
feat: Single query for all workspaces with optional filter (#1537)
* feat: Add single query for all workspaces using a filter
2022-05-18 10:09:07 -05:00
Cian Johnston b7049032a0
fix: cli: prettify schedule when printing output (#1440)
* Adds methods to schedule.Schedule to show the raw cron string and timezone
* Uses these methods to clean up output of auto(start|stop) show or ls
* Defaults CRON_TZ=UTC if not provided
2022-05-16 17:02:44 +01:00
Cian Johnston f970829b9e
feat: add autostart/autostop show, show autostart/autostop schedule in ls output (#1436)
* feat: add autostart/autostop show, show autostart/autostop schedule in ls output
2022-05-13 19:03:27 +00:00
Kyle Carberry e0a7aec228
fix: Match kubectl table style for simpler scripting (#1363)
Fixes #1322.
2022-05-10 15:57:07 -05:00
Kyle Carberry ddb9631d7a
fix: Group subcommands for cognitive ease (#1351) 2022-05-09 17:42:02 -05:00
Kyle Carberry c2b5009208
fix: Unnest workspaces command to the top-level (#1241)
This changes all "coder workspace *" commands to root.
A few of these were already at the root, like SSH. The
inconsistency made for a confusing experience.
2022-05-02 11:08:52 -05:00
Renamed from cli/workspacelist.go (Browse further)