mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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.
This commit is contained in:
Vendored
+4
-4
@@ -1,13 +1,13 @@
|
||||
Usage: coder [global-flags] <subcommand>
|
||||
|
||||
Coder v0.0.0-devel — A tool for provisioning self-hosted development environments with Terraform.
|
||||
- Start a Coder server:
|
||||
- Start a Coder server:
|
||||
|
||||
[40m [0m[91;40m$ coder server[0m[40m [0m
|
||||
$ coder server
|
||||
|
||||
- Get started by creating a template from an example:
|
||||
- Get started by creating a template from an example:
|
||||
|
||||
[40m [0m[91;40m$ coder templates init[0m[40m [0m
|
||||
$ coder templates init
|
||||
|
||||
[1mSubcommands[0m
|
||||
config-ssh Add an SSH Host entry for your workspaces "ssh
|
||||
|
||||
+5
-5
@@ -2,14 +2,14 @@ Usage: coder config-ssh [flags]
|
||||
|
||||
Add an SSH Host entry for your workspaces "ssh coder.workspace"
|
||||
|
||||
- You can use -o (or --ssh-option) so set SSH options to be used for all your
|
||||
workspaces:
|
||||
- You can use -o (or --ssh-option) so set SSH options to be used for all your
|
||||
workspaces:
|
||||
|
||||
[40m [0m[91;40m$ coder config-ssh -o ForwardAgent=yes[0m[40m [0m
|
||||
$ coder config-ssh -o ForwardAgent=yes
|
||||
|
||||
- You can use --dry-run (or -n) to see the changes that would be made:
|
||||
- You can use --dry-run (or -n) to see the changes that would be made:
|
||||
|
||||
[40m [0m[91;40m$ coder config-ssh --dry-run[0m[40m [0m
|
||||
$ coder config-ssh --dry-run
|
||||
|
||||
[1mOptions[0m
|
||||
--coder-binary-path string, $CODER_SSH_CONFIG_BINARY_PATH
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ Usage: coder create [flags] [name]
|
||||
|
||||
Create a workspace
|
||||
|
||||
- Create a workspace for another user (if you have permission):
|
||||
- Create a workspace for another user (if you have permission):
|
||||
|
||||
[40m [0m[91;40m$ coder create <username>/<workspace_name>[0m[40m [0m
|
||||
$ coder create <username>/<workspace_name>
|
||||
|
||||
[1mOptions[0m
|
||||
--parameter string-array, $CODER_RICH_PARAMETER
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ Usage: coder dotfiles [flags] <git_repo_url>
|
||||
|
||||
Personalize your workspace by applying a canonical dotfiles repository
|
||||
|
||||
- Check out and install a dotfiles repository without prompts:
|
||||
- Check out and install a dotfiles repository without prompts:
|
||||
|
||||
[40m [0m[91;40m$ coder dotfiles --yes git@github.com:example/dotfiles.git[0m[40m [0m
|
||||
$ coder dotfiles --yes git@github.com:example/dotfiles.git
|
||||
|
||||
[1mOptions[0m
|
||||
-b, --branch string
|
||||
|
||||
+12
-12
@@ -5,27 +5,27 @@ forwarding, use "coder ssh -R".
|
||||
|
||||
Aliases: tunnel
|
||||
|
||||
- Port forward a single TCP port from 1234 in the workspace to port 5678 on
|
||||
your local machine:
|
||||
- Port forward a single TCP port from 1234 in the workspace to port 5678 on your
|
||||
local machine:
|
||||
|
||||
[40m [0m[91;40m$ coder port-forward <workspace> --tcp 5678:1234[0m[40m [0m
|
||||
$ coder port-forward <workspace> --tcp 5678:1234
|
||||
|
||||
- Port forward a single UDP port from port 9000 to port 9000 on your local
|
||||
machine:
|
||||
- Port forward a single UDP port from port 9000 to port 9000 on your local
|
||||
machine:
|
||||
|
||||
[40m [0m[91;40m$ coder port-forward <workspace> --udp 9000[0m[40m [0m
|
||||
$ coder port-forward <workspace> --udp 9000
|
||||
|
||||
- Port forward multiple TCP ports and a UDP port:
|
||||
- Port forward multiple TCP ports and a UDP port:
|
||||
|
||||
[40m [0m[91;40m$ coder port-forward <workspace> --tcp 8080:8080 --tcp 9000:3000 --udp 5353:53[0m[40m [0m
|
||||
$ coder port-forward <workspace> --tcp 8080:8080 --tcp 9000:3000 --udp 5353:53
|
||||
|
||||
- Port forward multiple ports (TCP or UDP) in condensed syntax:
|
||||
- Port forward multiple ports (TCP or UDP) in condensed syntax:
|
||||
|
||||
[40m [0m[91;40m$ coder port-forward <workspace> --tcp 8080,9000:3000,9090-9092,10000-10002:10010-10012[0m[40m [0m
|
||||
$ coder port-forward <workspace> --tcp 8080,9000:3000,9090-9092,10000-10002:10010-10012
|
||||
|
||||
- Port forward specifying the local address to bind to:
|
||||
- Port forward specifying the local address to bind to:
|
||||
|
||||
[40m [0m[91;40m$ coder port-forward <workspace> --tcp 1.2.3.4:8080:8080[0m[40m [0m
|
||||
$ coder port-forward <workspace> --tcp 1.2.3.4:8080:8080
|
||||
|
||||
[1mOptions[0m
|
||||
-p, --tcp string-array, $CODER_PORT_FORWARD_TCP
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ Override the stop time of a currently running workspace instance.
|
||||
* The new stop time must be at least 30 minutes in the future.
|
||||
* The workspace template may restrict the maximum workspace runtime.
|
||||
|
||||
[40m [0m[91;40m$ coder schedule override-stop my-workspace 90m[0m[40m [0m
|
||||
$ coder schedule override-stop my-workspace 90m
|
||||
|
||||
---
|
||||
Run `coder --help` for a list of global options.
|
||||
|
||||
+2
-2
@@ -12,9 +12,9 @@ Schedule format: <start-time> [day-of-week] [location].
|
||||
If omitted, we will fall back to either the TZ environment variable or /etc/localtime.
|
||||
You can check your corresponding location by visiting https://ipinfo.io - it shows in the demo widget on the right.
|
||||
|
||||
- Set the workspace to start at 9:30am (in Dublin) from Monday to Friday:
|
||||
- Set the workspace to start at 9:30am (in Dublin) from Monday to Friday:
|
||||
|
||||
[40m [0m[91;40m$ coder schedule start my-workspace 9:30AM Mon-Fri Europe/Dublin[0m[40m [0m
|
||||
$ coder schedule start my-workspace 9:30AM Mon-Fri Europe/Dublin
|
||||
|
||||
---
|
||||
Run `coder --help` for a list of global options.
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ When enabling scheduled stop, enter a duration in one of the following formats:
|
||||
* 2m (2 minutes)
|
||||
* 2 (2 minutes)
|
||||
|
||||
[40m [0m[91;40m$ coder schedule stop my-workspace 2h30m[0m[40m [0m
|
||||
$ coder schedule stop my-workspace 2h30m
|
||||
|
||||
---
|
||||
Run `coder --help` for a list of global options.
|
||||
|
||||
+5
-5
@@ -5,17 +5,17 @@ Manage templates
|
||||
Aliases: template
|
||||
|
||||
Templates are written in standard Terraform and describe the infrastructure for workspaces
|
||||
- Create a template for developers to create workspaces:
|
||||
- Create a template for developers to create workspaces:
|
||||
|
||||
[40m [0m[91;40m$ coder templates create[0m[40m [0m
|
||||
$ coder templates create
|
||||
|
||||
- Make changes to your template, and plan the changes:
|
||||
- Make changes to your template, and plan the changes:
|
||||
|
||||
[40m [0m[91;40m$ coder templates plan my-template[0m[40m [0m
|
||||
$ coder templates plan my-template
|
||||
|
||||
- Push an update to the template. Your developers can update their workspaces:
|
||||
|
||||
[40m [0m[91;40m$ coder templates push my-template[0m[40m [0m
|
||||
$ coder templates push my-template
|
||||
|
||||
[1mSubcommands[0m
|
||||
create Create a template from the current directory or as specified by
|
||||
|
||||
+2
-2
@@ -4,9 +4,9 @@ Manage different versions of the specified template
|
||||
|
||||
Aliases: version
|
||||
|
||||
- List versions of a specific template:
|
||||
- List versions of a specific template:
|
||||
|
||||
[40m [0m[91;40m$ coder templates versions list my-template[0m[40m [0m
|
||||
$ coder templates versions list my-template
|
||||
|
||||
[1mSubcommands[0m
|
||||
list List all the versions of the specified template
|
||||
|
||||
+6
-6
@@ -5,17 +5,17 @@ Manage personal access tokens
|
||||
Aliases: token
|
||||
|
||||
Tokens are used to authenticate automated clients to Coder.
|
||||
- Create a token for automation:
|
||||
- Create a token for automation:
|
||||
|
||||
[40m [0m[91;40m$ coder tokens create[0m[40m [0m
|
||||
$ coder tokens create
|
||||
|
||||
- List your tokens:
|
||||
- List your tokens:
|
||||
|
||||
[40m [0m[91;40m$ coder tokens ls[0m[40m [0m
|
||||
$ coder tokens ls
|
||||
|
||||
- Remove a token by ID:
|
||||
- Remove a token by ID:
|
||||
|
||||
[40m [0m[91;40m$ coder tokens rm WuoWs4ZsMX[0m[40m [0m
|
||||
$ coder tokens rm WuoWs4ZsMX
|
||||
|
||||
[1mSubcommands[0m
|
||||
create Create a token
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ platform
|
||||
|
||||
Aliases: active
|
||||
|
||||
[40m [0m[91;40m$ coder users activate example_user[0m[40m [0m
|
||||
$ coder users activate example_user
|
||||
|
||||
[1mOptions[0m
|
||||
-c, --column string-array (default: username,email,created_at,status)
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ Usage: coder users show [flags] <username|user_id|'me'>
|
||||
|
||||
Show a single user. Use 'me' to indicate the currently authenticated user.
|
||||
|
||||
[40m [0m[91;40m$ coder users show me[0m[40m [0m
|
||||
$ coder users show me
|
||||
|
||||
[1mOptions[0m
|
||||
-o, --output string (default: table)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ platform
|
||||
|
||||
Aliases: rm, delete
|
||||
|
||||
[40m [0m[91;40m$ coder users suspend example_user[0m[40m [0m
|
||||
$ coder users suspend example_user
|
||||
|
||||
[1mOptions[0m
|
||||
-c, --column string-array (default: username,email,created_at,status)
|
||||
|
||||
Reference in New Issue
Block a user