@dropthis/cli 0.9.1 → 0.9.3

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
@@ -126,51 +126,50 @@ These flags are inherited by all commands:
126
126
 
127
127
  ## Update
128
128
 
129
- Update an existing drop's content, metadata, or both via `drops update`:
129
+ Change an existing drop without creating a new URL. Content and settings are **separate** operations — pass the full `drop_…` id (not the slug):
130
130
 
131
131
  ```bash
132
- # Replace content
133
- dropthis drops update drop_abc123 ./dist-v2
132
+ # Replace the content at the same URL (ships a new deployment)
133
+ dropthis update-content drop_abc123 ./dist-v2
134
134
 
135
- # Update metadata only
136
- dropthis drops update drop_abc123 --title "New title"
135
+ # Change settings only — title, visibility, password, expiry, metadata
136
+ dropthis update-settings drop_abc123 --title "New title"
137
137
 
138
- # Optimistic concurrency
139
- dropthis drops update drop_abc123 ./dist-v2 --if-revision 1
140
-
141
- # Change vanity slug
142
- dropthis drops update drop_abc123 --slug new-slug
138
+ # Optimistic concurrency (both accept --if-revision)
139
+ dropthis update-content drop_abc123 ./dist-v2 --if-revision 1
143
140
  ```
144
141
 
145
- `drops update` supports all publish flags plus `--slug` and `--if-revision`.
142
+ `update-content` replaces the files at the URL; `update-settings` changes title, visibility, password, noindex, expiry, or metadata. Creating a new drop is always `publish` neither update command makes a new URL.
146
143
 
147
144
  ## Commands
148
145
 
149
146
  ```bash
150
- dropthis [input...] # Publish content (default command)
151
- dropthis publish [input...] # Same as above, explicit form
147
+ dropthis [input...] # Publish content (default command)
148
+ dropthis publish [input...] # Same as above, explicit form
149
+
150
+ dropthis update-content <drop-id> [input] # Replace a drop's content (same URL)
151
+ dropthis update-settings <drop-id> # Change title/visibility/password/expiry/metadata
152
+ dropthis get <drop-id> # Show drop details
153
+ dropthis list # List your drops
154
+ dropthis delete <drop-id> # Delete a drop (--yes to confirm)
152
155
 
153
- dropthis drops list # List your drops
154
- dropthis drops get <drop-id> # Get drop details
155
- dropthis drops update <drop-id> [input] # Update content or metadata
156
- dropthis drops delete <drop-id> # Delete a drop
156
+ dropthis deployments # View deployment history
157
157
 
158
- dropthis login # Authenticate with email OTP
159
- dropthis login request --email <email> # Request OTP (non-interactive)
160
- dropthis login verify --email <email> --otp <code> # Verify OTP
161
- dropthis logout # Remove stored credentials
162
- dropthis whoami # Show current auth status
163
- dropthis account # Account details
158
+ dropthis login # Authenticate with email OTP
159
+ dropthis login request --email <email> # Request OTP (non-interactive)
160
+ dropthis login verify --email <email> --otp <code> # Verify OTP
161
+ dropthis logout # Remove stored credentials
162
+ dropthis whoami # Show current auth status
164
163
 
165
- dropthis api-keys create # Create an API key
166
- dropthis api-keys list # List API keys
167
- dropthis api-keys delete <key-id> # Delete an API key
164
+ dropthis account # Show account details
165
+ dropthis account update --display-name <name> # Update your display name
168
166
 
169
- dropthis deployments list <drop-id> # List deployments
170
- dropthis deployments get <drop-id> <dep-id> # Get deployment details
167
+ dropthis api-keys create # Create an API key
168
+ dropthis api-keys list # List API keys
169
+ dropthis api-keys delete <key-id> # Delete an API key (--yes to confirm)
171
170
 
172
- dropthis doctor # CLI diagnostics
173
- dropthis commands # Machine-readable command metadata
171
+ dropthis doctor # CLI diagnostics
172
+ dropthis commands # Machine-readable command metadata
174
173
  ```
175
174
 
176
175
  ## Agent & CI/CD usage
@@ -193,7 +192,7 @@ dropthis publish ./dist --url
193
192
 
194
193
  - Use `--url` to get only the published URL (cleanest for agents)
195
194
  - Use `--json` for the full structured response
196
- - Use `--yes` for destructive commands (`drops delete`, `api-keys delete`)
195
+ - Use `--yes` for destructive commands (`delete`, `api-keys delete`, `account delete`)
197
196
  - Use `--no-interactive` to disable inline auth prompts
198
197
  - All errors write to stderr as JSON with a `next_action` field
199
198
 
