Skip to content

Commit ae4e19c

Browse files
committed
Add CLI guide and instructions
1 parent fd5313c commit ae4e19c

File tree

4 files changed

+329
-20
lines changed

4 files changed

+329
-20
lines changed

.gitignore

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
# Dependencies
2-
/node_modules
3-
4-
# Production
5-
.vitepress/dist
6-
7-
# Generated files
8-
.cache-loader
9-
.vitepress/cache
10-
11-
# Misc
12-
.DS_Store
13-
.env.local
14-
.env.development.local
15-
.env.test.local
16-
.env.production.local
17-
18-
npm-debug.log*
19-
yarn-debug.log*
20-
yarn-error.log*
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
.vitepress/dist
6+
7+
# Generated files
8+
.cache-loader
9+
.vitepress/cache
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
21+
22+
notes/

.vitepress/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ const VITEPRESS_CONFIG: UserConfig<DefaultTheme.Config> = {
167167
"json": "vscode-icons:file-type-json",
168168
".plugin.js": bdIcon,
169169
".theme.css": bdIcon,
170+
"homebrew": "https://brew.sh/assets/img/homebrew.svg",
171+
"go": "https://go.dev/images/favicon-gopher.svg",
172+
".go": "https://go.dev/images/favicon-gopher.svg",
173+
"winget": "vscode-icons:file-type-favicon",
170174
// TODO: consider adding platform icons
171175
},
172176
})

docs/users/getting-started/installation.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,74 @@ If you prefer a video tutorial, take a look at this:
4040

4141

4242

43+
## Command Line Installation
44+
45+
If you're comfortable using a terminal, the BetterDiscord CLI lets you install and update quickly. For full details, see the [CLI guide](../guides/cli).
46+
47+
### Install the CLI
48+
49+
Choose one of these methods:
50+
51+
::: code-group
52+
```bash [npm]
53+
npm install -g @betterdiscord/cli
54+
```
55+
56+
```bash [Homebrew]
57+
brew install betterdiscord/tap/bdcli
58+
```
59+
60+
61+
```bash [winget]
62+
winget install betterdiscord.cli
63+
```
64+
65+
```bash [Go]
66+
go install github.com/betterdiscord/cli@latest
67+
```
68+
69+
```bash [Binary]
70+
# Download the latest release for your platform
71+
# https://github.com/BetterDiscord/cli/releases
72+
```
73+
:::
74+
75+
### Install BetterDiscord
76+
77+
Most people can use the Stable channel:
78+
79+
```bash
80+
bdcli install --channel stable
81+
```
82+
83+
Other channels are available too:
84+
85+
```bash
86+
bdcli install --channel ptb
87+
bdcli install --channel canary
88+
```
89+
90+
If Discord is installed in a custom location, point to it directly:
91+
92+
```bash
93+
bdcli install --path /path/to/Discord
94+
```
95+
96+
97+
Notes:
98+
- If neither `--path` nor `--channel` is specified, it defaults to Stable.
99+
- The `--path` and `--channel` flags are mutually exclusive.
100+
101+
102+
43103
## Manual Installation
44104

105+
::: danger
106+
107+
This section is primarily meant for developers and contributors to BetterDiscord. Users should only do this as a last resort.
108+
109+
:::
110+
45111
For those that can't get the automatic installers to work, those that want more control over their installation, and for developers.
46112

47113
### Prerequisites

