@pancake-pos/app-cli 2026.1.5 → 2026.1.6

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 CHANGED
@@ -4,10 +4,13 @@ The `pos-app` command for Pancake POS apps: `login`, `dev`, `check`, `build`, `d
4
4
 
5
5
  ```bash
6
6
  npx @pancake-pos/app-cli login --shop 123 --token <token> # from POS › Settings › Advanced › Custom apps › Connect CLI
7
- npx pos-app dev
8
- npx pos-app deploy
7
+ npm run dev # in an app created by create-pos-app (scripts call pos-app)
8
+ npm run deploy
9
+ npx @pancake-pos/app-cli versions # any command, from anywhere
9
10
  ```
10
11
 
12
+ Do not run `npx pos-app`: the `pos-app` package on npm is not published by Pancake, and npx downloads it outside an installed project.
13
+
11
14
  Docs: https://pos.pages.fm/developers/apps/en (English), https://pos.pages.fm/developers/apps (Tiếng Việt). For AI tools: https://pos.pages.fm/developers/apps/llms-full.txt.
12
15
 
13
16
  Part of Pancake POS Apps. Use is limited to building apps for Pancake POS.
package/dist/cli.js CHANGED
@@ -16,7 +16,7 @@ var __export = (target, all) => {
16
16
 
17
17
  // src/api.ts
18
18
  async function apiRequest(credentials, method, path, body) {
19
- if (!credentials.token) throw new ApiError(401, "Ch\u01B0a \u0111\u0103ng nh\u1EADp: ch\u1EA1y `pos-app login` tr\u01B0\u1EDBc");
19
+ if (!credentials.token) throw new ApiError(401, 'Ch\u01B0a \u0111\u0103ng nh\u1EADp: ch\u1EA1y l\u1EC7nh \u1EDF n\xFAt "K\u1EBFt n\u1ED1i CLI" tr\xEAn trang \u1EE8ng d\u1EE5ng tu\u1EF3 bi\u1EBFn c\u1EE7a POS (npx @pancake-pos/app-cli login \u2026)');
20
20
  const headers = { Authorization: `Bearer ${credentials.token}`, Accept: "application/json" };
21
21
  let payload;
22
22
  if (body instanceof FormData) payload = body;
@@ -1147,7 +1147,7 @@ var CLI_VERSION;
1147
1147
  var init_version = __esm({
1148
1148
  "src/version.ts"() {
1149
1149
  "use strict";
1150
- CLI_VERSION = true ? "2026.1.5" : JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
1150
+ CLI_VERSION = true ? "2026.1.6" : JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
1151
1151
  }
1152
1152
  });
1153
1153
 
@@ -1589,7 +1589,7 @@ function createTools(ctx) {
1589
1589
  let dev = null;
1590
1590
  const devLog = [];
1591
1591
  const shop = () => {
1592
- if (!ctx.shop) throw new Error("Missing shop: start the server with --shop <shop_id> or run pos-app login --shop <shop_id>");
1592
+ if (!ctx.shop) throw new Error("Missing shop: start the server with --shop <shop_id> or run npx @pancake-pos/app-cli login --shop <shop_id>");
1593
1593
  return ctx.shop;
1594
1594
  };
1595
1595
  const get = (path) => apiRequest(ctx.credentials, "GET", `/shops/${shop()}/${path}`);
@@ -1967,7 +1967,7 @@ async function run(argv, io = defaultIo) {
1967
1967
  const credentials = readCredentials();
1968
1968
  const shopOf = () => {
1969
1969
  const shop = str2(flags.shop) ?? credentials.shop;
1970
- if (!shop) throw new Error("Thi\u1EBFu --shop <shop_id> (ho\u1EB7c l\u01B0u b\u1EB1ng `pos-app login --shop`)");
1970
+ if (!shop) throw new Error("Thi\u1EBFu --shop <shop_id> (ho\u1EB7c l\u01B0u b\u1EB1ng `npx @pancake-pos/app-cli login --shop`)");
1971
1971
  return shop;
1972
1972
  };
1973
1973
  switch (command) {
@@ -259,21 +259,21 @@ npx @pancake-pos/app-cli login --shop 123 --token <token>
259
259
  Then run:
260
260
 
261
261
  ```bash
262
- npx pos-app dev # watch and build, serve at http://localhost:5174
262
+ npm run dev # watch and build, serve at http://localhost:5174
263
263
  ```
264
264
 
265
265
  On the same management page, click **Development mode** and enter `http://localhost:5174` (see [Manage apps › Development mode](/developers/apps/en/manage-apps#development-mode)). While it is on, POS loads the app from `localhost` **in your browser only**; everyone else in the shop keeps using the active version. When you edit code, POS reloads the extensions without reloading the page. Use Chrome or Edge: Safari may block an `https` page from loading `http://localhost`.
266
266
 
267
- In development mode, `pos.api` can call the Open API only after the app has been uploaded at least once (`npx pos-app deploy`, no activation needed), and it uses the `access` of the latest uploaded version. Deploy again after changing `access`. After each such deploy, reload the POS page so POS gets a new token.
267
+ In development mode, `pos.api` can call the Open API only after the app has been uploaded at least once (`npm run deploy`, no activation needed), and it uses the `access` of the latest uploaded version. Deploy again after changing `access`. After each such deploy, reload the POS page so POS gets a new token.
268
268
 
269
269
  Development mode runs against the real data of the open shop, so try a test shop first. To see the app as a staff member with narrow permissions, deploy and activate it on a test shop and sign in with that account.
270
270
 
271
- While you write code, an editor with the ESLint extension shows problems as you type. Run `npx pos-app check` to validate the manifest as well.
271
+ While you write code, an editor with the ESLint extension shows problems as you type. Run `npm run check` to validate the manifest as well.
272
272
 
