@helyx/cli 1.2.3 → 1.4.1

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.
@@ -10,7 +10,8 @@ DISCORD_CLIENT_ID=12345678901234567
10
10
  # requires message content and it is enabled in the Discord developer portal.
11
11
  HELYX_MESSAGE_CONTENT_ENABLED=false
12
12
  # Enhanced Auto Moderation stays inside this bot process. One worker is the
13
- # recommended default; increase only after measuring local CPU and memory.
13
+ # recommended default (range 1-4); increase only after measuring CPU and memory.
14
+ # Hosted scanning uses the separate Helyx Ecko service, not these settings.
14
15
  HELYX_AUTOMOD_EMBEDDED_WORKERS=1
15
16
  # Optional conservative queue overrides (hard ceilings: 5000 items, 64 MiB,
16
17
  # 100 items per server). Defaults are used when these remain commented.
@@ -18,13 +19,19 @@ HELYX_AUTOMOD_EMBEDDED_WORKERS=1
18
19
  # HELYX_AUTOMOD_EMBEDDED_QUEUE_BYTES=67108864
19
20
  # HELYX_AUTOMOD_EMBEDDED_QUEUE_ITEMS_PER_GUILD=100
20
21
  # HELYX_AUTOMOD_EMBEDDED_REFRESH_SECONDS=300
21
- # Enable only when member inspection modules are loaded and the Discord Server
22
- # Members Intent is enabled in the Discord developer portal.
22
+ # Enable for loaded member workflows such as Welcome, Access Control or Levels,
23
+ # with Server Members Intent also enabled in the Discord developer portal.
23
24
  HELYX_GUILD_MEMBERS_ENABLED=false
24
25
  # Database
25
26
  # Docker: keep the URL. Direct Node.js/managed hosting: use your provider URL.
27
+ DATABASE_ENGINE=postgresql
26
28
  DATABASE_URL=postgresql://database:5432/helyx
27
29
  DATABASE_SSL=disable
30
+ # Self-host startup applies pending migrations automatically (the default).
31
+ # Hosted-only inspect mode is not a self-host setting; leave this commented.
32
+ # HELYX_DATABASE_STARTUP_MODE=apply
33
+ # Match your provider: disable=no TLS; require=TLS without certificate
34
+ # verification; verify-full=TLS with certificate verification.
28
35
 
29
36
  # Included Docker database — both password values must match.
30
37
  PGUSER=helyx
@@ -51,8 +58,8 @@ LOG_LEVEL=info
51
58
  # SHARDING: OFF BY DEFAULT
52
59
 
53
60
  # `off` is the compatible self-host default. Keep shard-only values commented
54
- # in this mode; an empty value is still rejected as configured. Advanced local
55
- # self-hosting may use `auto` to obtain Discord's recommendation under one
61
+ # in this mode; an empty value is still rejected as configured. MySQL must stay
62
+ # off. Advanced PostgreSQL self-hosting may use `auto` under one
56
63
  # supervisor, or `fixed` with a deliberate total count. Local mode never needs
57
64
  # Redis. Coordinated multi-host self-hosting is outside the first release.
58
65
  HELYX_SHARD_MODE=off
@@ -80,18 +87,15 @@ HELYX_SHARD_MODE=off
80
87
  HELYX_HOSTED_MODERATION_ENABLED=false
81
88
 
82
89
  # Guild command writes remain off until explicitly enabled for known guild IDs.
90
+ # For enabled-module server commands, set writes=true, retain allowlist scope,
91
+ # add comma-separated Discord server IDs below, and use global mode platform-only.
92
+ # See README.md before changing these defaults. Legacy mode still allows globals.
83
93
  HELYX_GUILD_COMMAND_WRITES_ENABLED=false
84
94
  HELYX_GUILD_COMMAND_WRITE_SCOPE=allowlist
85
95
  # HELYX_GUILD_COMMAND_RELEASE_ID=
86
96
  HELYX_GLOBAL_COMMAND_MODE=legacy
87
97
  # HELYX_GUILD_COMMAND_WRITE_GUILD_IDS=
88
98
 
89
- # Privacy tooling ships with self-hosted Helyx but stays disabled until the
90
- # dedicated least-privilege executor connection has been configured.
91
- HELYX_PRIVACY_ENABLED=false
92
- # HELYX_PRIVACY_EXECUTOR_DATABASE_URL=<dedicated-privacy-executor-postgresql-url>
93
- # HELYX_PRIVACY_EXECUTOR_DATABASE_SSL=disable
94
-
95
99
  # Alternative Cloud Connect enrolment — the Discord command is preferred
