@dropthis/cli 0.1.5 → 0.2.1
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 +119 -113
- package/dist/cli.cjs +473 -260
- package/dist/cli.cjs.map +1 -1
- package/package.json +1 -3
package/README.md
CHANGED
|
@@ -1,171 +1,177 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @dropthis/cli
|
|
2
2
|
|
|
3
|
-
Official CLI for
|
|
4
|
-
|
|
5
|
-
## For AI Agents
|
|
6
|
-
|
|
7
|
-
Read [SKILL.md](./SKILL.md) and follow the instructions to publish with dropthis.
|
|
8
|
-
|
|
9
|
-
## For Humans
|
|
10
|
-
|
|
11
|
-
1. Copy the instruction above and send it to your AI agent.
|
|
12
|
-
2. Your agent will install dropthis and ask for your email.
|
|
13
|
-
3. Check your inbox for an OTP code and give it to your agent.
|
|
14
|
-
4. Done — your agent can now publish pages for you.
|
|
3
|
+
Official CLI for [dropthis](https://dropthis.app) -- the publish layer between AI and the internet. Publish a file, folder, or HTML string and get a URL back.
|
|
15
4
|
|
|
16
5
|
## Install
|
|
17
6
|
|
|
18
7
|
```bash
|
|
19
|
-
npm install -g dropthis
|
|
8
|
+
npm install -g @dropthis/cli
|
|
20
9
|
```
|
|
21
10
|
|
|
22
|
-
##
|
|
23
|
-
|
|
24
|
-
The CLI resolves credentials in this order:
|
|
25
|
-
|
|
26
|
-
1. `--api-key sk_...`
|
|
27
|
-
2. `DROPTHIS_API_KEY`
|
|
28
|
-
3. Stored credential from `dropthis login`
|
|
29
|
-
|
|
30
|
-
For local development, override the API URL with `DROPTHIS_API_URL` or `--api-url`.
|
|
11
|
+
## Quick start
|
|
31
12
|
|
|
32
13
|
```bash
|
|
33
|
-
|
|
14
|
+
dropthis login
|
|
15
|
+
dropthis publish index.html
|
|
34
16
|
```
|
|
35
17
|
|
|
36
|
-
##
|
|
18
|
+
## Authentication
|
|
37
19
|
|
|
38
|
-
|
|
20
|
+
Log in with email OTP:
|
|
39
21
|
|
|
40
22
|
```bash
|
|
41
|
-
dropthis login
|
|
42
|
-
dropthis login verify --email user@example.com --otp 123456 --json
|
|
23
|
+
dropthis login
|
|
43
24
|
```
|
|
44
25
|
|
|
45
|
-
|
|
26
|
+
The CLI prompts for your email and a one-time code. For non-interactive environments, pass both:
|
|
46
27
|
|
|
47
28
|
```bash
|
|
48
|
-
dropthis login --email
|
|
29
|
+
dropthis login --email you@example.com --otp 123456
|
|
49
30
|
```
|
|
50
31
|
|
|
51
|
-
|
|
32
|
+
Credentials resolve in this order:
|
|
52
33
|
|
|
53
|
-
|
|
34
|
+
1. `--api-key sk_...` flag
|
|
35
|
+
2. `DROPTHIS_API_KEY` environment variable
|
|
36
|
+
3. Stored credential from `dropthis login`
|
|
54
37
|
|
|
55
38
|
```bash
|
|
56
|
-
dropthis
|
|
57
|
-
dropthis
|
|
58
|
-
dropthis publish https://example.com/demo.html --json
|
|
59
|
-
dropthis publish - --content-type text/html --path index.html --json
|
|
39
|
+
dropthis whoami
|
|
40
|
+
dropthis logout
|
|
60
41
|
```
|
|
61
42
|
|
|
62
|
-
##
|
|
63
|
-
|
|
64
|
-
Dropthis can publish single files, static sites, generated HTML, URLs, piped stdin, and multi-file bundles.
|
|
43
|
+
## Publish
|
|
65
44
|
|
|
66
45
|
```bash
|
|
67
|
-
#
|
|
68
|
-
dropthis publish report.html
|
|
69
|
-
|
|
70
|
-
# A static site or app build
|
|
71
|
-
dropthis publish ./dist --entry index.html --url
|
|
72
|
-
|
|
73
|
-
# Multiple files as one bundled drop
|
|
74
|
-
dropthis publish index.html styles.css app.js --json
|
|
46
|
+
# HTML file
|
|
47
|
+
dropthis publish report.html
|
|
75
48
|
|
|
76
|
-
#
|
|
77
|
-
dropthis publish
|
|
49
|
+
# Directory
|
|
50
|
+
dropthis publish ./dist
|
|
78
51
|
|
|
79
|
-
#
|
|
80
|
-
echo "<h1>Hello
|
|
52
|
+
# Stdin
|
|
53
|
+
echo "<h1>Hello</h1>" | dropthis publish - --content-type text/html --path index.html
|
|
81
54
|
|
|
82
|
-
#
|
|
83
|
-
|
|
55
|
+
# Multiple files bundled into one drop
|
|
56
|
+
dropthis publish index.html styles.css app.js
|
|
84
57
|
|
|
85
|
-
#
|
|
86
|
-
dropthis publish ./dist --
|
|
58
|
+
# Print only the URL
|
|
59
|
+
dropthis publish ./dist --url
|
|
87
60
|
```
|
|
88
61
|
|
|
89
|
-
|
|
62
|
+
### Options
|
|
90
63
|
|
|
91
|
-
|
|
64
|
+
```bash
|
|
65
|
+
dropthis publish ./dist \
|
|
66
|
+
--title "Launch page" \
|
|
67
|
+
--visibility unlisted \
|
|
68
|
+
--password s3cret \
|
|
69
|
+
--entry index.html \
|
|
70
|
+
--expires-at 2026-12-31T00:00:00Z
|
|
71
|
+
```
|
|
92
72
|
|
|
93
|
-
|
|
73
|
+
All publish options:
|
|
74
|
+
|
|
75
|
+
| Flag | Description |
|
|
76
|
+
|------|-------------|
|
|
77
|
+
| `--title <title>` | Drop title |
|
|
78
|
+
| `--visibility <public\|unlisted>` | Drop visibility |
|
|
79
|
+
| `--password <password>` | Set password protection |
|
|
80
|
+
| `--no-password` | Clear password |
|
|
81
|
+
| `--noindex` | Prevent search indexing |
|
|
82
|
+
| `--index` | Allow indexing |
|
|
83
|
+
| `--entry <path>` | Entry file for directories |
|
|
84
|
+
| `--content-type <mime>` | MIME type (required for stdin) |
|
|
85
|
+
| `--path <path>` | Filename (required for stdin) |
|
|
86
|
+
| `--expires-at <datetime>` | Expiration datetime |
|
|
87
|
+
| `--metadata <json>` | Metadata as JSON string |
|
|
88
|
+
| `--metadata-file <path>` | Metadata from a JSON file |
|
|
89
|
+
| `--idempotency-key <key>` | Idempotency key |
|
|
90
|
+
| `--from-json <path>` | Read exact POST /drops JSON request body from file |
|
|
91
|
+
| `--url` | Print only the URL, nothing else |
|
|
92
|
+
| `--json` | Output full JSON response |
|
|
93
|
+
| `--dry-run` | Validate without publishing |
|
|
94
|
+
|
|
95
|
+
### Global flags
|
|
96
|
+
|
|
97
|
+
These flags are inherited by all commands, including `publish`:
|
|
98
|
+
|
|
99
|
+
| Flag | Description |
|
|
100
|
+
|------|-------------|
|
|
101
|
+
| `--api-key <key>` | Override API key for this invocation |
|
|
102
|
+
| `--api-url <url>` | Override API base URL |
|
|
103
|
+
| `-q, --quiet` | Suppress status output and imply JSON |
|
|
104
|
+
|
|
105
|
+
## Update
|
|
94
106
|
|
|
95
|
-
|
|
107
|
+
```bash
|
|
108
|
+
# Replace content
|
|
109
|
+
dropthis update drop_abc123 ./dist-v2
|
|
96
110
|
|
|
97
|
-
|
|
111
|
+
# Update metadata only
|
|
112
|
+
dropthis update drop_abc123 --title "New title"
|
|
98
113
|
|
|
99
|
-
|
|
100
|
-
--
|
|
101
|
-
--visibility <public|unlisted>
|
|
102
|
-
--password <password>
|
|
103
|
-
--no-password
|
|
104
|
-
--noindex
|
|
105
|
-
--index
|
|
106
|
-
--expires-at <datetime>
|
|
107
|
-
--metadata <json>
|
|
108
|
-
--metadata-file <path>
|
|
109
|
-
--entry <path>
|
|
110
|
-
--content-type <mime>
|
|
111
|
-
--path <path>
|
|
112
|
-
--idempotency-key <key>
|
|
114
|
+
# Optimistic concurrency
|
|
115
|
+
dropthis update drop_abc123 ./dist-v2 --if-revision 1
|
|
113
116
|
```
|
|
114
117
|
|
|
115
118
|
## Commands
|
|
116
119
|
|
|
117
120
|
```bash
|
|
118
|
-
dropthis publish <input>
|
|
119
|
-
dropthis update <drop-id> [input]
|
|
120
|
-
|
|
121
|
-
dropthis drops
|
|
122
|
-
dropthis drops
|
|
123
|
-
dropthis drops
|
|
124
|
-
dropthis
|
|
125
|
-
dropthis api-keys list --json
|
|
126
|
-
dropthis api-keys delete <key-id> --yes --json
|
|
127
|
-
dropthis account get --json
|
|
128
|
-
dropthis whoami --json
|
|
129
|
-
dropthis doctor --json
|
|
130
|
-
dropthis commands --json
|
|
131
|
-
```
|
|
121
|
+
dropthis publish <input> # Publish content, get a URL
|
|
122
|
+
dropthis update <drop-id> [input] # Update an existing drop
|
|
123
|
+
|
|
124
|
+
dropthis drops list # List your drops
|
|
125
|
+
dropthis drops get <drop-id> # Get drop details
|
|
126
|
+
dropthis drops update <drop-id> # Update drop metadata
|
|
127
|
+
dropthis drops delete <drop-id> # Delete a drop
|
|
132
128
|
|
|
133
|
-
|
|
129
|
+
dropthis login # Authenticate with email OTP
|
|
130
|
+
dropthis logout # Remove stored credentials
|
|
131
|
+
dropthis whoami # Show current auth status
|
|
132
|
+
dropthis account get # Account details
|
|
134
133
|
|
|
135
|
-
|
|
134
|
+
dropthis api-keys create # Create an API key
|
|
135
|
+
dropthis api-keys list # List API keys
|
|
136
|
+
dropthis api-keys delete <key-id> # Delete an API key
|
|
136
137
|
|
|
137
|
-
|
|
138
|
+
dropthis deployments list <drop-id> # List deployments
|
|
139
|
+
dropthis deployments get <drop-id> <dep-id> # Get deployment details
|
|
138
140
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
1 API or generic error
|
|
142
|
-
2 invalid usage
|
|
143
|
-
3 auth required
|
|
144
|
-
4 local input error
|
|
145
|
-
5 network error
|
|
141
|
+
dropthis doctor # CLI diagnostics
|
|
142
|
+
dropthis commands # Machine-readable command metadata
|
|
146
143
|
```
|
|
147
144
|
|
|
148
|
-
##
|
|
145
|
+
## CI / Automation
|
|
149
146
|
|
|
150
|
-
|
|
147
|
+
Set `DROPTHIS_API_KEY` to skip interactive login:
|
|
151
148
|
|
|
152
149
|
```bash
|
|
153
|
-
|
|
154
|
-
dropthis publish
|
|
150
|
+
export DROPTHIS_API_KEY=sk_live_...
|
|
151
|
+
dropthis publish ./dist --url
|
|
155
152
|
```
|
|
156
153
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
|
154
|
+
All commands support `--json` for structured output. Errors write to stderr with stable exit codes:
|
|
155
|
+
|
|
156
|
+
| Code | Meaning |
|
|
157
|
+
|------|---------|
|
|
158
|
+
| 0 | Success |
|
|
159
|
+
| 1 | API or generic error |
|
|
160
|
+
| 2 | Invalid usage |
|
|
161
|
+
| 3 | Auth required |
|
|
162
|
+
| 4 | Local input error |
|
|
163
|
+
| 5 | Network error |
|
|
160
164
|
|
|
161
|
-
## Agent
|
|
165
|
+
## Agent skills
|
|
166
|
+
|
|
167
|
+
This CLI ships with an [agent skill](https://skills.sh) that teaches AI coding agents (Cursor, Claude Code, Windsurf, etc.) how to use the dropthis CLI effectively, including non-interactive flags, output formats, and common pitfalls.
|
|
162
168
|
|
|
163
169
|
```bash
|
|
164
|
-
|
|
165
|
-
dropthis publish ./dist --json
|
|
166
|
-
dropthis update drop_01hzz00000000000000000 ./dist --if-revision 1 --json
|
|
167
|
-
dropthis update drop_01hzz00000000000000000 --title "Final" --json
|
|
168
|
-
dropthis deployments list drop_01hzz00000000000000000 --json
|
|
169
|
-
dropthis deployments get drop_01hzz00000000000000000 dep_01hzz00000000000000000 --json
|
|
170
|
-
DROPTHIS_API_KEY=$DROPTHIS_API_KEY dropthis doctor --json
|
|
170
|
+
npx skills add dropthis-dev/dropthis-cli
|
|
171
171
|
```
|
|
172
|
+
|
|
173
|
+
## Links
|
|
174
|
+
|
|
175
|
+
- [Website](https://dropthis.app)
|
|
176
|
+
- [GitHub](https://github.com/dropthis-dev/dropthis-cli)
|
|
177
|
+
- [npm](https://www.npmjs.com/package/@dropthis/cli)
|