273
273
  ## 4. Build and upload
274
274
 
275
275
  ```bash
276
- npx pos-app deploy
276
+ npm run deploy
277
277
  ```
278
278
 
279
279
  This command:
@@ -420,7 +420,7 @@ The `pos-app` command (and the MCP server) needs a token to upload apps to the s
420
420
 
421
421
  Development mode lets you try the code you are writing inside real POS without affecting anyone else.
422
422
 
423
- 1. On your machine, run `npx pos-app dev` in the app folder (served at `http://localhost:5174` by default).
423
+ 1. On your machine, run `npm run dev` in the app folder (served at `http://localhost:5174` by default).
424
424
  2. Click **Development mode**, enter the **Dev server address** and click **Enable development mode**.
425
425
 
426
426
  ![The Development mode dialog](/static/developers/apps/manage/en/dev-mode.webp)
@@ -651,8 +651,8 @@ and a "Send reminder" button that calls https://crm.example.com/api/remind. Read
651
651
  - [ ] Modules in `extensions/` use no real DOM, UI libraries or CSS.
652
652
  - [ ] No tokens, API keys or secrets in code.
653
653
  - [ ] Errors and loading states are handled.
654
- - [ ] `npx pos-app check` reports no errors.
655
- - [ ] Tested with `npx pos-app dev` (an account with the Settings permission), then deployed to a test shop and tried with a narrow-permission staff account.
654
+ - [ ] `npm run check` reports no errors.
655
+ - [ ] Tested with `npm run dev` (an account with the Settings permission), then deployed to a test shop and tried with a narrow-permission staff account.
656
656
 
657
657
  ## Sample AGENTS.md
658
658
 
@@ -677,10 +677,11 @@ Docs: https://pos.pages.fm/developers/apps/llms-full.txt (read before changing c
677
677
  - Catch errors on every API call; handle 403 and 429.
678
678
 
679
679
  ## Commands
680
- - npx pos-app dev: try in POS (turn on Development mode on the custom apps management page); POS reloads when code changes.
680
+ - Run the CLI through the npm scripts below, or as `npx @pancake-pos/app-cli <command>` (login, versions, mcp). Never run `npx pos-app`: the `pos-app` package on npm is not Pancake's, and npx downloads it when the project is not installed.
681
+ - npm run dev: try in POS (turn on Development mode on the custom apps management page); POS reloads when code changes.
681
682
  - npx eslint .: check the code after every change; do not add eslint-disable to silence rules.
682
- - npx pos-app check: validate the manifest and code; fix every error before deploying.
683
- - npx pos-app deploy: build, validate the manifest, upload a new version.
683
+ - npm run check: validate the manifest and code; fix every error before deploying.
684
+ - npm run deploy: build, validate the manifest, upload a new version (options after --, for example npm run deploy -- --message "...").
684
685
  - With the pos-app MCP server: get_target/list_shop_meta/sample_context before writing code, check_app after every change, get_errors after testing in POS, deploy when done (uploads an inactive version; an admin activates it). For a platform bug or a missing feature: draft a report, show it to the user, and call send_feedback only after they agree.
685
686
  ````
686
687
 
@@ -2662,7 +2663,13 @@ const pos = await connect({ timeout: 10_000 });
2662
2663
 
2663
2664
  Every command accepts `--json` for machine-readable output (CI, scripts, the MCP server).
2664
2665
 
2665
- The `pos-app` command is available once `@pancake-pos/app-cli` is installed, so `npx pos-app …` works inside the project folder. Outside a project, call it by package name: `npx @pancake-pos/app-cli <command>`. The `pos-app` package on npm is not published by Pancake.
2666
+ How to run the CLI:
2667
+
2668
+ - **In a project** created by `create-pos-app`: `npm run dev`, `npm run check`, `npm run build`, `npm run deploy`. Put options after `--`, for example `npm run deploy -- --message "Fix the debt box"`.
2669
+ - **Other commands, or from anywhere:** `npx @pancake-pos/app-cli <command>`, for example `npx @pancake-pos/app-cli versions`. In an installed project this uses the project's own version.
2670
+ - **Short command everywhere:** install globally with `npm i -g @pancake-pos/app-cli`, then run `pos-app <command>`.
2671
+
2672
+ Do not run `npx pos-app`: the `pos-app` package on npm is not published by Pancake. Outside an installed project, npx downloads and runs that package.
2666
2673
 
2667
2674
  Activation and rollback happen on the [custom apps page](/developers/apps/en/manage-apps) in POS, so an admin always approves permissions before an app runs.
2668
2675
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pancake-pos/app-cli",
3
- "version": "2026.1.5",
3
+ "version": "2026.1.6",
4
4
  "description": "pos-app command for Pancake POS apps: login, dev, check, build, deploy, versions and an MCP server for AI tools",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -24,6 +24,6 @@
24
24
  "esbuild": "^0.28.2",
25
25
  "eslint": "^10.12.0",
26
26
  "fflate": "^0.8.3",
27
- "@pancake-pos/eslint-plugin": "2026.1.5"
27
+ "@pancake-pos/eslint-plugin": "2026.1.6"
28
28
  }
29
29
  }
package/runtime/frame.js CHANGED
@@ -37,5 +37,5 @@ window.addEventListener("message", (event) => {
37
37
  else if (data?.t === "kill") kill(data.instance);
38
38
  };
39
39
  });
40
- window.parent.postMessage({ t: "frame-ready", protocol: PROTOCOL_VERSION, runtime: "2026.1.5" }, "*");
40
+ window.parent.postMessage({ t: "frame-ready", protocol: PROTOCOL_VERSION, runtime: "2026.1.6" }, "*");
41
41
  //# sourceMappingURL=frame.js.map