96
100
  # HELYX_CLOUD_ENROLMENT_TOKEN=replace-with-a-short-lived-enrolment-code
97
101
  # HELYX_CLOUD_ENROLMENT_FILE=./helyx.cloud-enrolment.json
@@ -10,6 +10,12 @@ operator runbooks, and module-authoring instructions. It is replaced when the
10
10
  bot package is updated, so keep deployment-specific notes outside
11
11
  `node_modules`.
12
12
 
13
+ Begin with this generated project's `README.md` to choose Node.js, Docker
14
+ Compose or managed hosting. Use the installed runbooks for doctor, updates and
15
+ backup/recovery; commands for a Helyx source checkout do not apply to this
16
+ compiled-package starter. Check the release's fresh-install/upgrade boundary
17
+ before using an existing database.
18
+
13
19
  The generated project's `.env.example` is the active configuration template.
14
20
  Never add the real `.env` file, credentials, database dumps, or private logs to
15
21
  a support bundle or source repository.
@@ -12,4 +12,4 @@ ENV NODE_ENV=production
12
12
 
13
13
  USER node
14
14
 
15
- CMD ["npm", "start"]
15
+ CMD ["node", "node_modules/@helyx/cli/dist/cli.js", "start"]
@@ -1,6 +1,6 @@
1
1
  # Helyx Self-Hosted starter
2
2
 
3
- This self-host starter was generated from the reviewed Helyx catalogue. It contains deployment configuration and exact npm dependencies, not Helyx source code or credentials.
3
+ This self-host starter was generated from the reviewed Helyx catalogue. It contains deployment configuration and exact npm dependencies, not Helyx source code or credentials. Both PostgreSQL and MySQL-compatible database adapters are included; `DATABASE_ENGINE` selects the active adapter and defaults to `postgresql` when omitted.
4
4
 
5
5
  ## Selected modules
6
6
 
@@ -15,42 +15,81 @@ The matching offline operator and module-author documentation is listed in
15
15
 
16
16
  - A Discord application and bot token
17
17
  - One of the supported runtime paths below
18
- - PostgreSQL 17 or another currently supported PostgreSQL release, supplied by your chosen path
18
+ - One supported PostgreSQL or MySQL-compatible database, supplied by your chosen path
19
19
  - A safe backup location for the database and this project's lockfile
20
20
 
21
21
  ## Choose a runtime path
22
22
 
23
23
  ### Node.js and PowerShell or another shell
24
24
 
25
- Use this path on a local machine or VPS without Docker. It requires Node.js `>=24 <27`, npm `>=11`, and a local or hosted PostgreSQL database. Helyx does not require Docker, but PostgreSQL remains mandatory.
25
+ Use this path on a local machine or VPS without Docker. It requires Node.js `>=24 <27`, npm `>=11`, and one local or hosted supported database. Helyx does not require Docker.
26
26
 
27
27
  1. Run `npm ci`.
28
- 2. Run `npm run setup`. Helyx creates `.env` from the supplied example and generates its private local data-encryption key. Repeating setup never replaces an existing key or configuration value.
29
- 3. Edit `.env`, replace every placeholder and set `DATABASE_URL` for your PostgreSQL server.
28
+ 2. Run `npm run setup`. Helyx creates `.env` when needed and fills a missing, blank or example data-encryption key. It preserves other existing configuration and a non-placeholder key.
29
+ 3. Edit `.env`, replace every placeholder, set `DATABASE_ENGINE` to `postgresql` or `mysql`, and set the matching `DATABASE_URL`. Omitting `DATABASE_ENGINE` selects PostgreSQL.
30
30
  4. Set `DATABASE_SSL=disable` for a trusted local connection, or `require`/`verify-full` according to your database provider.
31
31
  5. Run `npm run doctor`.
32
32
  6. Run `npm start`.
33
33
 
34
+ The starter uses compiled npm packages and has no local `npm run build` step.
35
+ For this path, replace Docker-only addresses such as `database` with your
36
+ reachable database hostname before running doctor.
37
+
38
+ Percent-encode special characters in database URL credentials. Confirm the
39
+ provider's actual TLS requirements before startup: `disable` uses no TLS,
40
+ `require` encrypts the connection without verifying the server certificate, and
41
+ `verify-full` also verifies the certificate. Prefer `verify-full` for a remote
42
+ database when the provider's certificate is trusted; do not disable verification
43
+ just to hide a connection error. A generated MySQL starter initially uses
44
+ `require`, which is a template value, not proof of the provider's requirements.
45
+
34
46
  ### Docker Compose
35
47
 
