@camox/cli 0.41.1 → 0.43.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.
package/README.md ADDED
@@ -0,0 +1,125 @@
1
+ # Camox CLI
2
+
3
+ ## Runtime lookup and monorepos
4
+
5
+ Runtime-backed commands (`status`, `pages`, `blocks`, `layouts`, `env`, `files`,
6
+ and `logout`) accept `--cwd PATH`:
7
+
8
+ ```sh
9
+ camox pages list --cwd apps/site
10
+ camox status --cwd apps/site
11
+ camox files upload --cwd apps/site --file ./hero.webp --alt "Product screenshot"
12
+ ```
13
+
14
+ The CLI searches for `node_modules/.camox/runtime.json` starting in that directory
15
+ and walking upward. Without `--cwd`, lookup starts in the shell's current directory.
16
+ There is no workspace or child-directory discovery. Run the app's dev server or
17
+ build once to generate its runtime file.
18
+
19
+ Relative `--cwd` paths resolve against the shell's current directory. This option
20
+ only affects runtime lookup: other paths, such as `--file ./hero.webp`, still
21
+ resolve against the shell's current directory. Missing or non-directory paths fail
22
+ instead of falling back to the shell's directory. Environment selection is unchanged:
23
+ your development environment by default, with explicit `--production` where supported.
24
+
25
+ ## Page SEO
26
+
27
+ Use `pages get` to read metadata and `pages update` to edit it:
28
+
29
+ ```sh
30
+ camox pages get --path /about --json
31
+ camox pages update --path /about --meta-title "About us" --meta-description "Meet the team."
32
+ camox pages update --id 42 --meta-description ""
33
+ camox pages update --id 42 --ai-seo on
34
+ camox pages update --id 42 --ai-seo off
35
+ camox pages get --path /about --live
36
+ camox pages publish --path /about
37
+ ```
38
+
39
+ - Updates require exactly one of `--id` or `--path` and at least one update field.
40
+ Omitted fields are preserved; empty strings clear metadata.
41
+ - Setting either metadata field disables automatic SEO for **both** fields.
42
+ Manual metadata cannot be combined with `--ai-seo on`.
43
+ - `--ai-seo off` preserves current metadata. `--ai-seo on` schedules asynchronous
44
+ generation; the returned page contains current values, not necessarily generated
45
+ values. Use `pages get` to inspect them later.
46
+ - Changes affect the draft only. Publish separately to update live metadata.
47
+ `pages get --live` reads the published snapshot; without it, reads use the draft.
48
+ - Commands support `--project SLUG`, `--production`, and `--json`, with the usual
49
+ development-environment default and structured JSON output/errors. `--production`
50
+ selects the environment; it does not publish the draft.
51
+
52
+ See `camox pages update --help` for options and examples.
53
+
54
+ ## Media
55
+
56
+ Run `camox login` and start your project's dev server (or build once) so the CLI
57
+ can discover the project's runtime configuration.
58
+
59
+ ```sh
60
+ # Upload a local file with manual alt text.
61
+ camox files upload --file ./hero.webp --alt "Product screenshot" --json
62
+
63
+ # Download a remote file and store a copy in Camox.
64
+ camox files upload --url https://example.com/hero.webp --alt "Product screenshot"
65
+
66
+ # Optionally override the uploaded filename.
67
+ camox files upload --url https://example.com/download --filename hero.webp --ai-metadata off
68
+
69
+ # Inspect the returned ID and URL; use the ID in your block's media field.
70
+ camox files list
71
+ camox files get --id 123
72
+
73
+ camox files update --id 123 --filename hero.webp
74
+ camox files update --id 123 --alt "Updated description"
75
+ camox files update --id 123 --alt ""
76
+ camox files update --id 123 --ai-metadata on
77
+
78
+ # Replace the underlying file everywhere it is referenced, preserving its ID.
79
+ camox files update --id 123 --file ./new-hero.webp
80
+ camox files update --id 123 --url https://example.com/new-hero.webp
81
+
82
+ # Replace content and override metadata together.
83
+ camox files update --id 123 --file ./new-hero.webp --filename hero.webp --alt "New screenshot"
84
+ ```
85
+
86
+ - Upload requires exactly one of `--file` or `--url`. URLs are copied, not linked.
87
+ - `--alt` disables AI metadata, including when its value is an empty string.
88
+ It cannot be combined with `--ai-metadata on`. Manual edits are protected from
89
+ already-running AI jobs.
90
+ - Without metadata flags, raster-image uploads use automatic metadata. Other
91
+ file types do not. AI may update both the filename and alt text asynchronously.
92
+ - `--ai-metadata on` schedules generation for raster images; success does not mean
93
+ generation has completed. Use `files get` to inspect the current record.
94
+ - Update requires at least one of `--file`, `--url`, `--filename`, `--alt` or
95
+ `--ai-metadata`. `--file` and `--url` are mutually exclusive; without either,
96
+ only metadata changes. Renaming alone preserves the file ID, URL and AI setting.
97
+ - Replacing content preserves the file ID and all `_fileId` references in the
98
+ selected environment. The URL changes to avoid stale caches. Direct URLs in
99
+ stored block/repeatable-item content are migrated within that environment;
100
+ URLs hardcoded outside Camox cannot be rewritten.
101
+ - Replacements preserve omitted alt text and AI settings. The filename defaults
102
+ to the new source filename; `--filename` overrides it. Binary metadata and
103
+ explicit metadata changes are saved together. If AI remains enabled, raster
104
+ replacements schedule generation on the original file ID; other types skip
105
+ generation. Disable AI to prevent future automatic renaming or alt changes.
106
+ - Files are shared assets, not page drafts: replacing one affects every reference
107
+ to it in the selected environment. No page publish step is required.
108
+ - Failed replacements leave the original file unchanged and remove the unused
109
+ uploaded binary. After a network timeout, use `files get --id ID` before retrying
110
+ because the server may already have completed the operation.
111
+ - All commands support `--project SLUG`, `--production`, and `--json`. The default
112
+ environment is `dev:<your-email>`, not production. IDs are scoped to the selected
113
+ project and environment.
114
+ - Uploads return the stored file record, including `id`, `url`, `mimeType`, `alt`,
115
+ and `aiMetadataEnabled`. Output is JSON; errors are structured JSON on stderr.
116
+ - Files are limited to 100 MiB. URL downloads allow at most five redirects and
117
+ have a two-minute timeout; uploads have a separate two-minute timeout.
118
+ Downloads stream through a temporary file that is removed afterward.
119
+ - Only HTTP(S) URLs without embedded credentials are supported. Signed query
120
+ URLs work and are not included in download errors. Camox credentials are never
121
+ sent to the source URL. Remote authentication flags and batch uploads are not
122
+ supported.
123
+
124
+ See `camox files --help`, `camox files upload --help`, and
125
+ `camox files update --help` for command options.