docs/users/guides/cli.md

Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
---
2+
order: 3
3+
description: Control BetterDiscord from the command line.
4+
---
5+
6+
7+
# BetterDiscord CLI
8+
9+
A cross-platform command-line interface for installing, updating, and managing [BetterDiscord](https://betterdiscord.app/).
10+
11+
## Features
12+
13+
- 🚀 Easy installation and uninstallation of BetterDiscord
14+
- 🔄 Support for multiple Discord channels (Stable, PTB, Canary)
15+
- 🖥️ Cross-platform support (Windows, macOS, Linux)
16+
- 📦 Available via npm for easy distribution
17+
- ⚡ Fast and lightweight Go binary
18+
19+
## Installation
20+
21+
### Via npm
22+
23+
```bash
24+
npm install -g @betterdiscord/cli
25+
```
26+
27+
### Via Homebrew/Linuxbrew
28+
29+
```bash
30+
brew install betterdiscord/tap/bdcli
31+
```
32+
33+
### Via winget (Windows)
34+
35+
```bash
36+
winget install betterdiscord.cli
37+
```
38+
39+
### Via Go
40+
41+
```bash
42+
go install github.com/betterdiscord/cli@latest
43+
```
44+
45+
### Download Binary
46+
47+
Download the latest release for your platform from the [releases page](https://github.com/BetterDiscord/cli/releases).
48+
49+
## Commands
50+
51+
### Install
52+
53+
Install BetterDiscord to your Discord installation.
54+
55+
#### By Channel
56+
57+
Auto-detect Discord installation based on the release channel:
58+
59+
```bash
60+
bdcli install --channel stable # Install to Discord Stable (default)
61+
bdcli install --channel ptb # Install to Discord PTB
62+
bdcli install --channel canary # Install to Discord Canary
63+
```
64+
65+
#### By Custom Path
66+
67+
Specify a custom path to any Discord installation:
68+
69+
```bash
70+
bdcli install --path /path/to/Discord
71+
# Or using short flag:
72+
bdcli install -p /path/to/Discord
73+
```
74+
75+
#### Notes
76+
77+
- If neither `--path` nor `--channel` is specified, it defaults to the Stable channel
78+
- The `--path` and `--channel` flags are mutually exclusive
79+
80+
### Uninstall
81+
82+
Remove BetterDiscord from your Discord installation.
83+
84+
#### By Channel
85+
86+
```bash
87+
bdcli uninstall --channel stable # Uninstall from Discord Stable (default)
88+
bdcli uninstall --channel ptb # Uninstall from Discord PTB
89+
bdcli uninstall --channel canary # Uninstall from Discord Canary
90+
```
91+
92+
#### By Custom Path
93+
94+
Specify a custom path to any Discord installation:
95+
96+
```bash
97+
bdcli uninstall --path /path/to/Discord
98+
# Or using short flag:
99+
bdcli uninstall -p /path/to/Discord
100+
```
101+
102+
#### Notes
103+
104+
- If neither `--path` nor `--channel` is specified, it defaults to the Stable channel
105+
- The `--path` and `--channel` flags are mutually exclusive
106+
107+
### Version
108+
109+
Display version information about the CLI:
110+
111+
```bash
112+
bdcli version
113+
```
114+
115+
Output example:
116+
```
117+
BetterDiscord CLI v1.0.0
118+
Commit: abc123def456
119+
Built: 2025-02-15T10:30:00Z
120+
```
121+
122+
### Completion
123+
124+
Generate shell completion scripts for bash, zsh, or fish:
125+
126+
```bash
127+
bdcli completion bash # Generate bash completion
128+
bdcli completion zsh # Generate zsh completion
129+
bdcli completion fish # Generate fish completion
130+
```
131+
132+
To enable completions, source the output in your shell configuration file.
133+
134+
## Help
135+
136+
Get help information about the CLI or any command:
137+
138+
```bash
139+
bdcli --help # Show general help
140+
bdcli [command] --help # Show help for a specific command
141+
```
142+
143+
### Available Commands
144+
145+
```
146+
A cross-platform CLI for installing, updating, and managing BetterDiscord.
147+
148+
Usage:
149+
bdcli [flags]
150+
bdcli [command]
151+
152+
Available Commands:
153+
completion Generate shell completions
154+
help Help about any command
155+
install Installs BetterDiscord to your Discord
156+
uninstall Uninstalls BetterDiscord from your Discord
157+
version Print the version number
158+
159+
Flags:
160+
-h, --help help for bdcli
161+
162+
Use "bdcli [command] --help" for more information about a command.
163+
```
164+
165+
## Supported Platforms
166+
167+
The CLI is available for multiple platforms and architectures:
168+
169+
- **Windows** (x64, ARM64, x86)
170+
- **macOS** (x64, ARM64/M1/M2)
171+
- **Linux** (x64, ARM64, ARM)
172+
173+
## Common Use Cases
174+
175+
### First Time Installation
176+
177+
1. **Install from stable channel (recommended):**
178+
```bash
179+
bdcli install
180+
```
181+
182+
2. **Or install to a specific channel:**
183+
```bash
184+
bdcli install --channel ptb
185+
```
186+
187+
### Using Multiple Discord Installations
188+
189+
You can manage multiple Discord installations by specifying custom paths:
190+
191+
```bash
192+
# Install to your custom Discord location
193+
bdcli install --path /opt/discord-custom
194+
195+
# Later, uninstall from the same location
196+
bdcli uninstall --path /opt/discord-custom
197+
```
198+
199+
### Verify Installation
200+
201+
After installing, you can verify the version of the CLI:
202+
203+
```bash
204+
bdcli version
205+
```
206+
207+
## Troubleshooting
208+
209+
### Discord Installation Not Found
210+
211+
If you get an error like "could not find a valid Discord installation":
212+
213+
1. **Check if Discord is installed** at the default location for your platform
214+
2. **Use custom path** if Discord is installed elsewhere:
215+
```bash
216+
bdcli install --path /your/custom/discord/path
217+
```
218+
219+
### Mutually Exclusive Flags
220+
221+
You cannot use both `--path` and `--channel` in the same command. Choose one:
222+
223+
```bash
224+
# ✅ Correct
225+
bdcli install --channel stable
226+
227+
# ✅ Correct
228+
bdcli install --path /custom/path
229+
230+
# ❌ Not allowed
231+
bdcli install --channel stable --path /custom/path
232+
```
233+
234+
## Additional Resources
235+
236+
- [GitHub Repository](https://github.com/BetterDiscord/cli)
237+
- [Releases Page](https://github.com/BetterDiscord/cli/releases)

0 commit comments

Comments
 (0)