You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The official command line tool for [Boot.dev](https://www.boot.dev). It allows you to submit lessons and do other such nonsense.
7
+
This is the official command line tool for [Boot.dev](https://www.boot.dev/). It allows you to submit lessons and do other such nonsense.
8
8
9
9
⭐ Hit the repo with a star if you're enjoying Boot.dev ⭐
10
10
11
11
## Installation
12
12
13
13
### 1. Install Go
14
14
15
-
The Boot.dev CLI requires an up-to-date Golang installation, and only works on Linux and Mac. If you're on Windows, you'll need to use WSL. Make sure you install go in your Linux/WSL terminal, not your Windows terminal/UI. There are two options:
15
+
To use the Boot.dev CLI, you need an up-to-date Golang toolchain installed on your system.
16
16
17
-
**Option 1**: [The webi installer](https://webinstall.dev/golang/) is the simplest way for most people. Just run this in your terminal:
17
+
Please note, the overwhelming majority of our courses that use this CLI are designed to be completed on Linux or macOS – or on Linux-in-Windows via WSL. If you're on Windows, _usually_ what you'll want is to go into WSL and follow Linux installation instructions. However, we now have [at least one course](https://www.boot.dev/courses/learn-data-visualization-power-bi) that is Windows-native. So there are also Windows/PowerShell installation instructions below. Just be aware of which platform you're actually using!
18
+
19
+
There are two main installation methods that we recommend:
20
+
21
+
**Option 1 (Linux/WSL/macOS):** The [Webi installer](https://webinstall.dev/golang/) is the simplest way for most people. Just run this in your terminal:
18
22
19
23
```sh
20
-
# for linux/mac
21
24
curl -sS https://webi.sh/golang | sh
22
-
23
-
# for windows
24
-
curl.exe https://webi.ms/golang | powershell
25
25
```
26
26
27
27
_Read the output of the command and follow any instructions._
28
28
29
-
**Option 2**: Use the [official installation instructions](https://go.dev/doc/install).
29
+
**Option 2 (any platform, including Windows/PowerShell):** Use the [official Golang installation instructions](https://go.dev/doc/install). On Windows, this means downloading and running a `.msi` installer package; the rest should be taken care of automatically.
30
30
31
-
Run `go version` on your command line to make sure the installation worked. If it did, _move on to step 2_.
31
+
After installing Golang, _open a new shell session_ and run `go version`to make sure everything works. If it does, _move on to step 2_.
32
32
33
33
**Optional troubleshooting:**
34
34
35
-
- If you already had Go installed with webi, you should be able to run the same webi command to update it.
36
-
- If you already had a version of Go installed a different way, you can use`which go` to find out where it is installed, and remove the old version manually.
35
+
- If you already had Go installed with Webi, you should be able to run the same Webi command to update it.
36
+
- If you already had a version of Go installed a different way, on Linux/macOS you can run`which go` to find out where it's installed, and (if needed) remove the old version manually. (In PowerShell on Windows, the equivalent is `Get-Command go`.)
37
37
- If you're getting a "command not found" error after installation, it's most likely because the directory containing the `go` program isn't in your [`PATH`](https://opensource.com/article/17/6/set-path-linux). You need to add the directory to your `PATH` by modifying your shell's configuration file. First, you need to know _where_ the `go` command was installed. It might be in:
38
+
-`~/.local/opt/go/bin` (Webi)
39
+
-`/usr/local/go/bin` (official installation)
40
+
- Somewhere else?
38
41
39
-
-`~/.local/opt/go/bin` (webi)
40
-
-`/usr/local/go/bin` (official installation)
41
-
- Somewhere else?
42
-
43
-
You can ensure it exists by attempting to run `go` using its full filepath. For example, if you think it's in `~/.local/opt/go/bin`, you can run `~/.local/opt/go/bin/go version`. If that works, then you just need to add `~/.local/opt/go/bin` to your `PATH` and reload your shell:
42
+
You can ensure that the program exists by attempting to run `go` using its full filepath. For example, if you think it's in `~/.local/opt/go/bin`, you can run `~/.local/opt/go/bin/go version`. If that works, then you just need to add `~/.local/opt/go/bin` to your `PATH` and reload your shell:
This command will download, build, and install the `bootdev` command into your Go toolchain's `bin` directory. Go ahead and run it:
60
+
The following command will download, build, and install the `bootdev` command into your Go toolchain's `bin` directory. Go ahead and run it:
62
61
63
62
```sh
64
63
go install github.com/bootdotdev/bootdev@latest
@@ -73,14 +72,14 @@ If you're getting a "command not found" error for `bootdev help`, it's most like
73
72
```sh
74
73
# For Linux/WSL
75
74
echo'export PATH=$PATH:$HOME/go/bin'>>~/.bashrc
76
-
#next, reload your shell configuration
75
+
#Next, reload your shell configuration
77
76
source~/.bashrc
78
77
```
79
78
80
79
```sh
81
-
# For Mac OS
80
+
# For macOS
82
81
echo'export PATH=$PATH:$HOME/go/bin'>>~/.zshrc
83
-
#next, reload your shell configuration
82
+
#Next, reload your shell configuration
84
83
source~/.zshrc
85
84
```
86
85
@@ -98,7 +97,7 @@ All commands have `-h`/`--help` flags if you want to see available options on th
98
97
99
98
For lessons with HTTP tests, you can configure the CLI with a base URL that overrides any lesson's default. A common use case for that is when you want to run your server on a port other than the one specified in the lesson.
0 commit comments