@postonus/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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # postonus
1
+ # @postonus/cli
2
2
 
3
3
  Schedule and publish social posts from your terminal.
4
4
 
@@ -8,6 +8,10 @@ postonus login
8
8
  postonus post "shipping today" --to x,linkedin --optimal
9
9
  ```
10
10
 
11
+ Requires Node.js 22.12 or newer. Needs a [Postonus](https://postonus.com) account.
12
+
13
+ Run without installing: `npx @postonus/cli whoami`
14
+
11
15
  ## Commands
12
16
 
13
17
  | Command | What it does |
@@ -19,10 +23,24 @@ postonus post "shipping today" --to x,linkedin --optimal
19
23
  | `queue list` | Upcoming scheduled posts |
20
24
  | `queue move <scheduleId> --at` | Reschedule one queued post |
21
25
  | `media upload <path…>` | Upload images or video for use in posts |
22
- | `best-times --to <platforms>` | Recommended posting windows, computed locally |
26
+ | `best-times --to <platforms>` | Recommended posting windows |
23
27
 
24
28
  `postonus <command> --help` for the flags on any of them.
25
29
 
30
+ ### Scheduling a post
31
+
32
+ ```bash
33
+ postonus post "shipping today" --to x,linkedin --optimal
34
+ postonus post --file draft.md --to linkedin --at 2026-08-01T09:30:00Z
35
+ postonus post --editor --to x --draft
36
+ postonus post "with a video" --to x --media ./demo.mp4 --optimal
37
+ cat draft.md | postonus post --to x --optimal
38
+ ```
39
+
40
+ `post` always schedules; it never publishes on the spot. Pick a time with
41
+ `--at <ISO timestamp>` or `--optimal` for the next recommended window, or use
42
+ `--draft` to save without a time. `--dry-run` shows what would happen and stops.
43
+
26
44
  ## Scripting
27
45
 
28
46
  Every command takes `--json`, which prints machine-readable JSON on stdout and
@@ -38,8 +56,6 @@ codes are `0` success, `1` failure, `2` usage error. With no TTY the CLI never
38
56
  prompts — pass the flags instead, and use `--no-input` to make a missing one an
39
57
  error rather than a wait.
40
58
 
41
- Content can also be piped: `cat draft.md | postonus post --to x --optimal`.
42
-
43
59
  ### CI
44
60
 
45
61
  Set `POSTONUS_API_KEY` to an API key from the dashboard. It takes precedence over
@@ -61,25 +77,9 @@ a stored session, so no `login` step is needed:
61
77
  | `NO_COLOR` | Disable coloured output |
62
78
  | `XDG_CONFIG_HOME` | Where the session is stored; defaults to `~/.config` |
63
79
 
64
- ## Development
65
-
66
- ```bash
67
- pnpm --filter postonus build # bundle to dist/
68
- pnpm --filter postonus dev # rebuild on change
69
- pnpm --filter postonus test
70
- POSTONUS_API_URL=http://localhost:5174 node dist/index.js whoami
71
- ```
72
-
73
- The CLI calls the public REST API at `/api/v1` through `@orpc/client`'s
74
- `OpenAPILink`, typed from `@postonus/api-contract` — the same contract the
75
- dashboard's own browser client uses (ADR-0006). End-to-end types cost nothing,
76
- because they come from a shared package rather than a type import into another
77
- app's internals.
80
+ `postonus logout` removes the stored credentials.
78
81
 
79
- There is no minimum-version gate. The contract is documented and versioned in its
80
- mount prefix, so an old CLI gets a normal typed error from the operation it
81
- actually calls. The CLI still sends `x-postonus-cli-version` on every request;
82
- nothing reads it today.
82
+ ## Links
83
83
 
84
- `src/version.ts` must match `package.json` — a test enforces it, because that is
85
- the version published to npm and reported in that header.
84
+ - [postonus.com](https://postonus.com)
85
+ - [Report an issue](https://github.com/udayvunnam/experiments/issues)
package/dist/index.js CHANGED
@@ -10460,7 +10460,7 @@ async function getApi() {
10460
10460
  function describeError(error2) {
10461
10461
  if (error2 instanceof ORPCError3) {
10462
10462
  if (error2.code === "UNAUTHORIZED") {
10463
- return "Session expired or invalid. Run `postonus login` again.";
10463
+ return error2.message || "Sign-in expired or not valid. Run `postonus login` again.";
10464
10464
  }
10465
10465
  if (error2.code === "RATE_LIMITED") {
10466
10466
  return `Rate limit reached. ${error2.message}`;