learnhouse 1.3.0 → 1.3.2
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 +39 -40
- package/dist/bin/learnhouse.js +19 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# LearnHouse CLI
|
|
2
2
|
|
|
3
|
-
The official LearnHouse CLI — deploy, manage, and operate your LearnHouse instance.
|
|
3
|
+
The official LearnHouse CLI — deploy, manage, and operate your LearnHouse instance.
|
|
4
4
|
|
|
5
5
|
<img width="915" height="871" alt="image" src="https://github.com/user-attachments/assets/957c6cea-3efb-4cab-a643-55df3ac4c6aa" />
|
|
6
6
|
|
|
@@ -20,82 +20,81 @@ curl -fsSL https://raw.githubusercontent.com/learnhouse/learnhouse/main/apps/cli
|
|
|
20
20
|
irm https://raw.githubusercontent.com/learnhouse/learnhouse/main/apps/cli/install.ps1 | iex
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
### Using npx
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
```bash
|
|
26
|
+
npx learnhouse@latest setup
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Install a specific version
|
|
26
30
|
|
|
27
31
|
```bash
|
|
28
|
-
npx learnhouse@
|
|
32
|
+
npx learnhouse@1.0.0 setup
|
|
29
33
|
```
|
|
30
34
|
|
|
31
35
|
## Requirements
|
|
32
36
|
|
|
33
37
|
- **Node.js** >= 18
|
|
34
|
-
- **Docker**
|
|
38
|
+
- **Docker**
|
|
35
39
|
|
|
36
40
|
## Commands
|
|
37
41
|
|
|
38
42
|
| Command | Description |
|
|
39
43
|
|---------|-------------|
|
|
40
|
-
| `learnhouse setup` | Interactive setup wizard
|
|
44
|
+
| `learnhouse setup` | Interactive setup wizard |
|
|
41
45
|
| `learnhouse start` | Start all services |
|
|
42
46
|
| `learnhouse stop` | Stop all services |
|
|
43
|
-
| `learnhouse
|
|
47
|
+
| `learnhouse update` | Update to the latest version |
|
|
48
|
+
| `learnhouse update --version <x.y.z>` | Update to a specific version |
|
|
49
|
+
| `learnhouse logs` | Stream service logs |
|
|
44
50
|
| `learnhouse config` | Show current configuration |
|
|
45
|
-
| `learnhouse
|
|
51
|
+
| `learnhouse status` | Show service status |
|
|
52
|
+
| `learnhouse health` | Run health checks |
|
|
53
|
+
| `learnhouse backup` | Backup database |
|
|
54
|
+
| `learnhouse restore <archive>` | Restore database from a backup |
|
|
46
55
|
| `learnhouse deployments` | View deployments and set resource limits |
|
|
47
|
-
| `learnhouse doctor` |
|
|
48
|
-
| `learnhouse shell` | Open
|
|
56
|
+
| `learnhouse doctor` | Diagnose common issues |
|
|
57
|
+
| `learnhouse shell` | Open a shell in a running container |
|
|
58
|
+
| `learnhouse env` | Edit environment variables |
|
|
59
|
+
| `learnhouse dev` | Start local development environment |
|
|
49
60
|
|
|
50
|
-
## Setup
|
|
61
|
+
## Setup
|
|
51
62
|
|
|
52
63
|
The setup wizard walks through:
|
|
53
64
|
|
|
54
65
|
1. **Install directory** — where files are generated
|
|
55
|
-
2. **Domain** — hostname, port, HTTPS/SSL
|
|
56
|
-
3. **Database & Redis** — local (Docker) or external
|
|
57
|
-
4. **Organization** — name for your
|
|
66
|
+
2. **Domain** — hostname, port, HTTPS/SSL
|
|
67
|
+
3. **Database & Redis** — local (Docker) or external
|
|
68
|
+
4. **Organization** — name for your instance
|
|
58
69
|
5. **Admin account** — email and password
|
|
59
|
-
6. **
|
|
60
|
-
|
|
61
|
-
You can go back to any previous step during setup, and edit any step from the summary before confirming.
|
|
70
|
+
6. **Features** — AI, email, S3, OAuth, Unsplash
|
|
62
71
|
|
|
63
|
-
|
|
72
|
+
You can go back to any step, and edit from the summary before confirming.
|
|
64
73
|
|
|
65
|
-
##
|
|
74
|
+
## Updating
|
|
66
75
|
|
|
67
76
|
```bash
|
|
68
|
-
#
|
|
69
|
-
npx learnhouse start
|
|
70
|
-
npx learnhouse stop
|
|
71
|
-
|
|
72
|
-
# View logs
|
|
73
|
-
npx learnhouse logs
|
|
74
|
-
|
|
75
|
-
# Backup database
|
|
77
|
+
# Back up first
|
|
76
78
|
npx learnhouse backup
|
|
77
79
|
|
|
78
|
-
#
|
|
79
|
-
npx learnhouse
|
|
80
|
-
|
|
81
|
-
# Open a shell in a container
|
|
82
|
-
npx learnhouse shell
|
|
80
|
+
# Update to latest
|
|
81
|
+
npx learnhouse update
|
|
83
82
|
|
|
84
|
-
#
|
|
85
|
-
npx learnhouse
|
|
83
|
+
# Or a specific version
|
|
84
|
+
npx learnhouse update --version 1.2.0
|
|
86
85
|
```
|
|
87
86
|
|
|
88
|
-
|
|
87
|
+
The update command pulls the new image, restarts services, and asks if you want to run database migrations. Check [docs.learnhouse.app](https://docs.learnhouse.app) for migration guides before proceeding.
|
|
89
88
|
|
|
90
|
-
|
|
89
|
+
## Generated Files
|
|
91
90
|
|
|
92
91
|
```
|
|
93
92
|
learnhouse/
|
|
94
|
-
docker-compose.yml
|
|
95
|
-
.env
|
|
96
|
-
learnhouse.config.json
|
|
93
|
+
docker-compose.yml # Service definitions
|
|
94
|
+
.env # Configuration
|
|
95
|
+
learnhouse.config.json # CLI metadata
|
|
97
96
|
extra/
|
|
98
|
-
nginx.prod.conf
|
|
97
|
+
nginx.prod.conf # Reverse proxy (or Caddyfile for auto-SSL)
|
|
99
98
|
```
|
|
100
99
|
|
|
101
100
|
## License
|
package/dist/bin/learnhouse.js
CHANGED
|
@@ -3616,7 +3616,7 @@ var {
|
|
|
3616
3616
|
var import_picocolors19 = __toESM(require_picocolors(), 1);
|
|
3617
3617
|
|
|
3618
3618
|
// src/constants.ts
|
|
3619
|
-
var VERSION = "1.3.
|
|
3619
|
+
var VERSION = "1.3.2";
|
|
3620
3620
|
var APP_IMAGE = "ghcr.io/learnhouse/app:latest";
|
|
3621
3621
|
var DEV_IMAGE = "ghcr.io/learnhouse/app:dev";
|
|
3622
3622
|
var POSTGRES_IMAGE = "postgres:16-alpine";
|
|
@@ -3723,16 +3723,29 @@ async function resolveAppImage(channel = "stable") {
|
|
|
3723
3723
|
if (channel === "dev") {
|
|
3724
3724
|
return { image: DEV_IMAGE, isLatest: false };
|
|
3725
3725
|
}
|
|
3726
|
-
const versionedTag = `${GHCR_BASE}:${VERSION}`;
|
|
3727
3726
|
try {
|
|
3727
|
+
const releasesResp = await fetch(
|
|
3728
|
+
"https://api.github.com/repos/learnhouse/learnhouse/releases",
|
|
3729
|
+
{
|
|
3730
|
+
signal: AbortSignal.timeout(5e3),
|
|
3731
|
+
headers: { Accept: "application/vnd.github+json" }
|
|
3732
|
+
}
|
|
3733
|
+
);
|
|
3734
|
+
if (!releasesResp.ok) throw new Error("GitHub API failed");
|
|
3735
|
+
const releases = await releasesResp.json();
|
|
3736
|
+
const appRelease = releases.find(
|
|
3737
|
+
(r) => !r.draft && !r.prerelease && !r.tag_name.startsWith("cli-")
|
|
3738
|
+
);
|
|
3739
|
+
if (!appRelease) throw new Error("No app release found");
|
|
3740
|
+
const appVersion = appRelease.tag_name;
|
|
3728
3741
|
const tokenResp = await fetch(
|
|
3729
|
-
|
|
3742
|
+
"https://ghcr.io/token?scope=repository:learnhouse/app:pull",
|
|
3730
3743
|
{ signal: AbortSignal.timeout(5e3) }
|
|
3731
3744
|
);
|
|
3732
|
-
if (!tokenResp.ok) throw new Error("token
|
|
3745
|
+
if (!tokenResp.ok) throw new Error("GHCR token failed");
|
|
3733
3746
|
const { token } = await tokenResp.json();
|
|
3734
3747
|
const manifestResp = await fetch(
|
|
3735
|
-
`https://ghcr.io/v2/learnhouse/app/manifests/${
|
|
3748
|
+
`https://ghcr.io/v2/learnhouse/app/manifests/${appVersion}`,
|
|
3736
3749
|
{
|
|
3737
3750
|
signal: AbortSignal.timeout(5e3),
|
|
3738
3751
|
headers: {
|
|
@@ -3742,7 +3755,7 @@ async function resolveAppImage(channel = "stable") {
|
|
|
3742
3755
|
}
|
|
3743
3756
|
);
|
|
3744
3757
|
if (manifestResp.ok) {
|
|
3745
|
-
return { image:
|
|
3758
|
+
return { image: `${GHCR_BASE}:${appVersion}`, isLatest: false };
|
|
3746
3759
|
}
|
|
3747
3760
|
} catch {
|
|
3748
3761
|
}
|
|
@@ -4832,14 +4845,6 @@ function isDockerInstalled() {
|
|
|
4832
4845
|
return false;
|
|
4833
4846
|
}
|
|
4834
4847
|
}
|
|
4835
|
-
function isDockerComposeV2() {
|
|
4836
|
-
try {
|
|
4837
|
-
const output = execSync("docker compose version", { stdio: "pipe" }).toString();
|
|
4838
|
-
return output.includes("v2");
|
|
4839
|
-
} catch {
|
|
4840
|
-
return false;
|
|
4841
|
-
}
|
|
4842
|
-
}
|
|
4843
4848
|
function isDockerRunning() {
|
|
4844
4849
|
try {
|
|
4845
4850
|
execSync("docker info", { stdio: "pipe" });
|
|
@@ -4993,11 +4998,6 @@ async function checkPrerequisites() {
|
|
|
4993
4998
|
check: isDockerInstalled,
|
|
4994
4999
|
failMsg: `Docker is not installed. Install it from ${import_picocolors6.default.underline("https://docs.docker.com/get-docker/")}`
|
|
4995
5000
|
},
|
|
4996
|
-
{
|
|
4997
|
-
name: "Docker Compose v2",
|
|
4998
|
-
check: isDockerComposeV2,
|
|
4999
|
-
failMsg: `Docker Compose v2 is required. Install it from ${import_picocolors6.default.underline("https://docs.docker.com/compose/install/")}`
|
|
5000
|
-
},
|
|
5001
5001
|
{
|
|
5002
5002
|
name: "Docker daemon",
|
|
5003
5003
|
check: isDockerRunning,
|
|
@@ -6934,11 +6934,6 @@ async function doctorCommand() {
|
|
|
6934
6934
|
process.exit(1);
|
|
6935
6935
|
}
|
|
6936
6936
|
pass("Docker daemon running");
|
|
6937
|
-
if (isDockerComposeV2()) {
|
|
6938
|
-
pass("Docker Compose v2 available");
|
|
6939
|
-
} else {
|
|
6940
|
-
fail("Docker Compose v2 not found", "Update Docker Desktop or install docker-compose-plugin");
|
|
6941
|
-
}
|
|
6942
6937
|
if (!config) {
|
|
6943
6938
|
R2.warn("No LearnHouse installation found. Skipping deployment checks.");
|
|
6944
6939
|
Le(import_picocolors14.default.dim("Done"));
|