@adsuploader/cli 0.1.1 → 0.1.2

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.
Files changed (3) hide show
  1. package/SKILL.md +6 -2
  2. package/dist/cli.cjs +19 -21
  3. package/package.json +1 -1
package/SKILL.md CHANGED
@@ -228,14 +228,18 @@ When using `copyFromAd`, provide the upload batch and optionally campaign/ad set
228
228
 
229
229
  ### Budget / Bid Override
230
230
 
231
- Values in account currency units (e.g. `50` = $50). Only one at a time.
231
+ Values in account currency units (e.g. `50` = $50). `dailyBudget` and `bidAmount` are independent Meta fields.
232
+
233
+ - **ABO** (budget on the ad set): set `dailyBudget`, `bidAmount`, or both. Bid-cap strategies (`COST_CAP`, `LOWEST_COST_WITH_BID_CAP`, `TARGET_COST`) need `bidAmount` alongside the budget.
234
+ - **CBO** (budget on the campaign): don't set `dailyBudget` on the ad set — Meta rejects that since budget comes from the campaign. For bid-cap strategies, set only `bidAmount`.
232
235
 
233
236
  ```json
234
237
  { "adSet": { "dailyBudget": 50 } }
235
238
  { "adSet": { "bidAmount": 5 } }
239
+ { "adSet": { "dailyBudget": 50, "bidAmount": 5 } }
236
240
  ```
237
241
 
238
- Also available as CLI flags: `--daily-budget 50` or `--bid-amount 5`.
242
+ Also available as CLI flags: `--daily-budget 50`, `--bid-amount 5`, or both.
239
243
 
240
244
  ### Text Configuration
241
245
 
