Commit Graph

16 Commits

Author SHA1 Message Date
b8944074c4 chore: improve coder server ux (#14761) 2024-09-24 13:16:36 +10:00
14d3e300d3 fix: use ANSI colors codes instead of RGB (#14665)
* chore: add command for showing colors

* fix: use ANSI color codes instead of RGB

* feat: add '--no-color' flag

* fix: revert colors

* chore: change colors

* fix: update golden files

* fix: replace blue with brightBlue

* fix: drop '> ' for unfocused prompts

* fix: run 'make fmt'

* chore: allow disabling color with env flags

* fix: apply fixes from feedback

* fix: run 'make gen'

* fix: refactor janky code

* fix: re-add public function

* fix: re-add init for non-color tests

* fix: move styles to 'init' that can be

* fix: stop overwriting entire DefaultStyles

* fix: make code and field obey --no-color

* fix: rip out '--no-color' due to race condition

We still support `NO_COLOR` env variable through termenv's
`EnvColorProfile`. The reason for the race condition is that
`DefaultStyles` is a global that we shouldn't mutate after `init`
is called, but we have to mutate it after `init` has ran to have
serpent collect the cli flags and env vars for us.

* fix: apply nit

* fix: simplify code && hide command

* fix: newline shouldn't be themed

* fix: appease the linter
2024-09-17 14:21:24 +01:00
b63dfe7b75 perf(cli): optimize CPU consumption of help pages (#9607)
This change reduces the CPU consumption of --help by ~50%.

Also, this change removes ANSI escape codes from our golden files. I
don't think those were worth the inability to parallelize golden file tests and
global state fragility.
2023-09-14 19:48:29 -05:00
e361f1107b feat(cli): colorize help page (#9589) 2023-09-08 18:21:33 +00:00
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
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
6c0f37c28e fix: probably fix lipgloss race condition (#6784) 2023-03-24 21:24:51 +02:00
2bd6d2908e feat: convert entire CLI to clibase (#6491)
I'm sorry.
2023-03-23 17:42:20 -05:00
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
19fcf60864 ci: add typo detection (#3327)
And fix them.
2022-08-01 09:29:52 -04:00
16f0f1a2db 3293, cli: Updated Placeholder color to have a dark theme alt (#3294)
Co-authored-by: Ubuntu <ubuntu@ip-172-31-1-230.us-east-2.compute.internal>
2022-07-31 13:44:05 -05:00
2609be767d feat: add timestamps to output at end of some workspace and template subcommands (#2831) 2022-07-08 14:27:56 -05:00
92bcacebde cli/templateinit: add links to template READMEs (#2576)
- template init: add links to template docs
- examples: add URL field to examples, ensure that example fields are always non-empty
- cliui: bump wrap width to 80 from 58
2022-06-22 14:15:04 +00:00
fb9dc4f346 feat: Improve resource preview and first-time experience (#946)
* Improve CLI documentation

* feat: Allow workspace resources to attach multiple agents

This enables a "kubernetes_pod" to attach multiple agents that
could be for multiple services. Each agent is required to have
a unique name, so SSH syntax is:

`coder ssh <workspace>.<agent>`

A resource can have zero agents too, they aren't required.

* Add tree view

* Improve table UI

* feat: Allow workspace resources to attach multiple agents

This enables a "kubernetes_pod" to attach multiple agents that
could be for multiple services. Each agent is required to have
a unique name, so SSH syntax is:

`coder ssh <workspace>.<agent>`

A resource can have zero agents too, they aren't required.

* Rename `tunnel` to `skip-tunnel`

This command was `true` by default, which causes
a confusing user experience.

* Add disclaimer about editing templates

* Add help to template create

* Improve workspace create flow

* Add end-to-end test for config-ssh

* Improve testing of config-ssh

* Fix workspace list

* Fix config ssh tests

* Update cli/configssh.go

Co-authored-by: Cian Johnston <public@cianjohnston.ie>

* Fix requested changes

* Remove socat requirement

* Fix resources not reading in TTY

Co-authored-by: Cian Johnston <public@cianjohnston.ie>
2022-04-11 18:54:30 -05:00
b33dec9d38 feat: Add stage to build logs (#577)
* feat: Add stage to build logs

This adds a stage property to logs, and refactors the job logs
cliui.

It also adds tests to the cliui for build logs!

* Fix comments
2022-03-28 18:43:22 +00:00
c451f4e685 feat: Add templates to create working release (#422)
* Add templates

* Move API structs to codersdk

* Back to green tests!

* It all works, but now with tea! 🧋

* It works!

* Add cancellation to provisionerd

* Tests pass!

* Add deletion of workspaces and projects

* Fix agent lock

* Add clog

* Fix linting errors

* Remove unused CLI tests

* Rename daemon to start

* Fix leaking command

* Fix promptui test

* Update agent connection frequency

* Skip login tests on Windows

* Increase tunnel connect timeout

* Fix templater

* Lower test requirements

* Fix embed

* Disable promptui tests for Windows

* Fix write newline

* Fix PTY write newline

* Fix CloseReader

* Fix compilation on Windows

* Fix linting error

* Remove bubbletea

* Cleanup readwriter

* Use embedded templates instead of serving over API

* Move templates to examples

* Improve workspace create flow

* Fix Windows build

* Fix tests

* Fix linting errors

* Fix untar with extracting max size

* Fix newline char
2022-03-22 13:17:50 -06:00