Commit Graph

12 Commits

Author SHA1 Message Date
Aaron Lehmann 0e3dc2a80f
feat: influence parameter defaults through cli flag/env (#13039)
* feat: influence parameter defaults through cli flag/env

Add a --parameter-default flag / CODER_RICH_PARAMETER_DEFAULT
environment variable which overrides default values suggested for
parameters.

This allows scripts or middleware wrapping the CLI to substitute
defaults for parameter values beyond those defined at the template
level. For example, Git repository/branch parameters can be given
defaults based on the current checkout, or default parameter values can
be parsed out of files inside the repo.

* Rename defaults arg to defaultOverrides
2024-04-29 14:23:54 -04:00
Ammar Bandukwala 496232446d
chore(cli): replace clibase with external `coder/serpent` (#12252) 2024-03-15 11:24:38 -05:00
Marcin Tojek 61fac2dcfc
feat(cli): create workspace using parameters from existing workspace (#10604) 2023-11-09 19:22:47 +01:00
Cian Johnston 4277ca02e5
feat(cli): prompt for misspelled parameter names (#10350)
* feat(cli): add cliutil/levenshtein package
* feat(cli): attempt to catch misspelled parameter names
2023-11-06 13:44:39 +00:00
Jon Ayers 2dce4151ba
feat: add cli support for workspace automatic updates (#10438) 2023-11-02 14:41:34 -05: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
Marcin Tojek e845deaa89
fix: prompt when parameter options are incompatible (#9247) 2023-08-23 18:18:38 +02:00
Marcin Tojek a3d31268a3
fix(cli): do not ask for immutables on update (#9266) 2023-08-23 12:46:52 +02: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
Marcin Tojek 669ae9d4d3
fix(cli): remove prompt for immutable parameters on start and restart (#9173) 2023-08-18 14:06:46 +02:00
Marcin Tojek 9d9814c6b0
refactor(cli): adjust parameter resolver (#9019) 2023-08-10 12:08:00 +02:00
Marcin Tojek 0d382d1e05
feat(cli): provide parameter values via command line (#8898) 2023-08-09 13:00:25 +02:00