@neopress/cli 3.3.0 → 4.1.0

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 (4) hide show
  1. package/README.md +109 -0
  2. package/dist/bin.cjs +37357 -388
  3. package/dist/index.js +36720 -149
  4. package/package.json +12 -2
package/README.md ADDED
@@ -0,0 +1,109 @@
1
+ # @neopress/cli
2
+
3
+ Manage your [Neopress](https://app.neopress.ai) site from the terminal — pages,
4
+ collections, entries, forms, assets, redirects, analytics, and publishing.
5
+
6
+ Designed to be driven by humans **and** by AI agents (Claude Code, Codex, etc.):
7
+ every command speaks JSON, and `neopress guide` prints the entire command
8
+ surface in one call.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ npm i -g @neopress/cli
14
+ neopress --version
15
+ ```
16
+
17
+ Or run without installing:
18
+
19
+ ```bash
20
+ npx @neopress/cli guide
21
+ ```
22
+
23
+ ## Authenticate
24
+
25
+ Log in once; the session is stored in `~/.config/neopress/tokens.json` and
26
+ refreshed automatically.
27
+
28
+ ```bash
29
+ neopress login # OAuth in the browser
30
+ neopress whoami # confirm who you are
31
+ ```
32
+
33
+ For CI or headless agents, skip the browser and pass a token instead:
34
+
35
+ ```bash
36
+ export NEOPRESS_ACCESS_TOKEN="<token>"
37
+ ```
38
+
39
+ ## Quickstart
40
+
41
+ ```bash
42
+ neopress sites list # sites you can access
43
+ neopress sites use <id|handle> # pick the active site (persisted)
44
+ neopress pages list # list pages on the active site
45
+ neopress guide # full command reference
46
+ ```
47
+
48
+ Target a one-off site without changing the active one:
49
+
50
+ ```bash
51
+ neopress --site my-blog pages list
52
+ ```
53
+
54
+ ## Common tasks
55
+
56
+ ```bash
57
+ # Create a page from a TSX file (created as a draft)
58
+ neopress pages create --path /about --title About --tsx ./about.tsx
59
+
60
+ # Localize a page — JSON options take inline JSON or @file
61
+ neopress pages create --path /about --i18n @i18n.json --public-locales en,ko
62
+
63
+ # Create and publish a collection entry
64
+ neopress entries create --collection 12 --data @entry.json --title Hello
65
+ neopress entries publish <entryId>
66
+
67
+ # Preview, then publish the whole site
68
+ neopress publish preview
69
+ neopress publish
70
+ ```
71
+
72
+ Run `neopress <command> --help` for the flags and examples of any command.
73
+
74
+ ## JSON / AI mode
75
+
76
+ Output is human-readable in a terminal and **automatically switches to JSON when
77
+ piped or redirected**, so it composes with `jq` and tools out of the box:
78
+
79
+ ```bash
80
+ neopress pages list | jq '.data[].path'
81
+ ```
82
+
83
+ Force JSON in a terminal with `--json`. For agents that want the whole CLI in a
84
+ single introspectable payload:
85
+
86
+ ```bash
87
+ neopress guide --json
88
+ ```
89
+
90
+ `neopress guide` is generated from the live command tree, so it never drifts from
91
+ the installed version — treat it as the source of truth for what the CLI can do.
92
+
93
+ ## Configuration
94
+
95
+ Resolution order for the active site: `--site` flag → `NEOPRESS_SITE_ID` →
96
+ project config file → the site saved by `neopress sites use`.
97
+
98
+ | Variable | Default | Purpose |
99
+ | --- | --- | --- |
100
+ | `NEOPRESS_ACCESS_TOKEN` | — | Auth token (skips `neopress login`) |
101
+ | `NEOPRESS_SITE_ID` | — | Default site id (overrides the active site) |
102
+ | `NEOPRESS_BASE_URL` | `https://app.neopress.ai` | API base URL (staging/local targets) |
103
+
104
+ Per-project defaults can also live in `.neopressrc.json` (or
105
+ `.neopress/config.json`):
106
+
107
+ ```json
108
+ { "siteId": 42, "baseUrl": "https://app.neopress.ai" }
109
+ ```