Expert on the Lyx CLI commands: init, create, dev, build, deploy, login, view, aws. Use when modifying CLI commands, adding new commands, debugging CLI issues, or understanding the MFE publish flow.
Entry: packages/cli/src/index.ts — Commander program lyx.
Commands: packages/cli/src/commands/*.ts
Build: esbuild → dist/index.js, bin: ./bin/lyx.mjs
init <project-name>apps/<name>/ with package.json, lyx.config.json, layouts/, mfes/, tsconfig.jsonpnpm-workspace.yaml if workspace exists and glob not already coveredmain (header + sidebar + main + footer)create <name> --slot <slot>mfes/)mfe.config.json, , , , , package.jsonvite.config.tstsconfig.jsonsrc/index.tsxindex.htmldeploy~/.lyxrc for server/token/accountIdGET /api/auth/me — session checkGET /api/mfes — find or create MFE by namegetNextVersion(localVersion, serverVersions) — patch bump from max server versionmfe.config.jsondist/, uploads multipartloginPOST /api/auth/login → saves { server, token, email, accountId } to ~/.lyxrcaccountId = account.alias || account.id from responseviewaccountId in ~/.lyxrcvite.preview.config.ts in packages/shell/awsSubcommand group for AWS credential management:
lyx aws login — prompts for ACCESS_KEY_ID, SECRET_ACCESS_KEY, optional SESSION_TOKEN. Validates with STS. Saves to ~/.lyx-aws.lyx aws status — checks if ~/.lyx-aws credentials are valid. Shows account and identity.lyx aws logout — removes ~/.lyx-aws content.Uses execSync("aws sts get-caller-identity") for validation. Auto-loads existing credentials before prompting.
deploy without --all prompts interactively — not scriptable without --allfindViteBin() walks up parents — may find wrong vite in nested node_modulesLYX_TOKEN works but accountId must come from ~/.lyxrcpublish vs deploy: publish = single MFE, deploy = multi with version bumpaws login requires aws CLI to be installed — used for STS validationlyx deploy does NOT need AWS credentials — it talks to Admin API via ~/.lyxrc tokendeploy-aws.sh, ensure-infra.sh)