package/dist/cli.cjs CHANGED
@@ -769,13 +769,13 @@ async function runDoctor(_input, deps) {
769
769
  const authSource = credential?.source ?? "missing";
770
770
  const storageBackend = stored?.storage ?? "none";
771
771
  const pairs = [
772
- ["Version", "0.9.1"],
772
+ ["Version", "0.9.3"],
773
773
  ["Auth", authSource],
774
774
  ["Storage", storageBackend]
775
775
  ];
776
776
  writeKv(deps, pairs, {
777
777
  ok: true,
778
- version: "0.9.1",
778
+ version: "0.9.3",
779
779
  auth: { source: authSource },
780
780
  storage: { backend: storageBackend }
781
781
  });
@@ -1108,7 +1108,6 @@ async function parseDropOptions(raw) {
1108
1108
  "--metadata-file"
1109
1109
  ) : void 0;
1110
1110
  return {
1111
- ...raw.slug ? { slug: raw.slug } : {},
1112
1111
  ...raw.title ? { title: raw.title } : {},
1113
1112
  ...raw.visibility ? { visibility: raw.visibility } : {},
1114
1113
  ...raw.password ? { password: raw.password } : {},
@@ -1277,7 +1276,7 @@ async function handlePublishDryRun(input, raw, deps, client) {
1277
1276
 
1278
1277
  // src/commands/update-content.ts
1279
1278
  var NO_CONTENT_MESSAGE = "update-content requires content. Provide a file, folder, URL, or text to ship a new deployment.";
1280
- var NO_CONTENT_NEXT_ACTION = "Pass an input, e.g. dropthis update-content <dropId> ./dist. To change title, visibility, password, slug, expiry, or metadata, use dropthis update-settings <dropId> instead.";
1279
+ var NO_CONTENT_NEXT_ACTION = "Pass an input, e.g. dropthis update-content <dropId> ./dist. To change title, visibility, password, expiry, or metadata, use dropthis update-settings <dropId> instead.";
1281
1280
  function contentOptions(options) {
1282
1281
  const out = {};
1283
1282
  if (options.entry !== void 0) out.entry = options.entry;
@@ -1386,7 +1385,7 @@ function assertDropId(target) {
1386
1385
  // src/commands/update-settings.ts
1387
1386
  var prompts4 = __toESM(require("@clack/prompts"), 1);
1388
1387
  var NO_SETTINGS_MESSAGE = "Nothing to update. Provide at least one settings option.";
1389
- var NO_SETTINGS_NEXT_ACTION = "Run dropthis update-settings --help, or retry with one of: --title, --slug, --visibility, --password, --no-password, --noindex, --index, --expires-at, --metadata, or --metadata-file. To replace the content at the URL instead, use dropthis update-content <dropId> ./dist.";
1388
+ var NO_SETTINGS_NEXT_ACTION = "Run dropthis update-settings --help, or retry with one of: --title, --visibility, --password, --no-password, --noindex, --index, --expires-at, --metadata, or --metadata-file. To replace the content at the URL instead, use dropthis update-content <dropId> ./dist.";
1390
1389
  async function runUpdateSettings(dropId, raw, deps) {
1391
1390
  try {
1392
1391
  await requireCredential({
@@ -1462,7 +1461,6 @@ async function promptForSettings(target, prompt) {
1462
1461
  required: true,
1463
1462
  options: [
1464
1463
  { value: "title", label: "Title", hint: "--title" },
1465
- { value: "slug", label: "Slug", hint: "--slug" },
1466
1464
  { value: "visibility", label: "Visibility", hint: "--visibility" },
1467
1465
  {
1468
1466
  value: "password",
@@ -1492,14 +1490,6 @@ async function promptForSettings(target, prompt) {
1492
1490
  if (prompt.isCancel(value)) return cancel2(prompt);
1493
1491
  options.title = value.trim();
1494
1492
  }
1495
- if (selected.has("slug")) {
1496
- const value = await prompt.text({
1497
- message: "Slug",
1498
- validate: requireNonEmpty("Enter a slug.")
1499
- });
1500
- if (prompt.isCancel(value)) return cancel2(prompt);
1501
- options.slug = value.trim();
1502
- }
1503
1493
  if (selected.has("visibility")) {
1504
1494
  const value = await prompt.select({
1505
1495
  message: "Visibility",
@@ -1603,7 +1593,6 @@ async function handleDryRun2(dropId, raw, deps) {
1603
1593
  assertDropId2(dropId);
1604
1594
  const options = await parseDropOptions(raw);
1605
1595
  const fields = {};
1606
- if (options.slug) fields.slug = options.slug;
1607
1596
  if (options.title) fields.title = options.title;
1608
1597
  if (options.visibility) fields.visibility = options.visibility;
1609
1598
  if (options.password !== void 0) fields.password = options.password;
@@ -1833,7 +1822,7 @@ function buildProgram(options = {}) {
1833
1822
  ` ${import_picocolors4.default.cyan("dropthis login")}`,
1834
1823
  ` ${import_picocolors4.default.cyan("dropthis publish ./dist")}`
1835
1824
  ].join("\n")
1836
- ).version("0.9.1").configureHelp({
1825
+ ).version("0.9.3").configureHelp({
1837
1826
  subcommandTerm(cmd) {
1838
1827
  const args = cmd.registeredArguments.map((a) => {
1839
1828
  const name = a.name();
@@ -1853,7 +1842,7 @@ function buildProgram(options = {}) {
1853
1842
  program.option("-q, --quiet", "Suppress status output and imply JSON");
1854
1843
  program.option("--no-interactive", "Disable interactive prompts");
1855
1844
  program.command("publish [input...]", { isDefault: true }).description(
1856
- "Publish content to a permanent public URL (also: share, post, put online, make public, get a link).\nFiles, folders, URLs, strings, or stdin; multiple files bundle into one drop. Use - for stdin, or pipe without args.\nCreates a NEW drop each run \u2014 to change one you already published, use update-content (the files) or update-settings (title/visibility/password/slug/expiry/metadata) with its drop_\u2026 id, not publish again."
1845
+ "Publish content to a permanent public URL (also: share, post, put online, make public, get a link).\nFiles, folders, URLs, strings, or stdin; multiple files bundle into one drop. Use - for stdin, or pipe without args.\nCreates a NEW drop each run \u2014 to change one you already published, use update-content (the files) or update-settings (title/visibility/password/expiry/metadata) with its drop_\u2026 id, not publish again."
1857
1846
  ).option("--title <title>", "Drop title").option("--visibility <v>", "public or unlisted (default: public)").option("--password <password>", "Require password to view").option("--noindex", "Prevent search-engine indexing").option("--expires-at <datetime>", "Auto-delete after this ISO 8601 date").option(
1858
1847
  "--content-type <mime>",
1859
1848
  "Override MIME type (auto-detected from extension)"
@@ -1906,7 +1895,7 @@ function buildProgram(options = {}) {
1906
1895
  process.exitCode = result.exitCode;
1907
1896
  });
1908
1897
  program.command("update-content <dropId> [input...]").description(
1909
- "Replace a drop's content, same URL (pass the full drop_\u2026 id, not the slug).\nShips a new deployment. Settings stay unchanged \u2014 use update-settings for title, visibility, password, slug, expiry, or metadata."
1898
+ "Replace a drop's content, same URL (pass the full drop_\u2026 id, not the slug).\nShips a new deployment. Settings stay unchanged \u2014 use update-settings for title, visibility, password, expiry, or metadata."
1910
1899
  ).option(
1911
1900
  "--entry <path>",
1912
1901
  "Entry file for multi-file bundles (default: index.html)"
@@ -1961,8 +1950,8 @@ function buildProgram(options = {}) {
1961
1950
  }
1962
1951
  );
1963
1952
  program.command("update-settings <dropId>").description(
1964
- "Change a drop's title, visibility, password, vanity slug, expiry, or metadata (pass the full drop_\u2026 id, not the slug).\nContent stays unchanged \u2014 use update-content to replace the files at the URL."
1965
- ).option("--slug <slug>", "Change the vanity slug").option("--title <title>", "Change title").option("--visibility <v>", "Set to public or unlisted").option("--password <password>", "Require password to view").option("--no-password", "Remove password protection").option("--noindex", "Prevent search-engine indexing").option("--index", "Allow search-engine indexing").option("--expires-at <datetime>", "Auto-delete after this ISO 8601 date").option(
1953
+ "Change a drop's title, visibility, password, expiry, or metadata (pass the full drop_\u2026 id, not the slug).\nContent stays unchanged \u2014 use update-content to replace the files at the URL."
1954
+ ).option("--title <title>", "Change title").option("--visibility <v>", "Set to public or unlisted").option("--password <password>", "Require password to view").option("--no-password", "Remove password protection").option("--noindex", "Prevent search-engine indexing").option("--index", "Allow search-engine indexing").option("--expires-at <datetime>", "Auto-delete after this ISO 8601 date").option(
1966
1955
  "--metadata <json>",
1967
1956
  `Attach JSON key-value pairs, e.g. '{"source":"ci"}'`
1968
1957
  ).option("--metadata-file <path>", "Read metadata JSON from a file").option(
@@ -2268,7 +2257,6 @@ function globalOptions(program, commandOptions) {
2268
2257
  }
2269
2258
  function toDropOptions(options) {
2270
2259
  return {
2271
- ...options.slug ? { slug: options.slug } : {},
2272
2260
  ...options.title ? { title: options.title } : {},
2273
2261
  ...options.visibility ? { visibility: options.visibility } : {},
2274
2262
  ...typeof options.password === "string" ? { password: options.password } : {},