niahere 0.2.11 → 0.2.12
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/package.json +1 -1
- package/skills/modal-cli/SKILL.md +121 -0
package/package.json
CHANGED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: modal-cli
|
|
3
|
+
description: >
|
|
4
|
+
Modal CLI for serverless GPU/cloud compute. Use when user mentions modal, deploying to modal,
|
|
5
|
+
running GPU workloads, or serverless Python functions.
|
|
6
|
+
Check `which modal` first — if missing, offer: `pip install modal && modal setup`.
|
|
7
|
+
Covers run/serve/deploy, apps, containers, secrets, volumes, and workspace management.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
|
|
12
|
+
Before any modal command, verify the CLI is available:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
which modal
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**If not found**, ask the user:
|
|
19
|
+
|
|
20
|
+
> Modal CLI not found. Install it?
|
|
21
|
+
>
|
|
22
|
+
> ```bash
|
|
23
|
+
> pip install modal
|
|
24
|
+
> ```
|
|
25
|
+
|
|
26
|
+
After install, run auth setup:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
modal setup
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This opens a browser for token auth. If `modal` still isn't on PATH after pip install, use:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
python -m modal setup
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**If found but not authed**, check with:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
modal token info
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If that errors, run `modal setup` to authenticate.
|
|
45
|
+
|
|
46
|
+
## Core Commands
|
|
47
|
+
|
|
48
|
+
| Command | Purpose |
|
|
49
|
+
|---------|---------|
|
|
50
|
+
| `modal run <file>` | One-off execution of a script/function |
|
|
51
|
+
| `modal serve <file>` | Local dev with hot-reload |
|
|
52
|
+
| `modal deploy <file>` | Production deployment |
|
|
53
|
+
| `modal app list` | List deployed apps |
|
|
54
|
+
| `modal app logs <name>` | Stream logs for a deployed app |
|
|
55
|
+
| `modal app stop <name>` | Stop a running app |
|
|
56
|
+
| `modal shell` | Interactive shell in Modal environment |
|
|
57
|
+
|
|
58
|
+
## Workflows
|
|
59
|
+
|
|
60
|
+
### First-time setup
|
|
61
|
+
```bash
|
|
62
|
+
pip install modal
|
|
63
|
+
modal setup
|
|
64
|
+
modal run hello.py # validate end-to-end
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Develop and deploy
|
|
68
|
+
```bash
|
|
69
|
+
modal run my_app.py # test locally
|
|
70
|
+
modal serve my_app.py # hot-reload dev
|
|
71
|
+
modal deploy my_app.py # ship it
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Debug containers
|
|
75
|
+
```bash
|
|
76
|
+
modal container list
|
|
77
|
+
modal container logs <id>
|
|
78
|
+
modal container exec <id> -- bash -lc "nvidia-smi"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Manage resources
|
|
82
|
+
```bash
|
|
83
|
+
modal secret create my-secret KEY=value
|
|
84
|
+
modal volume create my-vol
|
|
85
|
+
modal environment create dev
|
|
86
|
+
modal config set-environment dev
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Auth & Profiles
|
|
90
|
+
|
|
91
|
+
- `modal token info` — check current auth
|
|
92
|
+
- `modal token new` — create token via browser
|
|
93
|
+
- `modal token set` — set token credentials directly
|
|
94
|
+
- `modal profile list` / `activate` — switch workspaces
|
|
95
|
+
- `modal config show` — print effective config
|
|
96
|
+
|
|
97
|
+
Environment variables: `MODAL_TOKEN_ID`, `MODAL_TOKEN_SECRET`, `MODAL_ENVIRONMENT`, `MODAL_PROFILE`
|
|
98
|
+
|
|
99
|
+
## Resource Management
|
|
100
|
+
|
|
101
|
+
- **Secrets**: `modal secret list/create/delete` (supports `.env` import)
|
|
102
|
+
- **Volumes**: `modal volume create/list/ls/put/get/rm/delete`
|
|
103
|
+
- **Dicts**: `modal dict create/list/items/get/clear/delete`
|
|
104
|
+
- **Queues**: `modal queue create/list/peek/len/clear/delete`
|
|
105
|
+
- **NFS**: `modal nfs list/create/ls/put/get/rm/delete`
|
|
106
|
+
- **Environments**: `modal environment list/create/delete/update`
|
|
107
|
+
|
|
108
|
+
## Decision Points
|
|
109
|
+
|
|
110
|
+
- User says "deploy to modal" / "run on GPU" → `modal deploy` or `modal run`
|
|
111
|
+
- User says "check my modal apps" → `modal app list`
|
|
112
|
+
- User says "modal logs" → `modal app logs <name>`
|
|
113
|
+
- User needs interactive debug → `modal shell` or `modal container exec`
|
|
114
|
+
- modal not installed → offer install, don't silently fail
|
|
115
|
+
- modal not authed → run `modal setup`
|
|
116
|
+
|
|
117
|
+
## References
|
|
118
|
+
|
|
119
|
+
- Guide: https://modal.com/docs/guide
|
|
120
|
+
- CLI reference: https://modal.com/docs/reference/cli/
|
|
121
|
+
- Status: https://status.modal.com
|