customrp-cli 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 KeiraOMG0
4
+ Copyright (c) 2020-2026 maximmax42 (CustomRP, whose features and preset format this follows)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,287 @@
1
+ Metadata-Version: 2.4
2
+ Name: customrp-cli
3
+ Version: 0.1.1
4
+ Summary: Custom Discord Rich Presence from the command line, configured with a TOML file. An independent alternative to CustomRP for Linux, macOS and Windows.
5
+ Author: KeiraOMG0
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/KeiraOMG0/customrp-cli
8
+ Project-URL: Documentation, https://github.com/KeiraOMG0/customrp-cli/tree/main/docs
9
+ Project-URL: Issues, https://github.com/KeiraOMG0/customrp-cli/issues
10
+ Keywords: discord,rich presence,rpc,customrp,cli
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: End Users/Desktop
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Topic :: Communications :: Chat
18
+ Requires-Python: >=3.9
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: customrp-core<0.2,>=0.1.2
22
+ Requires-Dist: tomli>=1.1; python_version < "3.11"
23
+ Provides-Extra: test
24
+ Requires-Dist: pytest>=7; extra == "test"
25
+ Dynamic: license-file
26
+
27
+ # customrp-cli
28
+
29
+ Show a custom Discord Rich Presence ("Playing ...", with your own text, images, buttons and timer) from
30
+ the command line, configured with a TOML file. It runs natively on **Linux**, **macOS** and **Windows**.
31
+
32
+ customrp-cli is a command-line alternative to [CustomRP](https://www.customrp.xyz), the Windows app by
33
+ maximmax42. It does what CustomRP does, minus the window. It's built on
34
+ [customrp-core](https://github.com/KeiraOMG0/customrp-core), a library that does the heavy lifting.
35
+
36
+ > **Independent project.** customrp-cli isn't made or maintained by CustomRP's developer, and isn't an
37
+ > official replacement. Please report problems [here](https://github.com/KeiraOMG0/customrp-cli/issues),
38
+ > not on the CustomRP repository.
39
+
40
+ ```console
41
+ $ customrp-cli init
42
+ Wrote /home/you/.config/customrp-cli/config.toml
43
+ $ nano ~/.config/customrp-cli/config.toml
44
+ $ customrp-cli run
45
+ 2026-01-01 12:00:00 INFO Starting customrp-cli 0.1.0 with /home/you/.config/customrp-cli/config.toml
46
+ 2026-01-01 12:00:00 INFO Connecting to Discord with application ID 896771305108553788
47
+ 2026-01-01 12:00:00 INFO Connected to /run/user/1000/discord-ipc-0
48
+ 2026-01-01 12:00:00 INFO Connected to Discord as you
49
+ 2026-01-01 12:00:00 INFO Presence updated
50
+ ```
51
+
52
+ ## Why
53
+
54
+ CustomRP is a Windows Forms application, so it only runs on Windows. Linux users have had to rely on Wine
55
+ or RPC bridges. The GUI is convenient, but the useful part, telling Discord what to show, doesn't need a
56
+ window. customrp-cli does that part natively, from a config file. That also makes it work on headless
57
+ setups, under a service manager, and in dotfiles.
58
+
59
+ ## Features
60
+
61
+ - Everything CustomRP can show: activity type (Playing, Listening, Watching, Competing), name, details
62
+ and state lines with optional links, party size, large and small images (asset names or URLs) with
63
+ tooltips and links, two buttons, and which field appears in the member list
64
+ - All five CustomRP timestamp modes: since last connection, since startup, since last update, local
65
+ time, and custom start/end (including countdowns)
66
+ - Live reload: save the config file and the presence updates within a second, without reconnecting
67
+ - Checks your config the way Discord will (length limits in bytes, one-character fields, broken URLs,
68
+ image URLs that are too long) and names the exact option at fault
69
+ - Waits for Discord: if Discord isn't running yet, it retries every 10 seconds, and reconnects if
70
+ Discord restarts
71
+ - Imports and exports CustomRP's `.crp` presets, so you can move presets between this and the Windows app
72
+ - Lists the art assets uploaded to your Discord application
73
+ - One instance per user, with `status` and `stop` commands that work on every platform
74
+ - Runs as a systemd user service, a launchd agent, or a Windows scheduled task; ready-made files are in
75
+ [`contrib/`](https://github.com/KeiraOMG0/customrp-cli/tree/main/contrib)
76
+ - No GUI, no Wine, and nothing beyond Python (plus `tomli` on Python 3.9 and 3.10)
77
+
78
+ ## How it differs from CustomRP
79
+
80
+ | CustomRP (Windows app) | customrp-cli |
81
+ |---|---|
82
+ | Window with text boxes and dropdowns | A TOML config file ([reference](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/configuration.md)) |
83
+ | Click "Update presence" | Save the file; it reloads automatically |
84
+ | Minimizes to the tray | Runs in a terminal or as a background service |
85
+ | "Run on startup" checkbox | systemd, launchd or Task Scheduler ([guide](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/running-in-the-background.md)) |
86
+ | Gives up after 30 attempts to reach Discord | Retries forever by default (`max_retries`) |
87
+ | Translated into many languages | English only for now |
88
+ | Built-in update checker | Update with `pipx upgrade customrp-cli` |
89
+
90
+ More in [docs/migrating-from-customrp.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/migrating-from-customrp.md).
91
+
92
+ ## Supported systems
93
+
94
+ | System | Status |
95
+ |---|---|
96
+ | Linux | Tests run in CI on Ubuntu, and were run on Ubuntu 24.04 (WSL), against a fake Discord over a real Unix socket, including running as a separate process. **Not yet tested against the real Discord client on Linux.** |
97
+ | Windows 10/11 | Tests run in CI and on Windows 11 against a fake Discord over a named pipe, including background mode with `pythonw`. The underlying library has completed a handshake with the real Discord client. |
98
+ | macOS | Tests run in CI on macOS against a fake Discord over a real Unix socket, including running as a separate process. **Not yet tested against the real Discord client on macOS**, and the launchd setup is untested. |
99
+
100
+ You need:
101
+
102
+ - Python 3.9 or newer
103
+ - The Discord **desktop** app (or a client that provides Discord's IPC socket, like Vesktop) running on
104
+ the same computer, as the same user. The browser version can't show Rich Presence from other programs.
105
+
106
+ ## Installation
107
+
108
+ The easiest way is [pipx](https://pipx.pypa.io), which puts customrp-cli in its own environment and
109
+ on your `PATH`:
110
+
111
+ ```sh
112
+ pipx install customrp-cli
113
+ ```
114
+
115
+ Don't have pipx? It needs Python 3.11 or newer. The short version:
116
+
117
+ | System | Command |
118
+ |---|---|
119
+ | macOS | `brew install pipx` |
120
+ | Ubuntu, Debian | `sudo apt install pipx` |
121
+ | Fedora | `sudo dnf install pipx` |
122
+ | Arch | `sudo pacman -S python-pipx` |
123
+ | Windows | `py -m pip install --user pipx` |
124
+
125
+ Then run `pipx ensurepath` (on Windows: `py -m pipx ensurepath`) and open a new terminal. Step-by-step
126
+ instructions for every system are in [docs/installation.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/installation.md#installing-pipx).
127
+
128
+ Or with a virtual environment and `requirements.txt`:
129
+
130
+ ```sh
131
+ git clone https://github.com/KeiraOMG0/customrp-cli.git
132
+ cd customrp-cli
133
+ python3 -m venv .venv
134
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
135
+ pip install -r requirements.txt # Installs customrp-core from GitHub
136
+ pip install .
137
+ ```
138
+
139
+ Plain `pip install customrp-cli` inside a virtual environment works too.
140
+
141
+ Details, including Windows notes and uninstalling, are in [docs/installation.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/installation.md).
142
+
143
+ ## Quick start
144
+
145
+ ```sh
146
+ customrp-cli init # Writes a config file with every option, then prints its path
147
+ # Edit the file: set details, state, images, buttons...
148
+ customrp-cli check # Points out mistakes
149
+ customrp-cli preview # Shows exactly what will be sent to Discord
150
+ customrp-cli run # Shows the presence until you press Ctrl+C
151
+ ```
152
+
153
+ To use your own application name and images, create an application in the
154
+ [Discord Developer Portal](https://discord.com/developers/applications) and put its ID in
155
+ `application_id`. CustomRP's [setup guide](https://docs.customrp.xyz/setting-up) walks through it.
156
+
157
+ ## Configuration
158
+
159
+ A minimal config:
160
+
161
+ ```toml
162
+ [presence]
163
+ application_id = "123456789012345678"
164
+ details = "Exploring the Linux desktop"
165
+ state = "Day 3"
166
+ timestamps = "since_startup"
167
+
168
+ [presence.large_image]
169
+ key = "penguin" # An asset name from your application, or an image URL
170
+ text = "Tux says hi"
171
+
172
+ [[presence.buttons]]
173
+ label = "My website"
174
+ url = "https://example.com"
175
+ ```
176
+
177
+ Every option is optional. [`examples/config.toml`](https://github.com/KeiraOMG0/customrp-cli/blob/main/examples/config.toml) is a complete, commented
178
+ example, and [docs/configuration.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/configuration.md) explains each option.
179
+
180
+ The config file is at:
181
+
182
+ | System | Default path |
183
+ |---|---|
184
+ | Linux | `~/.config/customrp-cli/config.toml` (or `$XDG_CONFIG_HOME/customrp-cli/`) |
185
+ | macOS | `~/Library/Application Support/customrp-cli/config.toml` |
186
+ | Windows | `%APPDATA%\customrp-cli\config.toml` |
187
+
188
+ Use another file with `-c path/to/file.toml`, or set `CUSTOMRP_CLI_CONFIG`.
189
+
190
+ ## Commands
191
+
192
+ | Command | Does |
193
+ |---|---|
194
+ | `customrp-cli init [--force]` | Create a config file listing every option |
195
+ | `customrp-cli check` | Check the config for mistakes (alias: `validate`) |
196
+ | `customrp-cli preview` | Print the activity that would be sent, as JSON |
197
+ | `customrp-cli run [--no-watch]` | Show the presence until stopped |
198
+ | `customrp-cli status` | Show whether it's running, its connection state and Discord user |
199
+ | `customrp-cli stop` | Stop the running instance |
200
+ | `customrp-cli import FILE.crp [--force]` | Replace the presence in the config with a CustomRP preset |
201
+ | `customrp-cli export FILE.crp [--force]` | Save the configured presence as a CustomRP preset |
202
+ | `customrp-cli assets [--application-id ID]` | List the images uploaded to your Discord application |
203
+ | `customrp-cli paths` | Show where the config and runtime files are |
204
+
205
+ Options for every command: `-c/--config FILE`, `-v/--verbose` (debug output), `-q/--quiet` (errors
206
+ only), `-h/--help`, plus `-V/--version`. Exit codes and more examples are in
207
+ [docs/commands.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/commands.md).
208
+
209
+ customrp-cli never asks questions or waits for input, so it's safe to use from scripts, cron and service
210
+ managers.
211
+
212
+ ## Running in the background
213
+
214
+ ```sh
215
+ # Linux (systemd), after installing with pipx:
216
+ mkdir -p ~/.config/systemd/user
217
+ curl -o ~/.config/systemd/user/customrp-cli.service \
218
+ https://raw.githubusercontent.com/KeiraOMG0/customrp-cli/main/contrib/systemd/customrp-cli.service
219
+ systemctl --user daemon-reload
220
+ systemctl --user enable --now customrp-cli
221
+ journalctl --user -u customrp-cli -f # Watch the log
222
+ ```
223
+
224
+ macOS (launchd) and Windows (Task Scheduler) are covered in
225
+ [docs/running-in-the-background.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/running-in-the-background.md).
226
+
227
+ ## Logging and troubleshooting
228
+
229
+ `run` logs to the terminal (stderr). Add `-v` to see every message exchanged with Discord, or set
230
+ `[logging] file` to also log to a file (rotated at 1 MB).
231
+
232
+ | Problem | Try |
233
+ |---|---|
234
+ | `Couldn't find a running Discord client` | Start the Discord desktop app. With Flatpak or Snap, see [troubleshooting](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/troubleshooting.md#discord-isnt-found). |
235
+ | `Discord returned an error (4000): Invalid Client ID` | `application_id` is wrong |
236
+ | Runs fine but nothing shows on your profile | In Discord: User Settings → Activity Privacy → turn on sharing your activity |
237
+ | `already running` | `customrp-cli status`, then `customrp-cli stop` |
238
+
239
+ More in [docs/troubleshooting.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/troubleshooting.md).
240
+
241
+ ## Known limitations
242
+
243
+ - English only.
244
+ - Only the presence settings are shared with CustomRP, through `.crp` presets; CustomRP's own settings
245
+ file isn't read.
246
+ - One instance per user. Showing two presences at once isn't supported.
247
+ - Discord's socket locations for Flatpak, Snap and Vesktop come from other Rich Presence projects and
248
+ haven't been verified here.
249
+ - Changes to `[connection]` and `[logging]` need a restart; `[presence]` changes apply live.
250
+
251
+ ## Documentation
252
+
253
+ [docs/](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/index.md): [installation](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/installation.md) · [configuration](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/configuration.md) ·
254
+ [commands](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/commands.md) · [background](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/running-in-the-background.md) ·
255
+ [troubleshooting](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/troubleshooting.md) · [migrating from CustomRP](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/migrating-from-customrp.md) ·
256
+ [design](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/design.md) · [development](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/development.md)
257
+
258
+ ## Running the tests
259
+
260
+ ```sh
261
+ pip install -e ".[test]"
262
+ pytest
263
+ ```
264
+
265
+ The tests don't need Discord; they use a fake Discord server from customrp-core. See
266
+ [docs/development.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/development.md).
267
+
268
+ ## Contributing
269
+
270
+ Issues and pull requests are welcome. Please:
271
+
272
+ - open an issue first for anything big
273
+ - add tests for behaviour changes (`pytest` must pass)
274
+ - keep it small: no new dependencies or abstractions without a concrete need
275
+ - put changes to how presences work in [customrp-core](https://github.com/KeiraOMG0/customrp-core),
276
+ and changes to the command line, config and running in this repository
277
+
278
+ ## Credits
279
+
280
+ - [CustomRP](https://github.com/maximmax42/Discord-CustomRP) by maximmax42 (MIT). The features, rules and
281
+ preset format come from it, and its developer was open to an independent alternative.
282
+ - CustomRP's default Discord application and its image proxy (`customrp.xyz/proxy`, used for Discord-hosted
283
+ images) belong to CustomRP's developer.
284
+
285
+ ## License
286
+
287
+ MIT. See [LICENSE](https://github.com/KeiraOMG0/customrp-cli/blob/main/LICENSE).
@@ -0,0 +1,261 @@
1
+ # customrp-cli
2
+
3
+ Show a custom Discord Rich Presence ("Playing ...", with your own text, images, buttons and timer) from
4
+ the command line, configured with a TOML file. It runs natively on **Linux**, **macOS** and **Windows**.
5
+
6
+ customrp-cli is a command-line alternative to [CustomRP](https://www.customrp.xyz), the Windows app by
7
+ maximmax42. It does what CustomRP does, minus the window. It's built on
8
+ [customrp-core](https://github.com/KeiraOMG0/customrp-core), a library that does the heavy lifting.
9
+
10
+ > **Independent project.** customrp-cli isn't made or maintained by CustomRP's developer, and isn't an
11
+ > official replacement. Please report problems [here](https://github.com/KeiraOMG0/customrp-cli/issues),
12
+ > not on the CustomRP repository.
13
+
14
+ ```console
15
+ $ customrp-cli init
16
+ Wrote /home/you/.config/customrp-cli/config.toml
17
+ $ nano ~/.config/customrp-cli/config.toml
18
+ $ customrp-cli run
19
+ 2026-01-01 12:00:00 INFO Starting customrp-cli 0.1.0 with /home/you/.config/customrp-cli/config.toml
20
+ 2026-01-01 12:00:00 INFO Connecting to Discord with application ID 896771305108553788
21
+ 2026-01-01 12:00:00 INFO Connected to /run/user/1000/discord-ipc-0
22
+ 2026-01-01 12:00:00 INFO Connected to Discord as you
23
+ 2026-01-01 12:00:00 INFO Presence updated
24
+ ```
25
+
26
+ ## Why
27
+
28
+ CustomRP is a Windows Forms application, so it only runs on Windows. Linux users have had to rely on Wine
29
+ or RPC bridges. The GUI is convenient, but the useful part, telling Discord what to show, doesn't need a
30
+ window. customrp-cli does that part natively, from a config file. That also makes it work on headless
31
+ setups, under a service manager, and in dotfiles.
32
+
33
+ ## Features
34
+
35
+ - Everything CustomRP can show: activity type (Playing, Listening, Watching, Competing), name, details
36
+ and state lines with optional links, party size, large and small images (asset names or URLs) with
37
+ tooltips and links, two buttons, and which field appears in the member list
38
+ - All five CustomRP timestamp modes: since last connection, since startup, since last update, local
39
+ time, and custom start/end (including countdowns)
40
+ - Live reload: save the config file and the presence updates within a second, without reconnecting
41
+ - Checks your config the way Discord will (length limits in bytes, one-character fields, broken URLs,
42
+ image URLs that are too long) and names the exact option at fault
43
+ - Waits for Discord: if Discord isn't running yet, it retries every 10 seconds, and reconnects if
44
+ Discord restarts
45
+ - Imports and exports CustomRP's `.crp` presets, so you can move presets between this and the Windows app
46
+ - Lists the art assets uploaded to your Discord application
47
+ - One instance per user, with `status` and `stop` commands that work on every platform
48
+ - Runs as a systemd user service, a launchd agent, or a Windows scheduled task; ready-made files are in
49
+ [`contrib/`](https://github.com/KeiraOMG0/customrp-cli/tree/main/contrib)
50
+ - No GUI, no Wine, and nothing beyond Python (plus `tomli` on Python 3.9 and 3.10)
51
+
52
+ ## How it differs from CustomRP
53
+
54
+ | CustomRP (Windows app) | customrp-cli |
55
+ |---|---|
56
+ | Window with text boxes and dropdowns | A TOML config file ([reference](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/configuration.md)) |
57
+ | Click "Update presence" | Save the file; it reloads automatically |
58
+ | Minimizes to the tray | Runs in a terminal or as a background service |
59
+ | "Run on startup" checkbox | systemd, launchd or Task Scheduler ([guide](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/running-in-the-background.md)) |
60
+ | Gives up after 30 attempts to reach Discord | Retries forever by default (`max_retries`) |
61
+ | Translated into many languages | English only for now |
62
+ | Built-in update checker | Update with `pipx upgrade customrp-cli` |
63
+
64
+ More in [docs/migrating-from-customrp.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/migrating-from-customrp.md).
65
+
66
+ ## Supported systems
67
+
68
+ | System | Status |
69
+ |---|---|
70
+ | Linux | Tests run in CI on Ubuntu, and were run on Ubuntu 24.04 (WSL), against a fake Discord over a real Unix socket, including running as a separate process. **Not yet tested against the real Discord client on Linux.** |
71
+ | Windows 10/11 | Tests run in CI and on Windows 11 against a fake Discord over a named pipe, including background mode with `pythonw`. The underlying library has completed a handshake with the real Discord client. |
72
+ | macOS | Tests run in CI on macOS against a fake Discord over a real Unix socket, including running as a separate process. **Not yet tested against the real Discord client on macOS**, and the launchd setup is untested. |
73
+
74
+ You need:
75
+
76
+ - Python 3.9 or newer
77
+ - The Discord **desktop** app (or a client that provides Discord's IPC socket, like Vesktop) running on
78
+ the same computer, as the same user. The browser version can't show Rich Presence from other programs.
79
+
80
+ ## Installation
81
+
82
+ The easiest way is [pipx](https://pipx.pypa.io), which puts customrp-cli in its own environment and
83
+ on your `PATH`:
84
+
85
+ ```sh
86
+ pipx install customrp-cli
87
+ ```
88
+
89
+ Don't have pipx? It needs Python 3.11 or newer. The short version:
90
+
91
+ | System | Command |
92
+ |---|---|
93
+ | macOS | `brew install pipx` |
94
+ | Ubuntu, Debian | `sudo apt install pipx` |
95
+ | Fedora | `sudo dnf install pipx` |
96
+ | Arch | `sudo pacman -S python-pipx` |
97
+ | Windows | `py -m pip install --user pipx` |
98
+
99
+ Then run `pipx ensurepath` (on Windows: `py -m pipx ensurepath`) and open a new terminal. Step-by-step
100
+ instructions for every system are in [docs/installation.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/installation.md#installing-pipx).
101
+
102
+ Or with a virtual environment and `requirements.txt`:
103
+
104
+ ```sh
105
+ git clone https://github.com/KeiraOMG0/customrp-cli.git
106
+ cd customrp-cli
107
+ python3 -m venv .venv
108
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
109
+ pip install -r requirements.txt # Installs customrp-core from GitHub
110
+ pip install .
111
+ ```
112
+
113
+ Plain `pip install customrp-cli` inside a virtual environment works too.
114
+
115
+ Details, including Windows notes and uninstalling, are in [docs/installation.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/installation.md).
116
+
117
+ ## Quick start
118
+
119
+ ```sh
120
+ customrp-cli init # Writes a config file with every option, then prints its path
121
+ # Edit the file: set details, state, images, buttons...
122
+ customrp-cli check # Points out mistakes
123
+ customrp-cli preview # Shows exactly what will be sent to Discord
124
+ customrp-cli run # Shows the presence until you press Ctrl+C
125
+ ```
126
+
127
+ To use your own application name and images, create an application in the
128
+ [Discord Developer Portal](https://discord.com/developers/applications) and put its ID in
129
+ `application_id`. CustomRP's [setup guide](https://docs.customrp.xyz/setting-up) walks through it.
130
+
131
+ ## Configuration
132
+
133
+ A minimal config:
134
+
135
+ ```toml
136
+ [presence]
137
+ application_id = "123456789012345678"
138
+ details = "Exploring the Linux desktop"
139
+ state = "Day 3"
140
+ timestamps = "since_startup"
141
+
142
+ [presence.large_image]
143
+ key = "penguin" # An asset name from your application, or an image URL
144
+ text = "Tux says hi"
145
+
146
+ [[presence.buttons]]
147
+ label = "My website"
148
+ url = "https://example.com"
149
+ ```
150
+
151
+ Every option is optional. [`examples/config.toml`](https://github.com/KeiraOMG0/customrp-cli/blob/main/examples/config.toml) is a complete, commented
152
+ example, and [docs/configuration.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/configuration.md) explains each option.
153
+
154
+ The config file is at:
155
+
156
+ | System | Default path |
157
+ |---|---|
158
+ | Linux | `~/.config/customrp-cli/config.toml` (or `$XDG_CONFIG_HOME/customrp-cli/`) |
159
+ | macOS | `~/Library/Application Support/customrp-cli/config.toml` |
160
+ | Windows | `%APPDATA%\customrp-cli\config.toml` |
161
+
162
+ Use another file with `-c path/to/file.toml`, or set `CUSTOMRP_CLI_CONFIG`.
163
+
164
+ ## Commands
165
+
166
+ | Command | Does |
167
+ |---|---|
168
+ | `customrp-cli init [--force]` | Create a config file listing every option |
169
+ | `customrp-cli check` | Check the config for mistakes (alias: `validate`) |
170
+ | `customrp-cli preview` | Print the activity that would be sent, as JSON |
171
+ | `customrp-cli run [--no-watch]` | Show the presence until stopped |
172
+ | `customrp-cli status` | Show whether it's running, its connection state and Discord user |
173
+ | `customrp-cli stop` | Stop the running instance |
174
+ | `customrp-cli import FILE.crp [--force]` | Replace the presence in the config with a CustomRP preset |
175
+ | `customrp-cli export FILE.crp [--force]` | Save the configured presence as a CustomRP preset |
176
+ | `customrp-cli assets [--application-id ID]` | List the images uploaded to your Discord application |
177
+ | `customrp-cli paths` | Show where the config and runtime files are |
178
+
179
+ Options for every command: `-c/--config FILE`, `-v/--verbose` (debug output), `-q/--quiet` (errors
180
+ only), `-h/--help`, plus `-V/--version`. Exit codes and more examples are in
181
+ [docs/commands.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/commands.md).
182
+
183
+ customrp-cli never asks questions or waits for input, so it's safe to use from scripts, cron and service
184
+ managers.
185
+
186
+ ## Running in the background
187
+
188
+ ```sh
189
+ # Linux (systemd), after installing with pipx:
190
+ mkdir -p ~/.config/systemd/user
191
+ curl -o ~/.config/systemd/user/customrp-cli.service \
192
+ https://raw.githubusercontent.com/KeiraOMG0/customrp-cli/main/contrib/systemd/customrp-cli.service
193
+ systemctl --user daemon-reload
194
+ systemctl --user enable --now customrp-cli
195
+ journalctl --user -u customrp-cli -f # Watch the log
196
+ ```
197
+
198
+ macOS (launchd) and Windows (Task Scheduler) are covered in
199
+ [docs/running-in-the-background.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/running-in-the-background.md).
200
+
201
+ ## Logging and troubleshooting
202
+
203
+ `run` logs to the terminal (stderr). Add `-v` to see every message exchanged with Discord, or set
204
+ `[logging] file` to also log to a file (rotated at 1 MB).
205
+
206
+ | Problem | Try |
207
+ |---|---|
208
+ | `Couldn't find a running Discord client` | Start the Discord desktop app. With Flatpak or Snap, see [troubleshooting](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/troubleshooting.md#discord-isnt-found). |
209
+ | `Discord returned an error (4000): Invalid Client ID` | `application_id` is wrong |
210
+ | Runs fine but nothing shows on your profile | In Discord: User Settings → Activity Privacy → turn on sharing your activity |
211
+ | `already running` | `customrp-cli status`, then `customrp-cli stop` |
212
+
213
+ More in [docs/troubleshooting.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/troubleshooting.md).
214
+
215
+ ## Known limitations
216
+
217
+ - English only.
218
+ - Only the presence settings are shared with CustomRP, through `.crp` presets; CustomRP's own settings
219
+ file isn't read.
220
+ - One instance per user. Showing two presences at once isn't supported.
221
+ - Discord's socket locations for Flatpak, Snap and Vesktop come from other Rich Presence projects and
222
+ haven't been verified here.
223
+ - Changes to `[connection]` and `[logging]` need a restart; `[presence]` changes apply live.
224
+
225
+ ## Documentation
226
+
227
+ [docs/](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/index.md): [installation](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/installation.md) · [configuration](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/configuration.md) ·
228
+ [commands](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/commands.md) · [background](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/running-in-the-background.md) ·
229
+ [troubleshooting](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/troubleshooting.md) · [migrating from CustomRP](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/migrating-from-customrp.md) ·
230
+ [design](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/design.md) · [development](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/development.md)
231
+
232
+ ## Running the tests
233
+
234
+ ```sh
235
+ pip install -e ".[test]"
236
+ pytest
237
+ ```
238
+
239
+ The tests don't need Discord; they use a fake Discord server from customrp-core. See
240
+ [docs/development.md](https://github.com/KeiraOMG0/customrp-cli/blob/main/docs/development.md).
241
+
242
+ ## Contributing
243
+
244
+ Issues and pull requests are welcome. Please:
245
+
246
+ - open an issue first for anything big
247
+ - add tests for behaviour changes (`pytest` must pass)
248
+ - keep it small: no new dependencies or abstractions without a concrete need
249
+ - put changes to how presences work in [customrp-core](https://github.com/KeiraOMG0/customrp-core),
250
+ and changes to the command line, config and running in this repository
251
+
252
+ ## Credits
253
+
254
+ - [CustomRP](https://github.com/maximmax42/Discord-CustomRP) by maximmax42 (MIT). The features, rules and
255
+ preset format come from it, and its developer was open to an independent alternative.
256
+ - CustomRP's default Discord application and its image proxy (`customrp.xyz/proxy`, used for Discord-hosted
257
+ images) belong to CustomRP's developer.
258
+
259
+ ## License
260
+
261
+ MIT. See [LICENSE](https://github.com/KeiraOMG0/customrp-cli/blob/main/LICENSE).
@@ -0,0 +1,47 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "customrp-cli"
7
+ dynamic = ["version"]
8
+ description = "Custom Discord Rich Presence from the command line, configured with a TOML file. An independent alternative to CustomRP for Linux, macOS and Windows."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "KeiraOMG0" }]
13
+ keywords = ["discord", "rich presence", "rpc", "customrp", "cli"]
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Environment :: Console",
17
+ "Intended Audience :: End Users/Desktop",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python :: 3",
21
+ "Topic :: Communications :: Chat",
22
+ ]
23
+ # requirements.txt installs the same customrp-core version from GitHub instead of PyPI
24
+ dependencies = [
25
+ "customrp-core>=0.1.2,<0.2",
26
+ "tomli>=1.1; python_version < '3.11'",
27
+ ]
28
+
29
+ [project.optional-dependencies]
30
+ test = ["pytest>=7"]
31
+
32
+ [project.scripts]
33
+ customrp-cli = "customrp_cli.cli:main"
34
+
35
+ [project.urls]
36
+ Homepage = "https://github.com/KeiraOMG0/customrp-cli"
37
+ Documentation = "https://github.com/KeiraOMG0/customrp-cli/tree/main/docs"
38
+ Issues = "https://github.com/KeiraOMG0/customrp-cli/issues"
39
+
40
+ [tool.setuptools.dynamic]
41
+ version = { attr = "customrp_cli.__version__" }
42
+
43
+ [tool.setuptools.packages.find]
44
+ where = ["src"]
45
+
46
+ [tool.pytest.ini_options]
47
+ testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """customrp-cli: custom Discord Rich Presence from the command line, configured with a TOML file."""
2
+
3
+ __version__ = "0.1.1"
@@ -0,0 +1,8 @@
1
+ """Entry point for ``python -m customrp_cli``."""
2
+
3
+ import sys
4
+
5
+ from customrp_cli.cli import main
6
+
7
+ if __name__ == "__main__":
8
+ sys.exit(main())