@adkit/cli 1.12.1 → 1.12.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.
Files changed (2) hide show
  1. package/dist/cli.js +43 -5
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // ../shared/dist/utils/service-status.js
4
- var ADKIT_STATUS_NOTICE = "Google Ads publishing is temporarily delayed because of an issue on Google's side. We are doing everything we can to restore normal service as soon as possible. Drafts and unaffected AdKit workflows remain available.";
4
+ var ADKIT_STATUS_NOTICE = null;
5
5
  function getAdKitStatusNotice() {
6
6
  const statusNotice = ADKIT_STATUS_NOTICE?.trim();
7
7
  return statusNotice ? `Active AdKit status notice: ${statusNotice}` : void 0;
@@ -2650,6 +2650,7 @@ function buildGoogleTargetingResearchQuery(args, flags, missingQueryHint) {
2650
2650
  import { readFileSync as readFileSync3 } from "node:fs";
2651
2651
  import { basename as basename2, extname as extname2, resolve as resolve2 } from "node:path";
2652
2652
  var MEDIA_UPLOAD_FLAGS2 = ["file", "url", "base64", "adkit-media", "temporary-upload", "filename", "content-type", "name"];
2653
+ var MEDIA_LIST_FLAGS = ["video-id", "material-id", "displayable", "width", "height", "ratio", "limit", "offset"];
2653
2654
  var CAMPAIGN_LIST_FLAGS2 = ["campaign-ids", "fields", "limit", "offset"];
2654
2655
  var PLATFORM_OVERRIDE_FLAG = "platform-overrides";
2655
2656
  var CAMPAIGN_CREATE_FLAGS = ["name", "objective", "status", "budget-daily", "budget-lifetime", PLATFORM_OVERRIDE_FLAG];
@@ -2885,10 +2886,32 @@ async function uploadTikTokMedia(client, _args, flags) {
2885
2886
  const body = mergeAccountId({ assets: [source] }, flags);
2886
2887
  return client.post("/manage/tiktok/media", body);
2887
2888
  }
2889
+ async function listTikTokMedia(client, _args, flags) {
2890
+ validateFlags(flags, MEDIA_LIST_FLAGS, "manage tiktok media list");
2891
+ const videoIds = readRepeatedFlagList(flags, "video-id");
2892
+ const materialIds = readRepeatedFlagList(flags, "material-id");
2893
+ const displayable = readBooleanQueryFlag(flags.displayable);
2894
+ const width = typeof flags.width === "string" ? flags.width : void 0;
2895
+ const height = typeof flags.height === "string" ? flags.height : void 0;
2896
+ const ratio = typeof flags.ratio === "string" ? flags.ratio : void 0;
2897
+ const limit = typeof flags.limit === "string" ? flags.limit : void 0;
2898
+ const offset = typeof flags.offset === "string" ? flags.offset : void 0;
2899
+ const accountId = typeof flags.account === "string" ? flags.account : void 0;
2900
+ const qs = queryString({ accountId, videoIds, materialIds, displayable, width, height, ratio, limit, offset });
2901
+ return client.get(`/manage/tiktok/media${qs}`);
2902
+ }
2888
2903
  async function listTikTokCampaigns(client, _args, flags) {
2889
2904
  validateFlags(flags, CAMPAIGN_LIST_FLAGS2, "manage tiktok campaigns list");
2890
2905
  return client.get(`/manage/tiktok/campaigns${buildTikTokListQuery(flags)}`);
2891
2906
  }
2907
+ function readRepeatedFlagList(flags, key) {
2908
+ const values = collectFlagValues(flags, key);
2909
+ return values.length ? values.join(",") : void 0;
2910
+ }
2911
+ function readBooleanQueryFlag(value) {
2912
+ if (value === true) return "true";
2913
+ return typeof value === "string" ? value : void 0;
2914
+ }
2892
2915
  async function getTikTokCampaign(client, args, flags) {
2893
2916
  validateFlags(flags, ["fields"], "manage tiktok campaigns <id>");
2894
2917
  const id = requireArg(args, 0, "campaign-id", "Run: adkit manage tiktok campaigns <campaign-id>");
@@ -5168,11 +5191,20 @@ Examples:
5168
5191
  adkit manage tiktok accounts available
5169
5192
  adkit manage tiktok accounts connect 1234567890
5170
5193
  adkit manage tiktok accounts disconnect 1234567890`.trim(),
5171
- "tiktok media": `adkit manage tiktok media \u2014 Upload creative media to TikTok
5194
+ "tiktok media": `adkit manage tiktok media \u2014 Upload creative media and list TikTok Asset Library videos
5172
5195
 
5196
+ list List/search existing TikTok Asset Library videos
5173
5197
  upload Upload an image or video and return TikTok asset IDs
5174
5198
 
5175
5199
  Flags:
5200
+ --video-id <id> Filter by reusable TikTok video ID (repeatable)
5201
+ --material-id <id> Filter by TikTok material ID (repeatable)
5202
+ --displayable Filter to displayable materials
5203
+ --width <px> Filter by video width
5204
+ --height <px> Filter by video height
5205
+ --ratio <values> Comma-separated aspect ratio values
5206
+ --limit <n> Page size
5207
+ --offset <n> Offset; must be a multiple of limit
5176
5208
  --file <path> Local image/video file
5177
5209
  --url <url> Public image/video URL
5178
5210
  --base64 <data> Base64 image/video data
@@ -5185,6 +5217,8 @@ Flags:
5185
5217
  --data <json> Batch body: {"assets":[...]}
5186
5218
 
5187
5219
  Examples:
5220
+ adkit manage tiktok media list --limit 100 --account 1234567890
5221
+ adkit manage tiktok media list --video-id 746839470948302856 --account 1234567890
5188
5222
  adkit manage tiktok media upload --file ./hero-video.mp4 --account 1234567890
5189
5223
  adkit manage tiktok media upload --url https://example.com/hero.png --account 1234567890
5190
5224
  adkit manage tiktok media upload --adkit-media media_123 --account 1234567890`.trim(),
@@ -5242,7 +5276,7 @@ ${FLAG.data}
5242
5276
 
5243
5277
  Examples:
5244
5278
  adkit manage tiktok ad-groups create --campaign 1770 --name "US Broad" --budget-daily 50 --schedule-start-time "2026-05-15 12:00:00" --billing-event cpc --optimization click
5245
- adkit manage tiktok ad-groups create --data '{"adGroups":[{"campaignId":"1770","name":"Purchase","budget":{"daily":50},"scheduleStartTime":"2026-05-15 12:00:00","conversion":{"eventType":"purchase"},"targeting":{"geoLocations":{"include":[{"type":"country","code":"6252001"}]}}}]}'`.trim(),
5279
+ adkit manage tiktok ad-groups create --data '{"adGroups":[{"campaignId":"1770","name":"Purchase","budget":{"daily":50},"scheduleStartTime":"2026-05-15 12:00:00","conversion":{"eventType":"purchase"},"targeting":{"geoLocations":{"include":[{"type":"country","country":"US"}]}}}]}'`.trim(),
5246
5280
  "tiktok ads": `adkit manage tiktok ads \u2014 TikTok video ads
5247
5281
 
5248
5282
  list List ads
@@ -6446,7 +6480,7 @@ async function selfUpdate(currentVersion) {
6446
6480
  async function main() {
6447
6481
  const printUpdateNotice = startUpdateCheck(CLI_VERSION);
6448
6482
  const { args, flags } = parseArgs(process.argv.slice(2), {
6449
- multi: ["media", "media-format", "primary-text", "headline", "headline-1", "headline-2", "headline-3", "description", "description-1", "description-2", "link-description", "interest", "ref", "callout", "sitelink", "value", "text", "match-type"]
6483
+ multi: ["media", "media-format", "primary-text", "headline", "headline-1", "headline-2", "headline-3", "description", "description-1", "description-2", "link-description", "interest", "ref", "callout", "sitelink", "value", "text", "match-type", "video-id", "material-id"]
6450
6484
  });
6451
6485
  if (args.length === 0 || flags.help && args.length === 0) {
6452
6486
  printHelp(USAGE);
@@ -7033,11 +7067,15 @@ async function main() {
7033
7067
  process.exit(0);
7034
7068
  }
7035
7069
  switch (action) {
7070
+ case "list":
7071
+ data = await listTikTokMedia(client, restArgs, flags);
7072
+ emptyHint = "No TikTok Asset Library videos found for this account.";
7073
+ break;
7036
7074
  case "upload":
7037
7075
  data = await uploadTikTokMedia(client, restArgs, flags);
7038
7076
  break;
7039
7077
  default:
7040
- throw new CliError("UNKNOWN_COMMAND", `Unknown action: tiktok media ${action}`, "Available: upload");
7078
+ throw new CliError("UNKNOWN_COMMAND", `Unknown action: tiktok media ${action}`, "Available: list, upload");
7041
7079
  }
7042
7080
  break;
7043
7081
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adkit/cli",
3
- "version": "1.12.1",
3
+ "version": "1.12.3",
4
4
  "description": "The Ads CLI for AI agents — manage Meta & Google ad campaigns, browse the ad library, and generate creatives from your terminal.",
5
5
  "keywords": [
6
6
  "ads cli",