36
48
  Use this path when Docker with Compose support is available. The included configuration runs both Helyx and PostgreSQL 17.
37
49
 
50
+ Complete setup and credentials first. Before the start command below, run the
51
+ container doctor preflight that follows the numbered steps; a host-shell doctor
52
+ cannot normally resolve a container-only hostname such as `database`.
53
+
38
54
  1. Run `npm ci`, then `npm run setup`. This creates the local configuration and data-encryption key safely; the bot itself will still run in Docker.
39
55
  2. Edit `.env` and replace all placeholder credentials and passwords.
40
- 3. Keep the supplied internal `DATABASE_URL` and `DATABASE_SSL=disable`.
56
+ 3. Keep `DATABASE_ENGINE=postgresql` with the supplied internal `DATABASE_URL` and `DATABASE_SSL=disable`.
41
57
  4. Run `docker compose up --build -d`.
42
58
  5. Review startup with `docker compose logs -f bot`.
43
59
  6. Stop services with `docker compose down`. Do not add `--volumes` unless you deliberately intend to delete the database volume.
44
60
 
61
+ For the doctor preflight, build the bot image:
62
+
63
+ ```sh
64
+ docker compose build bot
65
+ ```
66
+
67
+ If the generated `compose.yaml` includes the PostgreSQL `database` service,
68
+ start it with `docker compose up -d --wait database`. A MySQL starter has no
69
+ database service; make its external database reachable instead. Then validate
70
+ inside the bot image before starting it:
71
+
72
+ ```sh
73
+ docker compose run --rm bot node node_modules/@helyx/cli/dist/cli.js doctor
74
+ ```
75
+
76
+ The container starts the Helyx CLI directly through Node so Docker stop signals
77
+ reach the bot's shutdown handlers. Local hosting still uses `npm start`.
78
+
45
79
  ### Managed bot hosting
46
80
 
47
- Use this path when a provider installs npm packages and runs the package start script for you. Configure `npm start` as the start command and supply every required variable through the provider's environment or variables panel. Use a PostgreSQL database reachable from that provider. A local `.env` file is not required when the host supplies the variables. Generate `HELYX_DATA_ENCRYPTION_KEY` once with `node -e "console.log(require('node:crypto').randomBytes(32).toString('base64'))"`, store it in the provider's secret-variable panel and retain it across every restart and deployment.
81
+ Use this path when a provider installs npm packages and runs the package start script for you. Configure `npm start` as the start command and supply every required variable through the provider's environment or variables panel. Set `DATABASE_ENGINE` and a matching database URL reachable from that provider; omitting the engine keeps PostgreSQL. A local `.env` file is not required when the host supplies the variables. Generate `HELYX_DATA_ENCRYPTION_KEY` once with `node -e "console.log(require('node:crypto').randomBytes(32).toString('base64'))"`, store it in the provider's secret-variable panel and retain it across every restart and deployment.
48
82
 
49
83
  That key is also required when Giveaways is selected. Do not rotate it while a
50
84
  giveaway draw is in progress because it protects resumable selection
51
85
  checkpoints.
52
86
 
53
- If a provider cannot run `npm ci`, execute `npm start`, or connect to PostgreSQL, it cannot run this Helyx starter. A future hosting-specific download may package additional provider files, but it cannot remove the PostgreSQL requirement.
87
+ If a provider cannot run `npm ci`, execute `npm start`, or connect to the selected database, it cannot run this Helyx starter.
88
+
89
+ Run `npm run doctor` through the provider's console or one-off command facility
90
+ with the same protected variables before enabling its start process. Run future
91
+ installation and validation commands through the provider's supported process;
92
+ do not assume a local `.env` file is required.
54
93
 
55
94
  ## Discord setup
56
95
 
@@ -58,38 +97,118 @@ If a provider cannot run `npm ci`, execute `npm start`, or connect to PostgreSQL
58
97
  2. Copy the application ID into `DISCORD_CLIENT_ID`. Generate a bot token and place it directly in `.env` or the host's variables panel; never place that token in Discord, Git, screenshots or support messages.
59
98
  3. Install the bot using both the `bot` and `applications.commands` scopes. Review the permissions required by your selected modules and grant only what you intend; administrator access is convenient but not required by Helyx core.
60
99
 
100
+ Enable privileged intents only when selected features need them, in both the
101
+ Discord Developer Portal and `.env`. For example, Counting needs
102
+ `HELYX_MESSAGE_CONTENT_ENABLED=true`; Welcome and Access Control need
103
+ `HELYX_GUILD_MEMBERS_ENABLED=true`; Levels needs both. Access Control's Password
104
+ Entry also needs Message Content. Leaving these values false can prevent the
105
+ corresponding features from being enabled or working.
106
+
61
107
  If Auto Moderation Enhanced mode is selected, also enable the privileged Message
