@temps-sdk/cli 0.1.9 → 0.1.11
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 +331 -6
- package/dist/index.js +78311 -62368
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,15 +1,340 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/gotempsh/temps/refs/heads/main/web/public/logo/temps-logo-light.png" alt="Temps Platform" width="700" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">@temps-sdk/cli</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@temps-sdk/cli"><img src="https://img.shields.io/npm/v/@temps-sdk/cli.svg" alt="npm version" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/@temps-sdk/cli"><img src="https://img.shields.io/npm/dm/@temps-sdk/cli.svg" alt="npm downloads" /></a>
|
|
10
|
+
<a href="https://github.com/AnomalyCo/temps/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@temps-sdk/cli.svg" alt="license" /></a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
Command-line interface for the Temps deployment platform. Deploy, manage, and monitor your applications from the terminal -- no dashboard required.
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# npm
|
|
21
|
+
npm install -g @temps-sdk/cli
|
|
22
|
+
|
|
23
|
+
# bun
|
|
24
|
+
bun add -g @temps-sdk/cli
|
|
25
|
+
|
|
26
|
+
# pnpm
|
|
27
|
+
pnpm add -g @temps-sdk/cli
|
|
28
|
+
|
|
29
|
+
# Or run without installing
|
|
30
|
+
npx @temps-sdk/cli
|
|
31
|
+
bunx @temps-sdk/cli
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Authenticate with your Temps instance
|
|
38
|
+
bunx @temps-sdk/cli login
|
|
39
|
+
|
|
40
|
+
# Initialize a project in the current directory
|
|
41
|
+
bunx @temps-sdk/cli init
|
|
42
|
+
|
|
43
|
+
# Deploy
|
|
44
|
+
bunx @temps-sdk/cli up
|
|
45
|
+
|
|
46
|
+
# Check status
|
|
47
|
+
bunx @temps-sdk/cli status
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
That's it. The CLI detects your framework, connects your git repo, and deploys -- all in one command.
|
|
51
|
+
|
|
52
|
+
## Configuration
|
|
53
|
+
|
|
54
|
+
### Interactive Setup
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
bunx @temps-sdk/cli configure
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Walks you through setting your Temps API URL and authentication token, stored in `~/.temps/config.json`.
|
|
61
|
+
|
|
62
|
+
### Environment Variables
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
TEMPS_API_URL=https://your-instance.temps.dev # Your Temps API URL
|
|
66
|
+
TEMPS_API_TOKEN=your-token # API key or deployment token
|
|
67
|
+
TEMPS_PROJECT=my-app # Project slug (optional)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Environment variables take precedence over config files, making CI/CD integration straightforward.
|
|
71
|
+
|
|
72
|
+
### Project-Level Config
|
|
73
|
+
|
|
74
|
+
Running `bunx @temps-sdk/cli init` or `bunx @temps-sdk/cli link` creates a `.temps/config.json` in your project directory:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"projectSlug": "my-app"
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The CLI walks upward from your working directory to find `.temps/config.json` (like `.git` discovery). When found, the `projectSlug` is used to auto-fetch the project ID and all configuration (git connection, preset, environments) from the API -- no need to pass `--project` on every command.
|
|
83
|
+
|
|
84
|
+
**Resolution order:** `--project` flag > `.temps/config.json` > `TEMPS_PROJECT` env var > global default.
|
|
85
|
+
|
|
86
|
+
## Developer Workflow
|
|
87
|
+
|
|
88
|
+
### `init`
|
|
89
|
+
|
|
90
|
+
Initialize a new Temps project in the current directory. Detects your framework, creates a project on the platform, and links it.
|
|
4
91
|
|
|
5
92
|
```bash
|
|
6
|
-
|
|
93
|
+
bunx @temps-sdk/cli init
|
|
7
94
|
```
|
|
8
95
|
|
|
9
|
-
|
|
96
|
+
### `link <project>`
|
|
97
|
+
|
|
98
|
+
Link the current directory to an existing Temps project.
|
|
10
99
|
|
|
11
100
|
```bash
|
|
12
|
-
|
|
101
|
+
bunx @temps-sdk/cli link my-app
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### `up`
|
|
105
|
+
|
|
106
|
+
One-command deploy. If the project is not yet linked, an interactive setup wizard walks you through framework detection, git connection, and service provisioning. If the project is already linked (via `link` or `init`), it fetches the project configuration -- including the git connection and preset -- shows a deployment preview, and triggers the pipeline with a live progress TUI.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Deploy the current directory
|
|
110
|
+
bunx @temps-sdk/cli up
|
|
111
|
+
|
|
112
|
+
# Deploy a specific branch
|
|
113
|
+
bunx @temps-sdk/cli up --branch main
|
|
114
|
+
|
|
115
|
+
# Deploy with a specific preset (skip auto-detection)
|
|
116
|
+
bunx @temps-sdk/cli up --preset nextjs
|
|
117
|
+
|
|
118
|
+
# Manual deployment mode (no git, uploads a local Docker image)
|
|
119
|
+
bunx @temps-sdk/cli up --manual
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**What `up` shows for a linked project:**
|
|
123
|
+
|
|
13
124
|
```
|
|
125
|
+
i Using project acme-api (from local-config)
|
|
126
|
+
✔ Found project: acme-api
|
|
127
|
+
i Repository: acme-org/acme-api
|
|
128
|
+
i Preset: fastapi
|
|
129
|
+
|
|
130
|
+
╭─ Deployment Preview ──────────────╮
|
|
131
|
+
│ Project: acme-api │
|
|
132
|
+
│ Environment: production │
|
|
133
|
+
│ Branch: main │
|
|
134
|
+
│ Preset: fastapi │
|
|
135
|
+
│ Repository: acme-org/acme-api │
|
|
136
|
+
╰────────────────────────────────────╯
|
|
137
|
+
|
|
138
|
+
✔ Deployment started
|
|
139
|
+
🚀 Deployment Progress
|
|
140
|
+
...
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
If the project has no git provider connected, `up` warns you and suggests how to connect one or fall back to manual deployment.
|
|
144
|
+
|
|
145
|
+
### `status`
|
|
146
|
+
|
|
147
|
+
View the current project's deployment status, container health, and domain configuration.
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
bunx @temps-sdk/cli status
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### `open`
|
|
154
|
+
|
|
155
|
+
Open the project's live URL in your default browser.
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
bunx @temps-sdk/cli open
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### `rollback`
|
|
162
|
+
|
|
163
|
+
Rollback to the previous deployment.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
bunx @temps-sdk/cli rollback
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### `env:pull` / `env:push`
|
|
170
|
+
|
|
171
|
+
Sync environment variables between your local `.env` file and the Temps project.
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# Download env vars to .env
|
|
175
|
+
bunx @temps-sdk/cli env:pull
|
|
176
|
+
|
|
177
|
+
# Upload .env to the project
|
|
178
|
+
bunx @temps-sdk/cli env:push
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Deployment Methods
|
|
182
|
+
|
|
183
|
+
### Git-Based Deploy
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Deploy from a branch (default: current branch)
|
|
187
|
+
bunx @temps-sdk/cli deploy
|
|
188
|
+
|
|
189
|
+
# Deploy a specific branch
|
|
190
|
+
bunx @temps-sdk/cli deploy --branch feature/new-ui
|
|
191
|
+
|
|
192
|
+
# Deploy to a specific environment
|
|
193
|
+
bunx @temps-sdk/cli deploy --branch main --environment production
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Local Docker Image
|
|
197
|
+
|
|
198
|
+
Build a Docker image locally, export it, and upload it directly -- useful when your CI builds images or for air-gapped environments.
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
bunx @temps-sdk/cli deploy:local-image --tag my-app:latest
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### List Deployments
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
bunx @temps-sdk/cli deployments
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Multi-Instance Management
|
|
211
|
+
|
|
212
|
+
Manage multiple Temps server instances (self-hosted and cloud) from a single CLI.
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
# List configured instances
|
|
216
|
+
bunx @temps-sdk/cli instances list
|
|
217
|
+
|
|
218
|
+
# Add a new instance
|
|
219
|
+
bunx @temps-sdk/cli instances add
|
|
220
|
+
|
|
221
|
+
# Switch active instance
|
|
222
|
+
bunx @temps-sdk/cli instances switch
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Temps Cloud
|
|
226
|
+
|
|
227
|
+
Connect to Temps Cloud for managed hosting with automatic provisioning.
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
# Login via browser (device code flow)
|
|
231
|
+
bunx @temps-sdk/cli cloud login
|
|
232
|
+
|
|
233
|
+
# Check current user
|
|
234
|
+
bunx @temps-sdk/cli cloud whoami
|
|
235
|
+
|
|
236
|
+
# Manage VPS instances
|
|
237
|
+
bunx @temps-sdk/cli cloud vps list
|
|
238
|
+
bunx @temps-sdk/cli cloud vps create
|
|
239
|
+
bunx @temps-sdk/cli cloud vps destroy
|
|
240
|
+
|
|
241
|
+
# View billing and usage
|
|
242
|
+
bunx @temps-sdk/cli cloud billing
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Platform Migration
|
|
246
|
+
|
|
247
|
+
Migrate projects from other platforms with an interactive wizard that discovers your projects, snapshots configuration, and generates a step-by-step migration plan.
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
bunx @temps-sdk/cli migrate
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Supported platforms:**
|
|
254
|
+
|
|
255
|
+
| Platform | What's migrated |
|
|
256
|
+
|----------|-----------------|
|
|
257
|
+
| Vercel | Projects, env vars, domains |
|
|
258
|
+
| Coolify | Projects, services, env vars, domains |
|
|
259
|
+
| Dokploy | Projects, services, env vars, domains |
|
|
260
|
+
|
|
261
|
+
## Resource Management
|
|
262
|
+
|
|
263
|
+
The CLI provides full CRUD access to every Temps resource:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
# Projects
|
|
267
|
+
bunx @temps-sdk/cli projects list
|
|
268
|
+
bunx @temps-sdk/cli projects create
|
|
269
|
+
bunx @temps-sdk/cli projects show <slug>
|
|
270
|
+
|
|
271
|
+
# Domains & SSL
|
|
272
|
+
bunx @temps-sdk/cli domains list
|
|
273
|
+
bunx @temps-sdk/cli domains provision <id>
|
|
274
|
+
|
|
275
|
+
# Services (PostgreSQL, Redis, S3)
|
|
276
|
+
bunx @temps-sdk/cli services list --project <slug>
|
|
277
|
+
bunx @temps-sdk/cli services create --project <slug>
|
|
278
|
+
|
|
279
|
+
# Monitoring
|
|
280
|
+
bunx @temps-sdk/cli monitors list
|
|
281
|
+
bunx @temps-sdk/cli monitors create
|
|
282
|
+
|
|
283
|
+
# Environment variables
|
|
284
|
+
bunx @temps-sdk/cli environments list --project <slug>
|
|
285
|
+
|
|
286
|
+
# Git providers
|
|
287
|
+
bunx @temps-sdk/cli providers list
|
|
288
|
+
bunx @temps-sdk/cli providers sync <id>
|
|
289
|
+
|
|
290
|
+
# Backups
|
|
291
|
+
bunx @temps-sdk/cli backups list --project <slug>
|
|
292
|
+
bunx @temps-sdk/cli backups run <id>
|
|
293
|
+
|
|
294
|
+
# Container management
|
|
295
|
+
bunx @temps-sdk/cli containers list --project <slug>
|
|
296
|
+
|
|
297
|
+
# Runtime logs (live streaming)
|
|
298
|
+
bunx @temps-sdk/cli runtime-logs --project <slug>
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**Full resource list:** projects, deployments, environments, domains, custom-domains, DNS, DNS providers, git providers, services, backups, containers, monitors, incidents, webhooks, API keys, tokens, users, settings, audit logs, proxy logs, errors, DSN, KV, blob, scans, IP access, email domains, email providers, emails, load balancer, templates, presets, funnels, notifications, notification preferences, platform.
|
|
302
|
+
|
|
303
|
+
## CI/CD Integration
|
|
304
|
+
|
|
305
|
+
Use environment variables for non-interactive deployments:
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# GitHub Actions example
|
|
309
|
+
env:
|
|
310
|
+
TEMPS_API_URL: ${{ secrets.TEMPS_API_URL }}
|
|
311
|
+
TEMPS_API_TOKEN: ${{ secrets.TEMPS_API_TOKEN }}
|
|
312
|
+
|
|
313
|
+
steps:
|
|
314
|
+
- run: bunx @temps-sdk/cli deploy --branch ${{ github.ref_name }} --project my-app
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Global Options
|
|
318
|
+
|
|
319
|
+
| Option | Description |
|
|
320
|
+
|--------|-------------|
|
|
321
|
+
| `-v, --version` | Display version number |
|
|
322
|
+
| `--no-color` | Disable colored output |
|
|
323
|
+
| `--debug` | Enable debug output |
|
|
324
|
+
| `-h, --help` | Display help |
|
|
325
|
+
|
|
326
|
+
## Requirements
|
|
327
|
+
|
|
328
|
+
- Node.js 18+ or Bun
|
|
329
|
+
- A running Temps instance (self-hosted or Temps Cloud)
|
|
330
|
+
|
|
331
|
+
## Related
|
|
332
|
+
|
|
333
|
+
- [`@temps-sdk/kv`](https://www.npmjs.com/package/@temps-sdk/kv) -- Key-value store
|
|
334
|
+
- [`@temps-sdk/blob`](https://www.npmjs.com/package/@temps-sdk/blob) -- File storage
|
|
335
|
+
- [`@temps-sdk/react-analytics`](https://www.npmjs.com/package/@temps-sdk/react-analytics) -- React analytics, session replay, error tracking
|
|
336
|
+
- [`@temps-sdk/node-sdk`](https://www.npmjs.com/package/@temps-sdk/node-sdk) -- Full platform API client and server-side error tracking
|
|
337
|
+
|
|
338
|
+
## License
|
|
14
339
|
|
|
15
|
-
|
|
340
|
+
MIT
|