- Notifications
You must be signed in to change notification settings - Fork928
Description
cc@johnstcn (thank you! 🙇🏽♂️)
subcommand naming
coder autostart enable
implies it just turns on autostart, not that it would update it too. For example, you wouldn't enable autostart multiple times. Perhapscoder autostart set
makes more sense?
restructured set syntax
I believe that we should use defaults only when they satisfy a majority of the use cases.
In the case of autostart, maybe 1 in 20 will use UTC, and maybe 1 in 3 want their workspace to start at 9am. I believe we should remove these defaults and force users to set their workspace schedule as follows:
coder autostart set <workspace> Mon-Fri 9:00AM America/Chicago
- If they omit timezone, we should infer it from the system
- If they omits days of week, we should set it to Mon-Sun
- Time of day is always required as I can't think of a reasonable default. Standard start times range from 7AM to 10AM
display schedule more clearly
In the current schedule print, the displayed time zone is extracted from the local system when the configured time zone may be different. There's also no acknowledgement of which days autostart is enabled for.
What we display here should closely map to how autostart is configured. I suggest this format:
$ coder autostart set ab Mon-Fri 9:00AM America/Chicago ab will automatically start on Mon, Tue, Wed, Thu, and Fri at 9:00AM America/Chicago
Acceptance Criteria
autostart enable|disable
->autostart set|unset
--autostart-hour --autostart-minute --autostart-dow
->HH:MM{AM|PM} [DOW] [TIMEZONE]
- DOW defaults
MON-SUNSUN-SAT Edit: our existing schedules assume Sunday is the first day of the week. - Require time-of-day
- DOW defaults
- CLI can infer timezone from system
- Linux (read
/etc/localtime
) - Darwin (read
/etc/localtime
) - Windows (Powershell, seehttps://superuser.com/a/1584968)
- Linux (read
- Updated
autostart show
output showing DOW and in configured autostart timezone