62
108
  Content intent in the developer portal and set
63
109
  `HELYX_MESSAGE_CONTENT_ENABLED=true`. Enhanced scanning uses bounded worker
64
- threads inside this same bot and the same PostgreSQL database. Keep the default
110
+ threads inside this same bot and the same selected database. Keep the default
65
111
  one worker until host CPU and memory measurements justify a value from two to
66
112
  four. No separate Ecko service, Redis instance, public endpoint or second
67
113
  database is required; unhealthy workers fall back to Discord-native Standard
68
114
  coverage.
69
115
 
70
- `npm start` validates the environment, connects to PostgreSQL, applies core and selected-module migrations safely, validates installed modules, synchronises Discord commands and then reports readiness. Do not run a separate migration command before every start. `npm run migrate` is available when you deliberately need to apply core migrations without starting Discord.
116
+ `npm start` validates the environment, loads only the selected database adapter, applies core and selected-module migrations safely, validates installed modules, synchronises Discord commands and then reports readiness. Do not run a separate migration command before every start. `npm run migrate` is available when you deliberately need to apply core migrations without starting Discord.
117
+
118
+ `npm run doctor` validates the environment, selected database connection, core
119
+ migration history, selected packages and engine compatibility without signing
120
+ in to Discord or modifying the database. Module migration inspection runs once
121
+ core migrations have no pending entries. A fresh database can report pending
122
+ migrations; normal startup applies them and probes required server capabilities.
123
+ Doctor does not probe those capabilities or prove Discord readiness.
124
+
125
+ Command registration is global or guild-scoped according to each reviewed command contribution. Discord may take time to refresh global commands. Installing a package does not enable its feature for a server; run `/helyx modules` in the server after startup to enable modules and configure their settings. Use `/permissions` when module or command access policies need to be changed.
126
+
127
+ ### Server-scoped module commands
128
+
129
+ The template keeps guild command writes disabled and uses
130
+ `HELYX_GLOBAL_COMMAND_MODE=legacy`. This does not disable all commands: core and
131
+ compatible legacy commands can still register globally. However, server-scoped
132
+ module command builds cannot be applied while guild writes are disabled.
133
+
134
+ To use enabled-module command builds in servers you explicitly approve, set:
135
+
136
+ ```dotenv
137
+ HELYX_GUILD_COMMAND_WRITES_ENABLED=true
138
+ HELYX_GUILD_COMMAND_WRITE_SCOPE=allowlist
139
+ HELYX_GUILD_COMMAND_WRITE_GUILD_IDS=12345678901234567
140
+ HELYX_GLOBAL_COMMAND_MODE=platform-only
141
+ ```
142
+
143
+ Replace the example with your Discord server ID, or a comma-separated list of
144
+ approved server IDs, then restart the bot. These are server IDs, not application
145
+ or channel IDs. An enabled allowlist must not be empty. `platform-only` keeps
146
+ core/deployment commands global while feature commands are built for enabled
147
+ modules in each server; removing legacy global commands can take time to appear
148
+ in Discord. Module activation and command registration are still separate.
149
+ Check the dashboard command-build status after enabling a module. Do not use
150
+ the advanced `all` scope merely to bypass an allowlist error.
71
151
 
72
- `npm run doctor` validates the environment, PostgreSQL connection, existing migration history and selected packages without signing in to Discord or modifying the database. On a new database it reports migrations that `npm start` will apply automatically.
152
+ ### Cloud Connect
73
153
 
74
- Command registration is global or guild-scoped according to each reviewed command contribution. Discord may take time to refresh global commands. Installing a package does not enable its feature for a server; run `/helyx` in the server after startup to enable modules and configure their settings. Use `/permissions` when module or command access policies need to be changed.
154
+ Generated self-host configuration enables the Cloud Connect connector by default, but it remains unpaired and shares nothing with the hosted dashboard until a deployment owner enters a one-use code with `/helyx cloud connect`. Set `HELYX_CLOUD_CONNECT_ENABLED=false` if this deployment will remain entirely local.
75
155
 
76
- Generated self-host configuration enables the Cloud Connect connector by default, but it remains unpaired and shares nothing with the hosted dashboard until a deployment owner enters a one-use code with `/helyx-cloud connect`. Set `HELYX_CLOUD_CONNECT_ENABLED=false` if this deployment will remain entirely local.
156
+ Use the Discord application owner, an application team member, or an explicitly
157
+ trusted user listed in `HELYX_OWNER_USER_IDS` to pair the deployment. Cloud
158
+ Connect uses your bot's selected database and stable local encryption key; it
159
+ does not require you to run a separate Helyx API, dashboard or PostgreSQL
160
+ database alongside a MySQL bot. The hosted dashboard/control plane is managed
161
+ separately by Helyx.
77
162
 
