@wirechunk/cli 0.0.9 → 0.1.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.
- package/README.md +75 -0
- package/build/main.js +510 -447
- package/package.json +2 -18
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Wirechunk CLI
|
|
2
|
+
|
|
3
|
+
The Wirechunk CLI (`wirechunk`) is the official command-line tool for Wirechunk. It provides essential utilities for platform management and is the primary tool for developing Wirechunk extensions.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npm install -D @wirechunk/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Getting Started with Extension Development
|
|
12
|
+
|
|
13
|
+
The CLI simplifies the extension development workflow by allowing you to run a local instance of the Wirechunk core platform that loads your extension code directly.
|
|
14
|
+
|
|
15
|
+
### Prerequisites
|
|
16
|
+
|
|
17
|
+
- **Node.js**: Must be version 24+.
|
|
18
|
+
- **Docker**: Required for running the core development server.
|
|
19
|
+
|
|
20
|
+
### Development Workflow
|
|
21
|
+
|
|
22
|
+
1. **Configure Environment**:
|
|
23
|
+
Ensure you have a `.env` file with the necessary configuration, including a core database URL (e.g., `WIRECHUNK_CORE_DATABASE_URL`). You can override the core dev server image with `WIRECHUNK_CORE_DEV_SERVER_IMAGE`; otherwise the CLI uses the latest.
|
|
24
|
+
|
|
25
|
+
2. **Start the Core Server**:
|
|
26
|
+
Run the development server which spins up a Docker container with the Wirechunk platform. It mounts your current working directory inside the container, allowing hot reload for frontend code as you develop.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
wirechunk ext-dev start-core
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- Adds `-d` to run in detached mode.
|
|
33
|
+
- Exposes port `8080` (Web) and `9001` (Vite).
|
|
34
|
+
|
|
35
|
+
3. **Create Extension**:
|
|
36
|
+
Register your extension with the platform to generate an ID and configure your environment. If your `extension.json` enables a database, this command will set up the connection details automatically.
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
wirechunk create-extension --dev
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Key Commands
|
|
43
|
+
|
|
44
|
+
### Extension Management
|
|
45
|
+
|
|
46
|
+
- **`wirechunk create-extension`**: Register a new extension on the platform.
|
|
47
|
+
- **`wirechunk create-extension-version`**: Publish a new version of an extension. Uploads configuration and code.
|
|
48
|
+
|
|
49
|
+
### Platform & User Management
|
|
50
|
+
|
|
51
|
+
- **`wirechunk bootstrap`**: Initialize a new platform.
|
|
52
|
+
- **`wirechunk create-user`**: Create a new user account. Useful for setting up test users or initial admins.
|
|
53
|
+
- **`wirechunk edit-admin`**: Grant or revoke admin privileges for a user on a platform.
|
|
54
|
+
|
|
55
|
+
### Development Utilities (`ext-dev`)
|
|
56
|
+
|
|
57
|
+
- **`wirechunk ext-dev start-core`**: Starts the local Docker-based development server.
|
|
58
|
+
- **`wirechunk ext-dev init-db`**: Initializes a development database for an extension.
|
|
59
|
+
- **`wirechunk ext-dev get-db-url`**: writes `DATABASE_URL` to `.env.local` (or `.env.<env-mode>.local`) with the extension’s development database connection string.
|
|
60
|
+
|
|
61
|
+
### Utility
|
|
62
|
+
|
|
63
|
+
- **`wirechunk version`**: Prints the CLI version.
|
|
64
|
+
|
|
65
|
+
## Configuration
|
|
66
|
+
|
|
67
|
+
The CLI automatically loads environment variables from `.env` and `.env.local` files in your current directory.
|
|
68
|
+
|
|
69
|
+
You can specify a custom environment mode using the `--env-mode` flag:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
wirechunk --env-mode test create-user ...
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
This will load variables from `.env.test` and `.env.test.local` in addition to the standard files.
|