@mycatalog/cli 0.1.2 → 0.1.3

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 (3) hide show
  1. package/README.md +42 -2
  2. package/dist/bin.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -4,15 +4,55 @@
4
4
 
5
5
  ## Install
6
6
 
7
+ Requires Node.js 22 or later (`node --version`).
8
+
7
9
  ```sh
8
- npm install --global @mycatalog/cli
9
- mycatalog login
10
+ npm install -g @mycatalog/cli # -g is required: it puts the `mycatalog` command on your PATH
11
+ mycatalog --version
12
+ ```
13
+
14
+ > **Do not** use `npm i @mycatalog/cli` (without `-g`) to get the command. That only adds the package to the current
15
+ > folder's `node_modules`, and your shell will say `command not found: mycatalog`.
16
+
17
+ No install at all? Run any command with `npx`:
18
+
19
+ ```sh
20
+ npx @mycatalog/cli login
21
+ npx @mycatalog/cli theme dev
22
+ ```
23
+
24
+ ### `command not found: mycatalog`
25
+
26
+ 1. Install globally: `npm install -g @mycatalog/cli`.
27
+ 2. Still missing? Your npm global folder is not on PATH. Run `npm config get prefix`; its `bin` folder (for example
28
+ `/usr/local/bin` or `~/.npm-global/bin`) must be in your PATH. Add it to `~/.zshrc`, then open a new terminal:
29
+ `export PATH="$(npm config get prefix)/bin:$PATH"`.
30
+ 3. `EACCES` permission error on install: do not use `sudo`. Use a Node version manager (nvm, fnm) or set
31
+ `npm config set prefix ~/.npm-global` and add `~/.npm-global/bin` to PATH.
32
+
33
+ ## Quick start
34
+
35
+ ```sh
36
+ mycatalog login # shows a code; approve it in your browser
37
+ mycatalog theme list # your themes and version ids
38
+ mycatalog theme init my-theme # or cd into an existing theme folder
39
+ cd my-theme # set themeId, versionId and storeId in mycatalog.json
40
+ mycatalog theme check # same checks as the server
41
+ mycatalog theme dev # upload, print a preview link, re-upload on save
10
42
  ```
11
43
 
12
44
  Login uses the OAuth device flow. It displays a code and verification page, then asks before opening the browser. Use
13
45
  `--open` to open the page immediately. Local development may use `--api-url http://localhost:3000
14
46
  --insecure-localhost`; plain HTTP is limited to loopback hosts.
15
47
 
48
+ ## Update
49
+
50
+ ```sh
51
+ npm install -g @mycatalog/cli@latest
52
+ ```
53
+
54
+ The CLI tells you about a new version at most once a day; it never updates itself.
55
+
16
56
  ## Commands
17
57
 
18
58
  - `mycatalog login [--api-url URL] [--insecure-localhost] [--open]` — authenticate with the device flow.
package/dist/bin.js CHANGED
@@ -5,7 +5,7 @@ import { Api } from "./core/api.js";
5
5
  import * as theme from "./commands/theme/index.js";
6
6
  import { print, redact } from "./core/output.js";
7
7
  import { checkForUpdate } from "./core/update.js";
8
- const VERSION = "0.1.2";
8
+ const VERSION = "0.1.3";
9
9
  const HELP = `mycatalog <command>
10
10
 
11
11
  Commands:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycatalog/cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "MyCatalog theme developer CLI",
5
5
  "license": "MIT",
6
6
  "repository": { "type": "git", "url": "git+https://github.com/mycatalog-io/cli.git" },