package/dist/cli.cjs CHANGED
@@ -4726,21 +4726,20 @@ function adCommand() {
4726
4726
  console.log(` ${import_picocolors7.default.bold("Campaign:")} ${ad.campaignId}`);
4727
4727
  console.log(` ${import_picocolors7.default.bold("Ad Set:")} ${ad.adSetId}`);
4728
4728
  if (ad.creative) {
4729
+ const label = (name) => import_picocolors7.default.bold(name.padEnd(15));
4729
4730
  console.log("");
4730
4731
  console.log(` ${import_picocolors7.default.bold("Creative")}`);
4731
- if (ad.creative.headline) console.log(` ${import_picocolors7.default.bold("Headline:")} ${truncate(ad.creative.headline)}`);
4732
- if (ad.creative.headlines) console.log(` ${import_picocolors7.default.bold("Headlines:")} ${ad.creative.headlines.map((h2) => truncate(h2, 60)).join(" | ")}`);
4733
- if (ad.creative.primaryText) console.log(` ${import_picocolors7.default.bold("Primary Text:")} ${truncate(ad.creative.primaryText)}`);
4734
- if (ad.creative.primaryTexts) console.log(` ${import_picocolors7.default.bold("Primary Texts:")} ${ad.creative.primaryTexts.map((t) => truncate(t, 60)).join(" | ")}`);
4735
- if (ad.creative.description) console.log(` ${import_picocolors7.default.bold("Description:")} ${truncate(ad.creative.description)}`);
4736
- if (ad.creative.descriptions) console.log(` ${import_picocolors7.default.bold("Descriptions:")} ${ad.creative.descriptions.map((d3) => truncate(d3, 60)).join(" | ")}`);
4737
- if (ad.creative.cta) console.log(` ${import_picocolors7.default.bold("CTA:")} ${ad.creative.cta}`);
4738
- if (ad.creative.link) console.log(` ${import_picocolors7.default.bold("Link:")} ${ad.creative.link}`);
4739
- if (ad.creative.displayUrl) console.log(` ${import_picocolors7.default.bold("Display URL:")} ${ad.creative.displayUrl}`);
4740
- if (ad.creative.urlTags) console.log(` ${import_picocolors7.default.bold("URL Tags:")} ${ad.creative.urlTags}`);
4741
- if (ad.creative.enhancements) {
4742
- console.log(` ${import_picocolors7.default.bold("Enhancements:")} ${ad.creative.enhancements.join(", ")}`);
4743
- }
4732
+ if (ad.creative.headline) console.log(` ${label("Headline:")}${truncate(ad.creative.headline)}`);
4733
+ if (ad.creative.headlines) console.log(` ${label("Headlines:")}${ad.creative.headlines.map((h2) => truncate(h2, 60)).join(" | ")}`);
4734
+ if (ad.creative.primaryText) console.log(` ${label("Primary Text:")}${truncate(ad.creative.primaryText)}`);
4735
+ if (ad.creative.primaryTexts) console.log(` ${label("Primary Texts:")}${ad.creative.primaryTexts.map((t) => truncate(t, 60)).join(" | ")}`);
4736
+ if (ad.creative.description) console.log(` ${label("Description:")}${truncate(ad.creative.description)}`);
4737
+ if (ad.creative.descriptions) console.log(` ${label("Descriptions:")}${ad.creative.descriptions.map((d3) => truncate(d3, 60)).join(" | ")}`);
4738
+ if (ad.creative.cta) console.log(` ${label("CTA:")}${ad.creative.cta}`);
4739
+ if (ad.creative.link) console.log(` ${label("Link:")}${ad.creative.link}`);
4740
+ if (ad.creative.displayUrl) console.log(` ${label("Display URL:")}${ad.creative.displayUrl}`);
4741
+ if (ad.creative.urlTags) console.log(` ${label("URL Tags:")}${ad.creative.urlTags}`);
4742
+ if (ad.creative.enhancements) console.log(` ${label("Enhancements:")}${ad.creative.enhancements.join(", ")}`);
4744
4743
  }
4745
4744
  console.log(`
4746
4745
  ${import_picocolors7.default.dim("Use this ad as a template:")} ads create --copy-from ${ad.id}
@@ -5401,10 +5400,13 @@ async function executeCreate(body, opts, { preview = false, test = false } = {})
5401
5400
  else if (Array.isArray(enh)) enhDetail = enh.join(", ");
5402
5401
  if (enhDetail) console.log(` ${import_picocolors11.default.bold("Enhancements:")} ${wrapLine(enhDetail, valCol)}`);
5403
5402
  if (result.budget) {
5404
- const label = result.budget.type === "dailyBudget" ? "Daily Budget" : "Bid Amount";
5405
- const pad = " ".repeat(Math.max(1, 16 - label.length - 1));
5406
5403
  const curr = result.budget.currency ? ` ${result.budget.currency}` : "";
5407
- console.log(` ${import_picocolors11.default.bold(`${label}:`)}${pad}${result.budget.amount}${curr}`);
5404
+ const renderLine = (label, amount) => {
5405
+ const pad = " ".repeat(Math.max(1, 16 - label.length - 1));
5406
+ console.log(` ${import_picocolors11.default.bold(`${label}:`)}${pad}${amount}${curr}`);
5407
+ };
5408
+ if (result.budget.dailyBudget != null) renderLine("Daily Budget", result.budget.dailyBudget);
5409
+ if (result.budget.bidAmount != null) renderLine("Bid Amount", result.budget.bidAmount);
5408
5410
  }
5409
5411
  console.log("");
5410
5412
  } else if (result.plan?.totals) {
@@ -5471,10 +5473,6 @@ function buildBodyFromOpts(specFile, opts) {
5471
5473
  }
5472
5474
  }
5473
5475
  }
5474
- if (opts.dailyBudget != null && opts.bidAmount != null) {
5475
- printError("Cannot set both --daily-budget and --bid-amount. Use one or the other.");
5476
- process.exit(1);
5477
- }
5478
5476
  if (opts.dailyBudget != null) {
5479
5477
  const budget = parseFloat(opts.dailyBudget);
5480
5478
  if (isNaN(budget) || budget <= 0) {
@@ -5919,7 +5917,7 @@ function statusLabel(status) {
5919
5917
  }
5920
5918
 
5921
5919
  // src/cli.js
5922
- var VERSION = true ? "0.1.1" : "0.0.0";
5920
+ var VERSION = true ? "0.1.2" : "0.0.0";
5923
5921
  var apiUrl = process.env.ADS_API_URL || getBaseUrl();
5924
5922
  if (apiUrl && (apiUrl.includes("localhost") || apiUrl.includes("127.0.0.1"))) {
5925
5923
  process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adsuploader/cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Create Facebook ads from the command line — bulk upload media, preview configurations, and launch ads at scale",
5
5
  "author": "Ads Uploader <support@adsuploader.com> (https://adsuploader.com)",
6
6
  "license": "UNLICENSED",