personify-cli 0.0.0-stage → 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shan Sabnani
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,99 @@
1
- # Temporary Holding Version
1
+ # personify-cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The command line for [Personify](https://personify.gg): AI UGC creator videos for brands, written and rendered in the 100 reel formats of the Format Book. Built for AI agents and scripts: `--json` on every command, no interactive prompts, exit codes you can branch on, and paid renders only behind an explicit flag.
4
+
5
+ ```bash
6
+ npm install -g personify-cli
7
+ personify --help
8
+ ```
9
+
10
+ Without a global install, put `npx personify-cli` in place of `personify` in every command. Node 20 or newer. No runtime dependencies.
11
+
12
+ ## Sign in
13
+
14
+ ```bash
15
+ personify login # opens the browser; approve the brand selected in Personify
16
+ personify login --allow-render # also asks for permission to start paid renders
17
+ personify login --no-browser # prints the address instead of opening it
18
+ personify login --manual # for a remote machine: paste the address the browser lands on
19
+ ```
20
+
21
+ Login is the same OAuth flow Personify's MCP server uses (dynamic client registration, PKCE S256, browser consent). One login covers the brand that was selected in Personify when you approved; to work on another brand, select it in Personify and run `personify login` again. Tokens live in `~/.config/personify/credentials.json` (owner-only, refreshed automatically). `personify logout` revokes them.
22
+
23
+ ## Commands
24
+
25
+ | Command | What it does |
26
+ | --- | --- |
27
+ | `personify whoami` | The signed-in brand and whether this login may render. |
28
+ | `personify brands` | The brand this login works on. |
29
+ | `personify brand` | Offering, audience, tone and persona of the brand. |
30
+ | `personify formats list [--category <id>] [--audio text\|speech\|dialogue\|ambient]` | The Format Book: id, name, category, audio mode, seconds, `max_words`, description, preview. |
31
+ | `personify formats get <id>` | One format. |
32
+ | `personify video list [--all]` | The latest 50 drafts and videos. |
33
+ | `personify video status <id>` | One video: script, format, generation status, review state, `review_url`. |
34
+ | `personify video create --title <text> --script <text\|@file\|-> [--format <id>] [--caption <text>] [--request-id <uuid>]` | Save a draft. Nothing is generated or charged. |
35
+ | `personify video edit <id> [--title <text>] [--script <text\|@file\|->]` | Change an unrendered draft. |
36
+ | `personify video review-link <id>` | The link where the owner reviews and approves a draft. |
37
+ | `personify video quote <id>` | Price one render in credits. Nothing is spent. Needs `--allow-render`. |
38
+ | `personify render <id>` | Quote the draft and stop with exit 3. Nothing is spent. |
39
+ | `personify render <id> --confirm-paid` | Quote, then start the paid render. Needs `--allow-render`. |
40
+ | `personify video wait <id> [--interval 15] [--timeout 1200]` | Poll until the render finishes or fails. |
41
+ | `personify video download <id> [--out file.mp4]` | A one-hour download link for a finished, approved video; `--out` saves the file. |
42
+ | `personify assets list [--kind reels\|clips\|photos] [--references]` | Finished reels, the takes and clips they were cut from, brand photos; `--references` lists approved reusable media. |
43
+ | `personify tools` | Every MCP tool this login can call, with input schemas. |
44
+ | `personify call <tool> [--args '<json>']` | Call any MCP tool directly. |
45
+ | `personify docs` | Where the documentation lives. |
46
+
47
+ Every command accepts `--json` (or `PERSONIFY_JSON=1`) and `--api-url <origin>` (or `PERSONIFY_API_URL`). `personify --help --json` lists the commands as JSON.
48
+
49
+ ## An agent's workflow
50
+
51
+ ```bash
52
+ personify login --json # once, with the human present for the browser approval
53
+ personify brand --json # what the brand sells and who it talks to
54
+ personify formats list --category tips --json
55
+ personify video create --title "Three habits that stuck" \
56
+ --script "Some strange skincare advice from the internet I laughed at until it worked" \
57
+ --format format-advice-01 --json # a draft, nothing spent
58
+ personify video review-link <id> --json # hand the owner the approval link
59
+ ```
60
+
61
+ With a login made with `--allow-render`, the agent can also start the render itself:
62
+
63
+ ```bash
64
+ personify render <id> --json # exit 3: the quote in credits, nothing spent
65
+ personify render <id> --confirm-paid --json # starts the render with that quote
66
+ personify video wait <id> --json # polls until completed or failed
67
+ personify video download <id> --out reel.mp4
68
+ ```
69
+
70
+ For a text format (audio `text` or `ambient`), `--script` holds the on-screen lines, one per line, as many as `text_lines` says. For a spoken format, keep the script within `max_words`.
71
+
72
+ ## Exit codes
73
+
74
+ | Code | Meaning |
75
+ | --- | --- |
76
+ | 0 | ok |
77
+ | 1 | error |
78
+ | 2 | usage |
79
+ | 3 | confirmation needed: a paid action was quoted, nothing spent; re-run with `--confirm-paid` |
80
+ | 4 | not signed in, or the session expired and could not be refreshed |
81
+ | 5 | not found |
82
+ | 6 | the record changed since it was read; read it again |
83
+ | 7 | this login lacks the permission (for renders: log in with `--allow-render`) |
84
+ | 8 | Personify or the network is temporarily unavailable |
85
+
86
+ In `--json` mode an error prints `{"error","code","exit"}` (plus `details` when the server gave some) on stdout.
87
+
88
+ ## Environment
89
+
90
+ | Variable | Use |
91
+ | --- | --- |
92
+ | `PERSONIFY_API_URL` | Another Personify origin (a preview deployment). |
93
+ | `PERSONIFY_TOKEN` | Use an existing MCP access token instead of the stored login (CI). |
94
+ | `PERSONIFY_CONFIG_DIR` | Where `credentials.json` lives. Default `~/.config/personify`. |
95
+ | `PERSONIFY_JSON` | `1` makes every command print JSON. |
96
+
97
+ ## Permissions and money
98
+
99
+ A plain login holds `brand:read assets:read videos:read drafts:write`: it can read the brand, approved media and videos, and create or edit unrendered drafts. It cannot spend credits, publish or change billing. `--allow-render` adds `videos:render`, which the owner sees on the consent screen; even then every render is quoted first and starts only with `--confirm-paid`. Revoke a login any time in Personify under Settings → AI connections, or with `personify logout`.
package/dist/args.js ADDED
@@ -0,0 +1,52 @@
1
+ /** Flags that never take a value, so `--json video list` keeps `video`. */
2
+ export const BOOLEAN_FLAGS = new Set([
3
+ "json",
4
+ "confirm-paid",
5
+ "allow-render",
6
+ "browser",
7
+ "manual",
8
+ "help",
9
+ "version",
10
+ "references",
11
+ "all",
12
+ ]);
13
+ export function parseArgs(argv) {
14
+ const positionals = [];
15
+ const flags = {};
16
+ for (let i = 0; i < argv.length; i++) {
17
+ const a = argv[i];
18
+ if (a === "--") {
19
+ positionals.push(...argv.slice(i + 1));
20
+ break;
21
+ }
22
+ if (!a.startsWith("--")) {
23
+ positionals.push(a);
24
+ continue;
25
+ }
26
+ const eq = a.indexOf("=");
27
+ if (eq > 0) {
28
+ const name = a.slice(2, eq);
29
+ const value = a.slice(eq + 1);
30
+ flags[name] = BOOLEAN_FLAGS.has(name) ? value !== "false" : value;
31
+ continue;
32
+ }
33
+ const name = a.slice(2);
34
+ if (name.startsWith("no-") && BOOLEAN_FLAGS.has(name.slice(3))) {
35
+ flags[name.slice(3)] = false;
36
+ continue;
37
+ }
38
+ const next = argv[i + 1];
39
+ if (BOOLEAN_FLAGS.has(name) || next === undefined || next.startsWith("--"))
40
+ flags[name] = true;
41
+ else {
42
+ flags[name] = next;
43
+ i++;
44
+ }
45
+ }
46
+ return { positionals, flags };
47
+ }
48
+ export function stringFlag(flags, name) {
49
+ const v = flags[name];
50
+ return typeof v === "string" ? v : undefined;
51
+ }
52
+ export const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
package/dist/cli.js ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { main } from "./main.js";
3
+ main(process.argv.slice(2)).then((code) => {
4
+ process.exitCode = code;
5
+ }, (e) => {
6
+ process.stderr.write(`${e instanceof Error ? e.message : String(e)}\n`);
7
+ process.exitCode = 1;
8
+ });