78
163
  ## Backups and upgrades
79
164
 
80
- - Back up PostgreSQL and the complete project directory before an upgrade.
81
- - Retain `package-lock.json`; use `npm ci` for repeatable installation.
82
- - Do not edit dependency versions or `helyx.modules.json` independently.
83
- - Run `npm run update:check` to compare the complete installed Helyx release set with the current reviewed catalogue.
84
- - Review the release notes, stop the bot, back up PostgreSQL, then run `npm run update`. Helyx backs up its managed project files, refreshes all exact Helyx versions and the lockfile together, and runs a clean install.
85
- - Run `npm run doctor` before restarting with `npm start`.
86
- - Existing starters that do not yet contain these scripts can use `npx --yes @helyx/cli@latest self-host update --check`, followed by the same command with `--confirm`, then `npm ci`.
87
- - Removing a package does not automatically delete retained module configuration or data.
88
- - Roll back application files and restore a compatible database backup if an upgrade cannot be completed safely.
165
+ This release uses consolidated fresh-install migration baselines. Do not apply
166
+ it as an ordinary upgrade to a database using an earlier migration chain.
167
+ Retain the matching installed release and
168
+ [contact Helyx support](https://docs.helyx.gg/contact/support/) before proceeding;
169
+ no approved old-database transition is available yet. The updater does not
170
+ convert, reset or back up a database.
171
+
172
+ For a later release explicitly supporting an ordinary update from your installed
173
+ state:
174
+
175
+ 1. Read its release notes and back up the selected database, project metadata,
176
+ `.env` and encryption key. Keep `package-lock.json`; do not edit individual
177
+ Helyx dependency versions or `helyx.modules.json`.
178
+ 2. Run `npm run update:check` to review the complete package-set change.
179
+ 3. Stop the bot. Compose users run `docker compose stop bot`, retaining the
180
+ database service and volume; managed hosts stop their application process.
181
+ 4. Run `npm run update`. Its script runs the metadata updater followed by
182
+ `npm ci`; the raw `helyx self-host update --confirm` command does not install
183
+ dependencies. Older starters can use
184
+ `npx --yes @helyx/cli@latest self-host update --check`, then the same command
185
+ with `--confirm`, followed by `npm ci`.
186
+ 5. Run doctor before restarting. Node.js users run `npm run doctor`, then
187
+ `npm start`. Docker users rebuild with `docker compose build bot`, run the
188
+ container doctor command above, then recreate with `docker compose up -d bot`.
189
+ Managed hosts use their installation, console and start facilities.
190
+ 6. Verify readiness and one representative workflow for each upgraded module.
191
+
192
+ The updater backs up `.gitignore`, `package.json`, `package-lock.json`,
193
+ `helyx.modules.json` and `SHA256SUMS` under `.helyx/backups/<timestamp>/`. It
194
+ restores these files if metadata generation or lockfile validation fails inside
195
+ `--confirm`. A later install, doctor or startup failure does not trigger that
196
+ restore. This backup excludes `.env`, database data, `node_modules` and images.
197
+ After a metadata restore, reinstall or rebuild the matching set and rerun doctor.
198
+ If startup already changed the database, restoring project files does not undo
199
+ its migrations; check the compatible backup/recovery plan before using old code.
200
+
201
+ Removing a package does not automatically delete retained module data. Never
202
+ alter migration history or checksums to make a mismatched release start.
89
203
 
90
204
  ## Adding or removing modules
91
205
 
92
- Use a newly generated manifest or the supported Helyx self-host command once module-change commands are released. A package being present does not enable it for a Discord server. Unknown packages, Git URLs, file paths and unreviewed registries are not supported.
206
+ Choose the new selection in the Helyx builder and generate a starter in a new
207
+ directory. The updater keeps the current selection and its required dependency
208
+ closure; it is not an interactive add/remove command. For an existing database,
209
+ review the module and release compatibility before changing the installation.
210
+ A package being present does not enable it for a Discord server. Unknown
211
+ packages, Git URLs, file paths and unreviewed registries are not supported.
93
212
 
94
213
  ## Support and security
95
214
 
@@ -0,0 +1,6 @@
1
+ services:
2
+ bot:
3
+ build: .
4
+ restart: unless-stopped
5
+ env_file:
6
+ - .env