@light-cloud/cli 0.1.0
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/LICENSE +21 -0
- package/README.md +131 -0
- package/dist/index.js +4090 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Light Cloud Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Light Cloud CLI
|
|
2
|
+
|
|
3
|
+
`lc` is the Light Cloud command line: deploy an app and watch the build stream
|
|
4
|
+
by, tail runtime logs, set environment variables, roll back, manage databases.
|
|
5
|
+
Everything the console does for an app, from the terminal, with `--json` for
|
|
6
|
+
scripts.
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
$ lc deploy
|
|
10
|
+
┌ ☁ Light Cloud deploy
|
|
11
|
+
│
|
|
12
|
+
│ my-app → production ★
|
|
13
|
+
│ Source: github.com/acme/my-app @ main
|
|
14
|
+
│
|
|
15
|
+
◇ Deployment queued my-app / production
|
|
16
|
+
◇ Cloning repository 2.1s
|
|
17
|
+
◇ Building image 58s
|
|
18
|
+
◇ Deploying container 14s
|
|
19
|
+
◇ Deployed in 1m 16s https://my-app.acme.light-cloud.io
|
|
20
|
+
│
|
|
21
|
+
└ Live at https://my-app.acme.light-cloud.io
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install -g @light-cloud/cli
|
|
28
|
+
lc --version
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Node 18.17 or newer. `lc` and `light-cloud` are the same binary.
|
|
32
|
+
|
|
33
|
+
## First run
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
lc login # opens the browser; tokens land in ~/.lightcloud/credentials.json
|
|
37
|
+
cd my-project
|
|
38
|
+
lc init # link the folder to an existing app, or create one
|
|
39
|
+
lc deploy # deploy and follow the build
|
|
40
|
+
lc logs -f # tail runtime logs
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`lc login` shares its credential file with the Light Cloud MCP server, so
|
|
44
|
+
signing in once serves both.
|
|
45
|
+
|
|
46
|
+
## Commands
|
|
47
|
+
|
|
48
|
+
| Command | What it does |
|
|
49
|
+
|---|---|
|
|
50
|
+
| `lc login` / `logout` / `whoami` | Browser sign-in, or `lc login --api-key lc_…` for machines |
|
|
51
|
+
| `lc orgs`, `lc org use <name>` | List workspaces; choose the default one |
|
|
52
|
+
| `lc init` | Link this folder to an app (wizard) |
|
|
53
|
+
| `lc create` | Create an app from a GitHub repository or an upload, flag-driven |
|
|
54
|
+
| `lc apps [filter]` | Apps in the workspace with status and URL |
|
|
55
|
+
| `lc status [app]` | One app: environments, URLs, domains, last deploy |
|
|
56
|
+
| `lc deploy [app] [--env x] [--upload]` | Deploy and follow; `--no-watch` to just queue |
|
|
57
|
+
| `lc open [app]` | Open the deployed URL (`--console` for the dashboard) |
|
|
58
|
+
| `lc envs`, `lc env create/delete/scale/get` | Environments |
|
|
59
|
+
| `lc env vars [set/unset/import/export]` | Environment variables; `--redeploy` to apply |
|
|
60
|
+
| `lc logs [-f] [--since 2h] [--min-severity WARNING] [--search text]` | Runtime logs |
|
|
61
|
+
| `lc deployments`, `lc deployment <id>` | History and the build log of one deployment |
|
|
62
|
+
| `lc rollback [id]` | Roll back to an earlier deployment, no rebuild |
|
|
63
|
+
| `lc domains add/check/retry/remove` | Custom domains with the DNS records to create |
|
|
64
|
+
| `lc dbs`, `lc db create/get/url/rotate-password/dump/delete` | Databases |
|
|
65
|
+
| `lc billing`, `lc billing plans`, `lc billing plan use <id>`, `lc billing card add/remove` | Plan, usage pool and payment card (card via a Stripe-hosted link) |
|
|
66
|
+
| `lc login --device [--email <address>]` | Sign in — or sign up — with a code from any device; no browser needed here |
|
|
67
|
+
| `lc config`, `lc unlink` | Endpoint settings; remove the link file |
|
|
68
|
+
|
|
69
|
+
Every command takes `--json`, `--org <workspace>`, `--yes` and `--api-url`.
|
|
70
|
+
|
|
71
|
+
## How a folder is linked
|
|
72
|
+
|
|
73
|
+
`lc init` writes a `.lightcloud` file:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"organisationId": "…",
|
|
78
|
+
"applicationId": "…",
|
|
79
|
+
"environmentId": "…",
|
|
80
|
+
"applicationName": "my-app",
|
|
81
|
+
"framework": "nextjs",
|
|
82
|
+
"deploymentType": "container"
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Commands run from that folder (or any subfolder) act on that app. The same
|
|
87
|
+
file is read by the MCP server and the VS Code extension. Commit it if the
|
|
88
|
+
whole team deploys the same app; ignore it if not.
|
|
89
|
+
|
|
90
|
+
## CI and scripts
|
|
91
|
+
|
|
92
|
+
Create an API key in the console (Organisation settings → API keys; paid
|
|
93
|
+
plans), then:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
export LIGHT_CLOUD_API_KEY=lc_…
|
|
97
|
+
lc deploy --yes # in a folder with .lightcloud
|
|
98
|
+
lc apps --json | jq '.[].name'
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
An API key is bound to one workspace, so `--org` is not needed. Without a
|
|
102
|
+
terminal, prompts are never shown: anything that would have asked fails with
|
|
103
|
+
the flag to pass instead.
|
|
104
|
+
|
|
105
|
+
Exit codes: `0` ok · `1` error · `2` usage · `3` not signed in · `4` not found ·
|
|
106
|
+
`5` the deployment or provisioning failed · `130` cancelled.
|
|
107
|
+
|
|
108
|
+
## Staging or a local API
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
lc config set api-url https://api.staging-light-cloud.com
|
|
112
|
+
# or per command
|
|
113
|
+
LIGHT_CLOUD_API_URL=http://localhost:5001 lc apps
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The console URL is inferred from the API URL (`api.` → `console.`); override it
|
|
117
|
+
with `lc config set console-url …` or `LIGHT_CLOUD_CONSOLE_URL`.
|
|
118
|
+
|
|
119
|
+
## Development
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
npm install
|
|
123
|
+
npm run dev -- apps # run from source
|
|
124
|
+
npm run typecheck
|
|
125
|
+
npm test
|
|
126
|
+
npm run build # dist/index.js, single file
|
|
127
|
+
node dist/index.js --help
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Framework detection rules live in `src/lib/detection/catalogue.ts`, a snapshot
|
|
131
|
+
of the backend catalogue; the header of that file says how to regenerate it.
|