@dropthis/cli 0.1.5 → 0.2.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 CHANGED
@@ -1,171 +1,177 @@
1
- # Dropthis CLI
1
+ # @dropthis/cli
2
2
 
3
- Official CLI for Dropthis. Publish a file, folder, URL, stdin, or generated artifact and get a stable URL back.
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
- ## Authentication
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
- DROPTHIS_API_KEY=sk_live_... dropthis whoami --json
14
+ dropthis login
15
+ dropthis publish index.html
34
16
  ```
35
17
 
36
- ## Login
18
+ ## Authentication
37
19
 
38
- Production login uses email OTP. Verification creates a durable API key through the SDK and stores it securely by default.
20
+ Log in with email OTP:
39
21
 
40
22
  ```bash
41
- dropthis login request --email user@example.com --json
42
- dropthis login verify --email user@example.com --otp 123456 --json
23
+ dropthis login
43
24
  ```
44
25
 
45
- You can also verify in one command after an OTP has already been requested:
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 user@example.com --otp 123456 --json
29
+ dropthis login --email you@example.com --otp 123456
49
30
  ```
50
31
 
51
- Use `--insecure-storage` only when you explicitly accept plaintext credential storage.
32
+ Credentials resolve in this order:
52
33
 
53
- ## Publish
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 publish ./site --json
57
- dropthis publish ./site --url
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
- ## What You Can Publish
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
- # A single HTML file
68
- dropthis publish report.html --title "Q4 Report" --json
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
- # A URL fetched by Dropthis
77
- dropthis publish https://example.com/demo.html --json
49
+ # Directory
50
+ dropthis publish ./dist
78
51
 
79
- # Generated HTML from stdin
80
- echo "<h1>Hello from Dropthis</h1>" | dropthis publish - --content-type text/html --path index.html --url
52
+ # Stdin
53
+ echo "<h1>Hello</h1>" | dropthis publish - --content-type text/html --path index.html
81
54
 
82
- # Generated JSON from stdin
83
- printf '{"status":"ok"}' | dropthis publish - --content-type application/json --path status.json --json
55
+ # Multiple files bundled into one drop
56
+ dropthis publish index.html styles.css app.js
84
57
 
85
- # Validate before publishing
86
- dropthis publish ./dist --dry-run
58
+ # Print only the URL
59
+ dropthis publish ./dist --url
87
60
  ```
88
61
 
89
- For files and folders, content types are detected automatically. Use `--content-type` and `--path` when publishing stdin or generated content so the drop has the right MIME type and filename.
62
+ ### Options
90
63
 
91
- `--url` prints only the URL and takes precedence over JSON, quiet mode, and TTY detection.
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
- `--dry-run` validates everything (auth, input detection, file collection) without calling the API. Outputs what would be published as JSON.
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
- Local files, folders, large stdin content, and explicit file inputs publish through staged uploads in the SDK. If `--idempotency-key` is omitted, content publish/update commands generate one automatically.
107
+ ```bash
108
+ # Replace content
109
+ dropthis update drop_abc123 ./dist-v2
96
110
 
97
- Common publish options:
111
+ # Update metadata only
112
+ dropthis update drop_abc123 --title "New title"
98
113
 
99
- ```txt
100
- --title <title>
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
- dropthis drops list --json
121
- dropthis drops get <drop-id> --json
122
- dropthis drops update <drop-id> --title "New title" --json
123
- dropthis drops delete <drop-id> --yes --json
124
- dropthis api-keys create --label CI --json
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
- ## Output Modes
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
- Interactive TTY output is human-friendly. CI, pipes, non-TTY stdout, `--json`, and `--quiet` use JSON. Success writes to stdout. Errors write to stderr.
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
- Machine errors use stable exit codes:
138
+ dropthis deployments list <drop-id> # List deployments
139
+ dropthis deployments get <drop-id> <dep-id> # Get deployment details
138
140
 
139
- ```txt
140
- 0 success
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
- ## Examples
145
+ ## CI / Automation
149
146
 
150
- The `examples/` directory contains ready-to-publish HTML files you can try:
147
+ Set `DROPTHIS_API_KEY` to skip interactive login:
151
148
 
152
149
  ```bash
153
- # Publish the multi-step waitlist form
154
- dropthis publish examples/multi-step-form.html --title "Waitlist Form" --url
150
+ export DROPTHIS_API_KEY=sk_live_...
151
+ dropthis publish ./dist --url
155
152
  ```
156
153
 
157
- | File | Description | Live Demo |
158
- |------|-------------|-----------|
159
- | `multi-step-form.html` | Tally-style 4-step waitlist form with validation, transitions, and confetti | [View](https://d4b0mqc.dropthis.app/) |
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 And CI Examples
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
- dropthis commands --json
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)