juzpost-cli 0.1.0 → 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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ ## 0.1.2
4
+
5
+ - Send `contentLength` with upload presign requests — the JuzPost API now
6
+ requires it and enforces per-content-type size limits before issuing a URL.
7
+
8
+ ## 0.1.1
9
+
10
+ - Rewrote the README for discoverability: detailed usage, smart-scheduling
11
+ explainer, use cases, FAQ, and SEO keywords (social media scheduling,
12
+ TikTok/YouTube Shorts scheduler, content calendar, automation).
13
+ - Expanded npm `keywords`; added `homepage`.
14
+ - Parse both API error shapes (`{ error: { message } }` and `{ error: "string" }`).
15
+
16
+ ## 0.1.0
17
+
18
+ - First public release.
19
+ - Commands: `login`/`logout`/`whoami`, `account status`, `accounts`, `groups`,
20
+ `workspace`, `posts list|create|schedule`, and smart `schedule`
21
+ (`--group`/`--min-per-day`/`--dry-run`).
22
+ - Cursor pagination, `--json` output, device-code auth, presigned media upload.
package/README.md CHANGED
@@ -1,43 +1,156 @@
1
- # juzpost-cli
1
+ # juzpost-cli — Social Media Scheduling from the Terminal
2
2
 
3
- CLI for [JuzPost](https://www.juzpost.com) — login and smart-schedule clips from the terminal.
4
- Shells out from the ASMR clipper: `queue draft → juzpost schedule --group <name> --min-per-day <N>`.
3
+ [![npm version](https://img.shields.io/npm/v/juzpost-cli.svg)](https://www.npmjs.com/package/juzpost-cli)
4
+ [![npm downloads](https://img.shields.io/npm/dm/juzpost-cli.svg)](https://www.npmjs.com/package/juzpost-cli)
5
+ [![license](https://img.shields.io/npm/l/juzpost-cli.svg)](./LICENSE)
6
+ [![node](https://img.shields.io/node/v/juzpost-cli.svg)](https://nodejs.org)
5
7
 
6
- > **Skeleton.** Command tree is wired; backend endpoints under `/api/cli/v1/*` are not built
7
- > yet (see the prerequisite milestone in the JuzPost repo). Commands will 404 until they land.
8
+ **Schedule and auto-post short-form videos to TikTok, YouTube Shorts, Instagram, and more — straight from the command line.** `juzpost-cli` is a fast, scriptable **social media scheduling** tool for creators, agencies, and developers who want to **schedule posts**, run a **content calendar**, and **cross-post** clips without ever leaving the terminal.
8
9
 
9
- ## Setup
10
+ It's the command-line client for [JuzPost](https://www.juzpost.com) — a **social media scheduler** built for short-form video. If you've used Buffer, Hootsuite, Later, SocialBee, or Postiz and wished for a **CLI-first, automatable** workflow, this is for you.
10
11
 
11
12
  ```bash
12
- npm install
13
- npm run dev -- --help # run from source (Node 22 type-stripping via tsx)
14
- npm test # config store self-check
15
- npm run build && node dist/index.js --help
13
+ npm install -g juzpost-cli
14
+ juzpost login
15
+ juzpost schedule --group "all-channels" --min-per-day 2
16
16
  ```
17
17
 
18
- ## Auth model
18
+ ---
19
19
 
20
- - `juzpost auth login` — browser device-code flow; stores a revocable CLI token.
21
- Single login method by design (no paste-token path).
22
- - Tokens are tagged (`type=cli` + browser/device) and **revocable in JuzPost settings**
23
- (hard delete → next request 401). Manual API keys stay in the dashboard, unchanged.
24
- - The CLI only talks to the **token-only** `/api/cli/v1/*` namespace.
20
+ ## Why juzpost-cli?
25
21
 
26
- ## Commands (skeleton)
22
+ - 🖥️ **CLI-first social media scheduler** — schedule, post, and manage content from your terminal or scripts. No dashboard clicking.
23
+ - 🎯 **Smart scheduling** — pick an account group and a minimum posts-per-day, and it spreads your drafts across the best preset times in your timezone automatically.
24
+ - 🔁 **Cross-platform posting** — push one video to many accounts (TikTok, YouTube Shorts, Instagram, X) in a single command.
25
+ - 🤖 **Built for automation** — pair it with a clipping pipeline, CI, or cron to **auto-post** on a content calendar. Pipe `--json` into anything.
26
+ - 🔐 **Secure, revocable auth** — browser-based device-code login; tokens are revocable from your dashboard anytime.
27
+ - 📦 **Tiny & dependency-light** — one runtime dependency, native `fetch`, Node 18+.
27
28
 
28
- | Command | Purpose | Backend |
29
- |---|---|---|
30
- | `auth login` / `logout [--revoke]` / `whoami` | device-code login, identity | NEW |
31
- | `account status` | plan + paid-tier entitlements | NEW (`/me`) |
32
- | `accounts [--platform/--group-id]` | list connected social accounts | reuse |
33
- | `groups [--name]` | list channel groups (account presets) | reuse |
34
- | `workspace` | timezone + default times | reuse |
35
- | `posts list [--status/--account-id/--from/--to]` | list posts (cursor pagination) | NEW (list route) |
36
- | `posts create [--file/--content/--title/--hashtags…]` | upload media + create draft | NEW |
37
- | `posts schedule <id> --account [--at]` | schedule one draft (low-level) | reuse `/posts/:id/schedule` |
38
- | `schedule --group --min-per-day [--dry-run]` | smart-spread drafts across days | NEW + reuse `/posts/schedule` |
29
+ A scriptable, open-source-friendly alternative to clicking around a social media management dashboard.
39
30
 
40
- List commands share `--limit/--cursor/--sort/--order/--all` (cursor pagination, spec §3).
31
+ ---
41
32
 
42
- Config lives at `$XDG_CONFIG_HOME/juzpost/config.json` (`~/.config/juzpost`).
43
- Override base url with `--base <url>` or `JUZPOST_URL`.
33
+ ## Installation
34
+
35
+ ```bash
36
+ # global (recommended — gives you the `juzpost` command)
37
+ npm install -g juzpost-cli
38
+
39
+ # or run once without installing
40
+ npx juzpost-cli --help
41
+ ```
42
+
43
+ Requires **Node.js 18+** and a free [JuzPost](https://www.juzpost.com) account.
44
+
45
+ ---
46
+
47
+ ## Quick start
48
+
49
+ ```bash
50
+ # 1. Log in (opens your browser to approve — no password, no API key to paste)
51
+ juzpost login
52
+
53
+ # 2. See your connected accounts, groups, and workspace
54
+ juzpost accounts
55
+ juzpost groups
56
+ juzpost workspace
57
+
58
+ # 3. Create a draft from a video file
59
+ juzpost posts create --file ./clip.mp4 \
60
+ --title "ASMR rain sounds for deep sleep 🌧️" \
61
+ --hashtags asmr sleep rain relaxing satisfying
62
+
63
+ # 4. Smart-schedule every draft across a group at 2 posts/day
64
+ juzpost schedule --group "all-channels" --min-per-day 2
65
+
66
+ # Preview the plan first, schedule nothing:
67
+ juzpost schedule --group "all-channels" --min-per-day 2 --dry-run
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Commands
73
+
74
+ | Command | What it does |
75
+ |---|---|
76
+ | `juzpost login` / `logout` / `whoami` | Device-code login, sign out, show identity |
77
+ | `juzpost account status` | Plan + entitlements |
78
+ | `juzpost accounts [--platform --group-id]` | List connected social accounts |
79
+ | `juzpost groups [--name]` | List channel groups (account presets) |
80
+ | `juzpost workspace` | Timezone + default posting times |
81
+ | `juzpost posts list [--status --from --to]` | List posts (drafts, scheduled, posted) |
82
+ | `juzpost posts create [--file --title --hashtags …]` | Upload media + create a draft |
83
+ | `juzpost posts schedule <id> --account <id…> [--at]` | Schedule one post |
84
+ | `juzpost schedule --group --min-per-day [--dry-run]` | **Smart-schedule** drafts across a group |
85
+
86
+ Every list command supports cursor pagination (`--limit`, `--cursor`, `--all`), sorting (`--sort`, `--order`), and `--json` for scripting.
87
+
88
+ ```bash
89
+ juzpost posts list --status scheduled --json | jq '.data[].title'
90
+ ```
91
+
92
+ ---
93
+
94
+ ## How smart scheduling works
95
+
96
+ The headline `juzpost schedule` command turns a pile of drafts into a posting **content calendar** automatically:
97
+
98
+ 1. **Resolve a group** → the social accounts you want to post to.
99
+ 2. **Read your timezone + preset times** from your workspace settings.
100
+ 3. **Spread the drafts across days** to hit your `--min-per-day` cadence, picking the best preset slots (DST-aware) and skipping any time already in the past.
101
+ 4. **Schedule each post** to every account in the group.
102
+
103
+ ```bash
104
+ # 10 drafts, 3 per day, starting tomorrow, only on these times:
105
+ juzpost schedule --group "shorts" --min-per-day 3 --times 09:30 14:00 19:00
106
+ ```
107
+
108
+ ---
109
+
110
+ ## Use cases
111
+
112
+ - **Creators** — batch a week of TikToks and YouTube Shorts in one command.
113
+ - **Clipping pages & agencies** — auto-post clips on a fixed cadence across many accounts.
114
+ - **Repurposing pipelines** — wire it after a VOD-to-shorts step to schedule the output (`--json` makes it pipe-friendly).
115
+ - **Developers** — script your social media scheduling in CI, cron, or a Makefile instead of a SaaS dashboard.
116
+
117
+ ---
118
+
119
+ ## Configuration
120
+
121
+ - Auth token is stored at `~/.config/juzpost/config.json` (mode `0600`, never logged).
122
+ - Override the API base URL with `--base <url>` or the `JUZPOST_URL` env var.
123
+ - Revoke a CLI token anytime from your JuzPost dashboard settings (hard delete → instant 401).
124
+
125
+ ---
126
+
127
+ ## FAQ
128
+
129
+ **How do I schedule social media posts from the terminal?**
130
+ Install `juzpost-cli`, run `juzpost login`, create drafts with `juzpost posts create`, then `juzpost schedule --group <name> --min-per-day <n>`.
131
+
132
+ **Which platforms are supported?**
133
+ Short-form video destinations connected to your JuzPost workspace — TikTok, YouTube Shorts, Instagram, and X.
134
+
135
+ **Is it free / open source?**
136
+ The CLI is MIT-licensed and open source. It connects to your JuzPost account.
137
+
138
+ **Can I automate posting (auto-post / cron)?**
139
+ Yes — it's built for it. Use it in scripts, CI, or cron; `--json` output and exit codes make it automation-friendly.
140
+
141
+ **How is this different from Buffer / Hootsuite / Later?**
142
+ Those are dashboard-first. `juzpost-cli` is CLI-first and scriptable — designed for terminal workflows and automation around short-form video.
143
+
144
+ ---
145
+
146
+ ## Status
147
+
148
+ `v0.1.x` — early release. The command surface is stable and built to the JuzPost API. See [JuzPost](https://www.juzpost.com) for account setup and API details.
149
+
150
+ ## License
151
+
152
+ [MIT](./LICENSE) © Jiiva Durai
153
+
154
+ ---
155
+
156
+ <sub>**Keywords:** social media scheduling · social media scheduler · schedule social media posts · TikTok scheduler · YouTube Shorts scheduler · Instagram scheduler · auto-post · content calendar · cross-platform posting · bulk scheduling · social media automation · CLI social media scheduler · open source scheduler · Buffer alternative · Hootsuite alternative · Postiz alternative · short-form video scheduler.</sub>
package/dist/upload.js CHANGED
@@ -19,8 +19,8 @@ export function contentTypeFor(file) {
19
19
  export async function uploadMedia(filePath, opts = {}) {
20
20
  const contentType = contentTypeFor(filePath);
21
21
  const relativeKey = opts.relativeKey ?? `media/${basename(filePath)}`;
22
- const { signedUrl, resolvedKey } = await api('/api/cli/v1/storage/presign', { method: 'POST', body: { relativeKey, contentType, operation: 'upload' } });
23
22
  const bytes = readFileSync(filePath);
23
+ const { signedUrl, resolvedKey } = await api('/api/cli/v1/storage/presign', { method: 'POST', body: { relativeKey, contentType, operation: 'upload', contentLength: bytes.length } });
24
24
  const res = await fetch(signedUrl, { method: 'PUT', headers: { 'content-type': contentType }, body: bytes });
25
25
  if (!res.ok)
26
26
  throw new ApiError(res.status, `R2 upload failed (HTTP ${res.status})`);
package/package.json CHANGED
@@ -1,13 +1,38 @@
1
1
  {
2
2
  "name": "juzpost-cli",
3
- "version": "0.1.0",
4
- "description": "CLI for JuzPostlogin + smart-schedule short-form clips from the terminal",
5
- "keywords": ["juzpost", "cli", "social", "scheduler", "tiktok", "youtube", "shorts", "clips"],
3
+ "version": "0.1.2",
4
+ "description": "Social media scheduling from the terminal schedule & auto-post short-form videos to TikTok, YouTube Shorts & Instagram. A fast, scriptable CLI social media scheduler.",
5
+ "keywords": [
6
+ "social-media-scheduling",
7
+ "social-media-scheduler",
8
+ "schedule-posts",
9
+ "social-media",
10
+ "scheduler",
11
+ "tiktok",
12
+ "tiktok-scheduler",
13
+ "youtube",
14
+ "youtube-shorts",
15
+ "instagram",
16
+ "shorts",
17
+ "auto-post",
18
+ "content-calendar",
19
+ "cross-posting",
20
+ "social-media-automation",
21
+ "cli",
22
+ "automation",
23
+ "buffer-alternative",
24
+ "hootsuite-alternative",
25
+ "video-scheduler",
26
+ "juzpost"
27
+ ],
6
28
  "license": "MIT",
7
29
  "author": "Jiiva Durai <jackstiffer1@gmail.com>",
30
+ "homepage": "https://www.juzpost.com",
31
+ "repository": { "type": "git", "url": "git+https://github.com/jackstiffer/juzpost-cli.git" },
32
+ "bugs": { "url": "https://github.com/jackstiffer/juzpost-cli/issues" },
8
33
  "type": "module",
9
34
  "bin": { "juzpost": "dist/index.js" },
10
- "files": ["dist"],
35
+ "files": ["dist", "CHANGELOG.md"],
11
36
  "engines": { "node": ">=18" },
12
37
  "scripts": {
13
38
  "dev": "tsx src/index.ts",