Skip to content

Commit 53eac5b

Browse files
committed
docs: improve lnk help reference
1 parent 0839ab2 commit 53eac5b

3 files changed

Lines changed: 61 additions & 8 deletions

File tree

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,26 @@ miss because they are implemented through configuration or helper scripts:
5252
`v8s-links.txt`; `./scripts/lnk --expires-at DATE ...` writes that
5353
value, and the Worker treats expired links as expired at runtime.
5454

55+
## Developer CLI reference
56+
57+
Use `./scripts/lnk --help` as the local quick reference for link,
58+
schedule, and block policy edits. The detailed product documentation lives
59+
at <https://www.VanityURLs.link/en/docs>.
60+
61+
The CLI intentionally documents only the user-facing environment flags:
62+
63+
* `DRY_RUN=true` prints the planned change without writing, committing, or
64+
pushing.
65+
* `LNK_OWNER=OWNER` changes the default owner field for new links.
66+
* `V8S_LINKS_FILE=FILE` overrides the links file. `LNK_FILE` is supported
67+
as a legacy alias.
68+
* `V8S_SCHEDULES_FILE=FILE` overrides the schedule file.
69+
* `V8S_POLICY_FILE=FILE` overrides the block policy file. `BLOCKLIST_FILE`
70+
is supported as a legacy alias.
71+
72+
Successful write operations commit and push automatically so Cloudflare can
73+
deploy the generated site.
74+
5575
## Limitations
5676

5777
As this code is deployed on Cloudflare Pages, there are some product limits to be aware of:

scripts/blocklist-cli.mjs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ const POLICY_PATH = process.env.V8S_POLICY_FILE || process.env.BLOCKLIST_FILE ||
77
const CATEGORIES_PATH = "defaults/v8s-blocklist-categories.json";
88

99
function usage() {
10-
console.log(`Usage:
10+
console.log(`LNK block policies - manage blocked and allowed destinations.
11+
12+
Usage:
1113
./scripts/lnk block categories
1214
./scripts/lnk block add DOMAIN --category CATEGORY --severity SEVERITY --reason TEXT
1315
./scripts/lnk block keyword KEYWORD --category CATEGORY --severity SEVERITY --reason TEXT
@@ -16,7 +18,14 @@ function usage() {
1618
Options:
1719
--source SOURCE Source label, defaults to local-policy
1820
--dry-run Print the updated JSON without writing
19-
--help Show this help`);
21+
--help Show this help
22+
23+
Environment:
24+
V8S_POLICY_FILE=FILE Override the block policy file
25+
BLOCKLIST_FILE=FILE Legacy alias for V8S_POLICY_FILE
26+
27+
Docs:
28+
https://www.VanityURLs.link/en/docs`);
2029
}
2130

2231
function readJson(path, fallback) {

scripts/lnk

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,21 @@ const VALID_STATES = new Set([
1616
]);
1717

1818
function usage() {
19-
console.log(`Usage:
20-
./scripts/lnk [LONG_URL] [SLUG]
21-
./scripts/lnk --splat [LONG_URL_WITH_:splat] [SLUG]
19+
console.log(`LNK - create and manage VanityURLs links, schedules, and block policies.
20+
21+
Usage:
22+
./scripts/lnk LONG_URL [SLUG]
23+
./scripts/lnk --splat LONG_URL_WITH_:splat SLUG
24+
25+
Schedules:
2226
./scripts/lnk schedule add SLUG TARGET --label LABEL --days mon,tue --from HH:MM --to HH:MM [--timezone TZ]
2327
./scripts/lnk schedule default SLUG TARGET [--timezone TZ]
2428
./scripts/lnk schedule list [SLUG]
29+
30+
Block policies:
2531
./scripts/lnk block categories
2632
./scripts/lnk block add DOMAIN --category CATEGORY --severity SEVERITY --reason TEXT
33+
./scripts/lnk block keyword KEYWORD --category CATEGORY --severity SEVERITY --reason TEXT
2734
./scripts/lnk block allow DOMAIN --reason TEXT
2835
2936
Options:
@@ -37,8 +44,22 @@ Options:
3744
--splat Create a splat link; SLUG is stored as SLUG/* in the links file
3845
--help Show this help
3946
40-
Nested aliases:
47+
Files:
48+
Links are written to custom/v8s-links.txt when it exists, otherwise defaults/v8s-links.txt.
49+
Schedules are written to custom/v8s-schedules.json.
50+
Block policies are written to custom/v8s-policies.json.
51+
52+
Environment:
53+
DRY_RUN=true Print the planned change without writing, committing, or pushing
54+
LNK_OWNER=OWNER Default owner value for new links
55+
V8S_LINKS_FILE=FILE Override the links file; LNK_FILE is supported as a legacy alias
56+
V8S_SCHEDULES_FILE=FILE
57+
Override the schedule file
58+
V8S_POLICY_FILE=FILE Override the block policy file; BLOCKLIST_FILE is a legacy alias
59+
60+
Notes:
4161
Slugs may contain / to create API-like paths.
62+
Successful write operations commit and push automatically.
4263
4364
Examples:
4465
./scripts/lnk https://github.com/vanityURLs github
@@ -49,7 +70,8 @@ Examples:
4970
./scripts/lnk schedule add hangout https://zoom.us/j/work --label work --days mon,tue,wed,thu,fri --from 09:00 --to 17:00 --timezone America/Toronto
5071
./scripts/lnk schedule default hangout https://discord.gg/personal
5172
52-
Use DRY_RUN=true to print the line without writing, committing, or pushing.`);
73+
Docs:
74+
https://www.VanityURLs.link/en/docs`);
5375
}
5476

5577
function resolveLinksFile() {
@@ -237,7 +259,9 @@ function parseGenericArgs(argv) {
237259
}
238260

239261
function scheduleUsage() {
240-
console.log(`Usage:
262+
console.log(`LNK schedules - manage time-based targets.
263+
264+
Usage:
241265
./scripts/lnk schedule add SLUG TARGET --label LABEL --days mon,tue --from HH:MM --to HH:MM [--timezone TZ]
242266
./scripts/lnk schedule default SLUG TARGET [--timezone TZ]
243267
./scripts/lnk schedule list [SLUG]

0 commit comments

Comments
 (0)