instavm 0.13.0 → 0.15.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/README.md +82 -11
- package/dist/cli.js +3446 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.mts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +30 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -4
- package/dist/index.mjs.map +1 -1
- package/dist/integrations/openai/index.js +0 -1
- package/dist/integrations/openai/index.js.map +1 -1
- package/dist/integrations/openai/index.mjs +0 -2
- package/dist/integrations/openai/index.mjs.map +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# InstaVM JavaScript SDK
|
|
1
|
+
# InstaVM JavaScript SDK + CLI
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
Official JavaScript/TypeScript
|
|
5
|
+
Official JavaScript/TypeScript SDK and installed CLI for [InstaVM](https://instavm.io). Use it to manage VMs, snapshots, shares, volumes, desktops, account settings, and code execution from Node.js or your shell.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -12,24 +12,89 @@ npm install instavm
|
|
|
12
12
|
|
|
13
13
|
**Requirements:** Node.js 18+, TypeScript 4.7+ (optional)
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## CLI
|
|
16
|
+
|
|
17
|
+
The published package includes an `instavm` binary.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx instavm --help
|
|
21
|
+
pnpm exec instavm --help
|
|
22
|
+
yarn exec instavm --help
|
|
23
|
+
bunx instavm --help
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If you want `instavm` directly on your PATH, install it globally:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install -g instavm
|
|
30
|
+
instavm --help
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The CLI stores defaults in `~/.instavm/config.json`, checks `INSTAVM_API_KEY` when no key is stored, and also respects `INSTAVM_BASE_URL` and `INSTAVM_SSH_HOST`.
|
|
34
|
+
|
|
35
|
+
### Auth & Config
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
instavm auth set-key
|
|
39
|
+
instavm auth status
|
|
40
|
+
printf '%s' "$INSTAVM_API_KEY" | instavm auth set-key
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Common Commands
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
instavm whoami
|
|
47
|
+
instavm ls
|
|
48
|
+
instavm create --type computer-use --memory 4096
|
|
49
|
+
instavm connect vm_123
|
|
50
|
+
instavm snapshot ls
|
|
51
|
+
instavm volume ls
|
|
52
|
+
instavm volume files upload <volume_id> ./README.md --path docs/README.md
|
|
53
|
+
instavm share create vm_123 3000 --public
|
|
54
|
+
instavm share set-private <share_id>
|
|
55
|
+
instavm ssh-key list
|
|
56
|
+
instavm desktop viewer <session_id>
|
|
57
|
+
instavm doc
|
|
58
|
+
instavm billing
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Command Reference
|
|
62
|
+
|
|
63
|
+
- `auth`: `set-key`, `status`, `logout`
|
|
64
|
+
- `whoami`: show account details and SSH keys
|
|
65
|
+
- `create`/`new`, `ls`/`list`, `rm`/`delete`, `clone`, `connect`: core VM workflows
|
|
66
|
+
- `snapshot`: `ls`, `create`, `build`, `get`, `rm`
|
|
67
|
+
- `desktop`: `status`, `start`, `stop`, `viewer`
|
|
68
|
+
- `volume`: `ls`, `get`, `create`, `update`, `rm`, `checkpoint`, `files`
|
|
69
|
+
- `share`: `create`, `set-public`, `set-private`, `revoke`
|
|
70
|
+
- `ssh-key`: `list`, `add`, `remove`
|
|
71
|
+
- `doc`/`docs`, `billing`: docs and billing links
|
|
72
|
+
|
|
73
|
+
All leaf commands support `--json`. Share visibility updates use `share_id`, which matches the public API.
|
|
74
|
+
|
|
75
|
+
## Library Quick Start
|
|
16
76
|
|
|
17
77
|
```typescript
|
|
18
78
|
import { InstaVM } from 'instavm';
|
|
19
79
|
|
|
20
80
|
const client = new InstaVM(process.env.INSTAVM_API_KEY || 'your_api_key');
|
|
21
81
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
82
|
+
const [me, vms] = await Promise.all([
|
|
83
|
+
client.getCurrentUser(),
|
|
84
|
+
client.vms.list(),
|
|
85
|
+
]);
|
|
86
|
+
|
|
87
|
+
console.log(me.email);
|
|
88
|
+
console.log(vms.length);
|
|
28
89
|
```
|
|
29
90
|
|
|
30
91
|
## Table of Contents
|
|
31
92
|
|
|
32
|
-
- [
|
|
93
|
+
- [CLI](#cli)
|
|
94
|
+
- [Auth & Config](#auth--config)
|
|
95
|
+
- [Common Commands](#common-commands)
|
|
96
|
+
- [Command Reference](#command-reference)
|
|
97
|
+
- [Library Quick Start](#library-quick-start)
|
|
33
98
|
- [Code Execution](#code-execution)
|
|
34
99
|
- [Cloud Mode](#cloud-mode)
|
|
35
100
|
- [Local Mode](#local-mode)
|
|
@@ -424,7 +489,13 @@ npm run build # Build package
|
|
|
424
489
|
|
|
425
490
|
## Changelog
|
|
426
491
|
|
|
427
|
-
Current package version: **0.
|
|
492
|
+
Current package version: **0.15.0**
|
|
493
|
+
|
|
494
|
+
### 0.15.0
|
|
495
|
+
|
|
496
|
+
- Installed `instavm` CLI for `npm`, `pnpm`, `yarn`, `bun`, and global package installs
|
|
497
|
+
- Stored CLI auth/config in `~/.instavm/config.json` with `INSTAVM_API_KEY` fallback
|
|
498
|
+
- Added [`getCurrentUser()`](#library-quick-start) and `getSessionStatus(sessionId?)` helpers for identity and desktop workflows
|
|
428
499
|
|
|
429
500
|
### 0.13.0
|
|
430
501
|
|