### Verify lzc-cli Setup Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/getting-started/env-setup.md Run these commands to verify that lzc-cli is installed correctly, a default microservice is configured, and project commands are available. ```bash lzc-cli --version lzc-cli box default lzc-cli project --help ``` -------------------------------- ### Start the Application Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/getting-started/hello-world-fast.md If the application is not running, use this command to start it. This is often a prerequisite for other `project` commands. ```bash lzc-cli project start ``` -------------------------------- ### Start Application Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/hello-world.md If the application is not running, you can start it using 'lzc-cli project start'. 'lzc-cli project info' will then output the 'Target URL' for accessing the application. ```bash lzc-cli project start lzc-cli project info ``` -------------------------------- ### Start LazyCat Client in WSL Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/lzc-cli-wsl.md Launches the LazyCat desktop client from its installed location within the WSL environment. This command should be run after the client is installed. ```bash ~/.local/share/lzc-client-desktop/lzc-client-desktop ``` -------------------------------- ### Install Go SDK for Lazycat Cloud Source: https://context7.com/lazycatcloud/lzc-developer-doc/llms.txt Get the lzc-sdk/lang/go package using go get for backend services to interact with the microservice platform API via gRPC-Go. ```bash go get -u gitee.com/linakesi/lzc-sdk/lang/go ``` -------------------------------- ### Dockerfile for VNC Application Setup Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/app-vnc.md This Dockerfile sets up a Debian Bookworm base image, adds a new user 'lazycat', installs necessary applications, and configures VNC startup scripts and user permissions. It also copies custom configuration files and desktop entries for autostart functionality. ```dockerfile # Pull base image. FROM registry.lazycat.cloud/kasm-debian-bookworm:0.0.1 USER root # 新增用户和用户组 RUN usermod -l lazycat kasm-user # 给新增的用户添加权限 RUN echo 'lazycat ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers ENV HOME /home/lazycat WORKDIR $HOME # 安装应用 RUN apt-get update; apt install -y x11-apps; # 修改原有脚本内容,将脚本中原有的 kasm_user 字符串替换成 lazycat,修改为新建的用户 RUN sed -i 's/kasm_user/lazycat/g' /dockerstartup/vnc_startup.sh RUN sed -i '5i sudo chown -R lazycat:kasm-user /home/lazycat/' /dockerstartup/kasm_default_profile.sh RUN cat /dockerstartup/kasm_default_profile.sh # 复制内容并修改文件的拥有者,文件内容看具体路径下对应的文件 COPY --chown=lazycat:kasm-user kasmvnc.yaml /home/lazycat/.vnc/kasmvnc.yaml COPY --chown=lazycat:kasm-user desktop/X11-Xeyes.desktop /home/lazycat/Desktop/ COPY --chown=lazycat:kasm-user mount-mappied /home/lazycat/ # autostart 实现开机自启软件和开机自启脚本 COPY --chown=lazycat:kasm-user desktop/X11-Xeyes.desktop /home/lazycat/.config/autostart/ COPY --chown=lazycat:kasm-user desktop/startup-script.desktop /home/lazycat/.config/autostart/ COPY --chown=lazycat:kasm-user startup-script.sh /home/lazycat/.config/autostart/ # 修改对应脚本的权限,权限不对时将无法正常运行脚本(请检查好权限问题) RUN chmod +x /home/lazycat/mount-mappied RUN chmod +x /home/lazycat/.config/autostart/startup-script.sh RUN chmod +x /home/lazycat/Desktop/*.desktop RUN chmod +x /home/lazycat/.config/autostart/*.desktop # 禁用验证 优化远程桌面体验 ENV VNCOPTIONS "-PreferBandwidth -disableBasicAuth -DynamicQualityMin=4 -DynamicQualityMax=7 -DLP_ClipDelay=0 -sslOnly=0" ENV VNC_PW lazycat USER lazycat ``` -------------------------------- ### Query Application List with JavaScript SDK Source: https://context7.com/lazycatcloud/lzc-developer-doc/llms.txt Initialize the lzcAPIGateway and query the list of installed applications. This example uses the current page's origin and disables TLS verification. ```javascript import { lzcAPIGateway } from "@lazycatcloud/sdk"; // 初始化 API Gateway(使用当前页面域名,禁用 TLS 验证) const lzcapi = new lzcAPIGateway(window.location.origin, false); // 查询所有已安装应用列表 const apps = await lzcapi.pkgm.QueryApplication({ appidList: [] }); console.debug("applications:", apps); // 输出示例: // { // "infoList": [ // { // "appid": "cloud.lazycat.developer.tools", // "status": 4, // "version": "0.1.3", // "title": "懒猫云开发者工具", // "domain": "dev.lcc.heiyu.space", // "builtin": false, // "unsupportedPlatforms": [] // } // ] // } ``` -------------------------------- ### Example Exported Resource Paths Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/spec/resource-export.md Provides concrete examples of how different types of resources are organized within the 'exports/' directory. ```text exports/skills/todo-assistant/SKILL.md exports/mcp-providers/default/mcp.yml exports/browser-extensions/ublock-origin/manifest.json ``` -------------------------------- ### Navigate to Project Directory Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/getting-started/hello-world-fast.md Change into the newly created project directory to start working on it. ```bash cd hello-lpk ``` -------------------------------- ### Frontend Development Workflow Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/getting-started/dev-workflow.md Steps for frontend development: deploy the project, open the application, then start the local dev server. ```bash lzc-cli project deploy lzc-cli project info npm run dev ``` -------------------------------- ### Build and Install Golang Application Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/app-example-go.md This snippet details the steps to build and install a Golang application. It requires Node.js and npm for frontend dependencies. Ensure you are using a Unix-like shell (like Git Bash on Windows) for the build script. ```shell # In the local application npm dependency cd ui # Enter the interface directory npm install # Install front-end dependency package cd .. # Return to the project root directory # Build lpk lzc-cli project build -o release.lpk # Install lpk lzc-cli lpk install release.lpk ``` -------------------------------- ### Install lzc-cli and Check Version Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/getting-started/env-setup.md Install the lzc-cli globally using npm and verify the installation by checking its version. ```bash npm install -g @lazycatcloud/lzc-cli lzc-cli --version ``` -------------------------------- ### Navigate and Deploy Application Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/hello-world.md After creating the project, navigate into the project directory and deploy the application. The 'project deploy' command automatically handles dependency installation and frontend building. ```bash cd helloworld lzc-cli project deploy lzc-cli project info ``` -------------------------------- ### Dev Configuration Example Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/getting-started/dev-workflow.md Example of a typical dev configuration using `lzc-build.dev.yml` to override package settings and enable dev mode. ```yaml package_override: package: org.example.todo.dev contentdir: envs: - DEV_MODE=1 ``` -------------------------------- ### Backend Development Workflow Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/getting-started/dev-workflow.md Steps for backend development: deploy the project, open the application, sync code to the runtime environment, and manually start the process. ```bash lzc-cli project deploy lzc-cli project info project sync --watch ``` -------------------------------- ### ImageBuildConfig Dockerfile Path Example Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/spec/build.md This example illustrates configuring Docker image builds using a `dockerfile` path in `lzc-build.yml`. It specifies the location of the Dockerfile and its build context, enabling the integration of Docker image creation into the LPK packaging. ```yaml images: my-app-image: dockerfile: ./Dockerfile context: . ``` -------------------------------- ### List User Devices with Lzc-SDK (Go) Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/introduction.md Initialize the LzcAPI and use it to list all end devices for a given user. This example demonstrates checking which devices are online. ```go package main import ( lzcsdk "gitee.com/linakesi/lzc-sdk/lang/go" "gitee.com/linakesi/lzc-sdk/lang/go/common" "context" "fmt" ) func main(){ ctx := context.TODO() // 初始化 LzcAPI lzcapi, err := lzcsdk.NewAPIGateway(ctx) if err != nil { fmt.Println("Initial Lzc Api failed:", err) return } // 构建请求内容, 表示要获取 lazycat 这个用户的所有设备 request := &common.ListEndDeviceRequest{ Uid: "lazycat" } // 获取 lazycat 用户所有设备 devices, err := lzcAPI.Devices.ListEndDevices(ctx, request) if devices == nil { fmt.Println("lazycat 没有任何设备") return } var onLineDevices []*common.EndDevice for _, device := range devices.Devices { d := device // 判断设备是否在线 if d.IsOnline { onLineDevices = append(onLineDevices, d) fmt.Printf("%s 设备在线\n", d.Name) } } fmt.Printf("在线的设备共有%d 个\n", len(onLineDevices)) } ``` -------------------------------- ### Build and Install LPK Package Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/app-vnc.md Use lzc-cli to build the LPK package and install it. Refer to the developer manual for detailed instructions on creating LPK applications. ```bash lzc-cli project build lzc-cli lpk install xxx.lpk ``` -------------------------------- ### Start Frontend Development Server Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/hello-world.md Once the application page is accessible, start the frontend development server using 'npm run dev'. This enables hot-reloading for frontend file changes. ```bash npm run dev ``` -------------------------------- ### Install Dependencies and LazyCat Client in WSL Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/lzc-cli-wsl.md Installs necessary packages like zenity and zstd, followed by the LazyCat Linux client using a curl script. Ensure you have the required development libraries. ```bash sudo apt install zenity zstd sudo apt install libnss3-dev libgdk-pixbuf2.0-dev libgtk-3-dev libxss-dev /bin/bash -c "$(curl -fsSL https://dl.lazycat.cloud/client/desktop/linux-install)" ``` -------------------------------- ### Fetch All Applications with Lzc-SDK (Javascript/Typescript) Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/introduction.md Initialize the lzcAPIGateway and use it to query the package manager service for a list of all applications. This example uses grpc-web. ```javascript import { lzcAPIGateway } from "@lazycatcloud/sdk" // 初始化 lzcapi const lzcapi = new lzcAPIGateway(window.location.origin, false) // 使用 lzcapi 调用 package manager 服务以获取所有应用列表 const apps = await lzcapi.pkgm.QueryApplication({ appidList: [] }) console.debug("applicatons: ", apps) ``` -------------------------------- ### Install JavaScript SDK for Lazycat Cloud Source: https://context7.com/lazycatcloud/lzc-developer-doc/llms.txt Install the @lazycatcloud/sdk package using npm or pnpm to interact with the microservice platform via gRPC-Web. ```bash npm install @lazycatcloud/sdk # 或 pnpm install @lazycatcloud/sdk ``` -------------------------------- ### Development Configuration Example Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/getting-started/dev-workflow.md Example of a package override configuration for a development build, specifying a separate package name to distinguish it from the production build. ```yaml package_override: package: org.example.todo.dev ``` -------------------------------- ### Example `lzc-build.yml` for application packaging Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/app-example-porting.md Specifies output locations for the packaged application (lpk) and the application icon file. ```yaml pkgout: ./ # 输出的lpk包的位置 icon: ./icon.png # 图标文件的位置 ``` -------------------------------- ### Runtime Resource Projection Examples Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/spec/resource-export.md Illustrates the file paths where aggregated resources are projected into the LPK's runtime environment. Includes digest files for change detection. ```text /lzcapp/run/resources/.digest/skills/summary /lzcapp/run/resources/.digest/skills/cloud.lazycat.app.todo/todo-assistant/digest /lzcapp/run/resources/skills/cloud.lazycat.app.todo/todo-assistant/SKILL.md /lzcapp/run/resources/.digest/mcp-providers/summary /lzcapp/run/resources/.digest/mcp-providers/cloud.lazycat.app.todo/default/digest /lzcapp/run/resources/mcp-providers/cloud.lazycat.app.todo/default/mcp.yml /lzcapp/run/resources/.digest/browser-extensions/summary /lzcapp/run/resources/.digest/browser-extensions/cloud.lazycat.browser.adblock/ublock-origin/digest /lzcapp/run/resources/browser-extensions/cloud.lazycat.browser.adblock/ublock-origin/manifest.json ``` -------------------------------- ### Example of Copying an Image Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/publish-app.md This example demonstrates the output after successfully copying an image to the LazyCat official registry. The output shows the original image name and the new registry path with a hash version. ```bash lzc-cli appstore copy-image alpine:3.18 Waiting ... ( copy alpine:3.18 to lazycat offical registry) lazycat-registry: registry.lazycat.cloud/snyh1010/library/alpine:d3b83042301e01a4 ``` -------------------------------- ### Build and Install LPK Application with lzc-cli Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/lzc-cli-wsl.md Uses the lzc-cli to build an lpk application and then install it onto a connected LazyCat device. Ensure the application project is in the current directory for building. ```bash lzc-cli project build lzc-cli lpk install cloud.lazycat.app.demo-v0.0.2.lpk ``` -------------------------------- ### Development Build Configuration Example Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/lzc-cli.md An example of a development-specific build configuration file (`lzc-build.dev.yml`). It overrides the default package name and sets an environment variable for development mode. ```yaml # lzc-build.dev.yml package_override: package: cloud.lazycat.app.helloworld.dev contentdir: envs: - DEV_MODE=1 ``` -------------------------------- ### ImageBuildConfig Dockerfile Content Example Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/spec/build.md This example shows how to define Docker image building configurations using `dockerfile-content` within `lzc-build.yml`. It specifies the Dockerfile content directly and sets a build context, allowing for the creation of custom Docker images as part of the build process. ```yaml images: my-app-image: dockerfile-content: | FROM alpine:latest COPY . /app CMD ["/app/run"] context: . ``` -------------------------------- ### Minimal package.yml Example Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/spec/package.md A basic package.yml configuration including essential fields like package ID, version, name, description, and permission requirements. ```yaml package: cloud.lazycat.app.demo-app version: 0.0.1 name: Demo App description: Demo application permissions: required: - net.internet - document.read optional: - document.write - device.dri.render - power.shutdown.inhibit ``` -------------------------------- ### Example lzc-build.dev.yml with Environment Variables Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/build.md This example demonstrates how to set development-specific package overrides, content directory, and environment variables in `lzc-build.dev.yml`. Environment variables are defined as KEY=VALUE strings and are available during the build script execution. ```yaml # lzc-build.dev.yml package_override: package: cloud.lazycat.app.demo-app.dev contentdir: envs: - DEV_MODE=1 - FRONTEND_PORT=3000 ``` -------------------------------- ### Example lzc-build.dev.yml with Envs Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/spec/build.md This example demonstrates how to define development-specific overrides and build-time environment variables in `lzc-build.dev.yml`. Use this to set custom package names, clear content directories, and inject variables like `DEV_MODE` and `FRONTEND_PORT` into the build script environment. ```yaml # lzc-build.dev.yml package_override: package: cloud.lazycat.app.demo-app.dev contentdir: envs: - DEV_MODE=1 - FRONTEND_PORT=3000 ``` -------------------------------- ### package.yml Full Example Source: https://context7.com/lazycatcloud/lzc-developer-doc/llms.txt Defines the metadata and permissions for a Lazycat Cloud application package. ```yaml package: cloud.lazycat.app.demo-app version: 0.1.0 name: Demo App description: Demo application author: Demo Team license: MIT homepage: https://example.com min_os_version: 1.2.3 unsupported_platforms: - linux/386 locales: zh-CN: name: 示例应用 description: 示例应用描述 en-US: name: Demo App description: Demo application permissions: required: - net.internet - document.read optional: - document.write - device.dri.render - media.read - power.shutdown.inhibit import_resources: - kind: skills - kind: mcp-providers ``` -------------------------------- ### Example `services` configuration in `lzc-manifest.yml` Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/app-example-porting.md Defines services within a LazyCat microservice application, specifying Docker images, environment variables, and volume bindings for persistent storage. ```yaml services: servicename1: image: xxx/yyy:123 environment: - ENV1=123 ``` -------------------------------- ### Skill Definition (SKILL.md) Example Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/resource-skill-mcp.md A minimal SKILL.md file defining a Skill. It includes metadata like name and description, followed by instructions for the agent on how to use the skill. ```markdown --- name: todo-assistant description: Read the Todo app data files and help the user summarize and organize tasks. --- 1. Read the task data files first. 2. Summarize the current task list. 3. If the user asks to modify data, call the app's MCP server. ``` -------------------------------- ### Create and Deploy a Hello World LPK Application Source: https://context7.com/lazycatcloud/lzc-developer-doc/llms.txt Steps to create a new project from a template, deploy it to a microservice, view its information, start it, and package it for release. Includes commands for local development server and log viewing. ```bash # 1. 创建项目(选择 hello-vue 模板,使用默认应用 ID) lzc-cli project create helloworld # 交互提示:选择模板 "hello-vue",应用 ID 使用默认值 "helloworld" ``` ```bash # 2. 进入项目并部署(自动安装依赖并构建前端,优先读取 lzc-build.dev.yml) cd helloworld lzc-cli project deploy # 输出示例: # Build config: lzc-build.dev.yml # ✓ Deploying cloud.lazycat.app.helloworld.dev ... ``` ```bash # 3. 查看运行信息(获取 Target URL) lzc-cli project info # 输出示例: # Target URL: https://helloworld.yourbox.heiyu.space ``` ```bash # 4. 若应用未自动启动 lzc-cli project start ``` ```bash # 5. 启动本地前端开发服务器(打开应用页面后执行) npm run dev ``` ```bash # 6. 实时查看日志 lzc-cli project log -f ``` ```bash # 7. 打包发布版本(使用 lzc-build.yml,不带 dev 包名后缀) lzc-cli project release -o helloworld.lpk ``` ```bash # 8. 本地安装发布包验证 lzc-cli lpk install helloworld.lpk ``` -------------------------------- ### Example Health Check Configuration Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/advanced-depends.md An example of how to configure a health check for a service, specifying a command to test connectivity and a start period. ```yaml services: wordpress: image: bitnami/wordpress:5.8.2 health_check: test: - CMD-SHELL - "curl -f http://localhost:80/ || exit 1" # test_url: http://localhost:80 # 进行健康检查的 url,如果返回大于 500 则健康检查失败 start_period: 190s disable: false ``` -------------------------------- ### Create a New Project with a Backend Template Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/getting-started/http-route-backend.md Use this command to create a new project based on a Go backend template. Navigate into the project directory afterward. ```bash lzc-cli project create hello-api -t todolist-golang cd hello-api ``` -------------------------------- ### Conditional Configuration Copy with setup_script Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/advanced-setupscript.md This example demonstrates how to use setup_script to conditionally copy default configurations into the application's persistent storage directory. It checks if the target directory is empty before copying to avoid overwriting existing configurations. ```yaml services: cloudreve: image: registry.lazycat.cloud/xxxxx/cloudreve/cloudreve:a9e2373b7ca59bc4 binds: # 先将应用 var 目录下的一个子目录 bind 到应用原生的存储目录, # 避免修改上游代码。(这里假设是 /conf/ 目录) - /lzcapp/var/cloudreve:/conf/ # 然后把 lpk 里的预装配置拷贝到 /conf 目录 setup_script: | if [ -z "$(find /conf -mindepth 1 -maxdepth 1)" ]; then cp -r /lzcapp/pkg/content/defaults/ /conf/ fi ``` -------------------------------- ### Install Release Package Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/hello-world.md Install the generated release package (.lpk) onto the LazyCatCloud platform using 'lzc-cli lpk install'. ```bash lzc-cli lpk install helloworld.lpk ``` -------------------------------- ### Install Node.js and lzc-cli using NVM Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/lzc-cli-wsl.md Installs Node.js version 20 using NVM (Node Version Manager) and then globally installs the lzc-cli npm package. This is necessary for using lzc-cli. ```bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash echo 'export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"' >> ~/.bashrc echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc nvm install v20 nvm use v20 npm install -g lzc-cli ``` -------------------------------- ### Complete package.yml Example Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/spec/package.md A comprehensive package.yml configuration demonstrating all available fields, including author, license, OS version, unsupported platforms, locales, imported resources, and detailed permissions. ```yaml package: cloud.lazycat.app.demo-app version: 0.0.1 name: Demo App description: Demo application author: Demo Team license: MIT homepage: https://example.com min_os_version: 1.2.3 unsupported_platforms: - linux/386 locales: zh-CN: name: 示例应用 description: 示例应用描述 en-US: name: Demo App description: Demo application import_resources: - kind: skills - kind: mcp-providers permissions: required: - net.internet - document.read optional: - document.write - media.read - device.dri.render - power.shutdown.inhibit ``` -------------------------------- ### Enable systemd User Service for Apt Mirror and Htop Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/faq-startup_script.md Create a systemd user service file in ~/.config/systemd/user/ to automatically switch the apt source to mainland China and install htop on boot. Enable the service using 'systemctl --user enable'. ```systemd [Unit] Description=切换apt源为 中国大陆,并自动安装上htop After=network.target [Service] Type=oneshot ExecStart=sh -c 'apt install -y htop' [Install] WantedBy=default.target ``` -------------------------------- ### API Call Example Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/advanced-api-auth-token.md Example of how to use an API Auth Token to authenticate a curl request. ```APIDOC ## API Call Example ### Description Example of how to use an API Auth Token to authenticate a curl request. ### Method GET ### Endpoint `https:///sys/whoami` ### Headers - `Lzc-Api-Auth-Token`: `` (The generated API authentication token) ### Request Example ```bash curl -k -H "Lzc-Api-Auth-Token: " "https:///sys/whoami" ``` ### Behavior Notes - The header name is fixed as `Lzc-Api-Auth-Token`. - This header is only for system authentication and will be removed when forwarded to applications. - Token permissions are equivalent to the bound user. Store tokens securely and avoid leakage. - Features that rely on client information within authentication details for reverse access (used by some lpk) are not supported with API Tokens. - The system will not automatically inject `X-HC-Device-PeerID` and `X-HC-Device-ID` in this mode. - `X-HC-Login-Time` in this mode represents the token's creation time. ``` -------------------------------- ### Install Lzc-SDK for Javascript/Typescript Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/introduction.md Install the Lzc-SDK npm package for Javascript and Typescript projects using npm or pnpm. ```bash npm install @lazycatcloud/sdk # 或者 pnpm install @lazycatcloud/sdk ``` -------------------------------- ### Dev-Only Request Inject Example Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/getting-started/dev-workflow.md Minimal example of a dev-only request inject that is only active in development mode (`env.DEV_MODE=1`). ```yaml application: routes: - /=file:///lzcapp/pkg/content/dist #@build if env.DEV_MODE=1 injects: - id: dev-entry on: request when: - "/*" do: - src: | // dev-only request inject #@build end ``` -------------------------------- ### Valid Resource Kind Examples Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/spec/resource-export.md Shows valid examples of resource 'kind' identifiers. These are used to categorize exported resources. ```text skills mcp-providers browser-extensions ``` -------------------------------- ### Configure Application Startup Parameters Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/advanced-manifest-render.md Define user-configurable parameters in 'lzc-deploy-params.yml' and use them to set application startup arguments in 'lzc-manifest.yml'. This allows dynamic configuration of application behavior based on deployment inputs. ```yaml # lzc-deploy-params.yml params: - id: target type: string name: "target" description: "the target IP you want forward" - id: listen.port type: string name: "listen port" description: "the forwarder listen port, can't be 80, 81" default_value: "33" optional: true ``` ```yaml # lzc-manifest.yml application: subdomain: netmap upstreams: - location: / backend_launch_command: /lzcapp/pkg/content/netmap -target={{ .U.target }} -port={{ index .U "listen.port" }} ``` -------------------------------- ### Deploy and Inspect Project Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/getting-started/hello-world-fast.md Deploy the application and then get its information, including the target URL for web access. The `project` command defaults to using development build configurations. ```bash lzc-cli project deploy lzc-cli project info ``` -------------------------------- ### Download Application Source Code Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/app-example-go.md Clone the Golang application's demo repository from Gitee. ```shell https://gitee.com/lazycatcloud/todolist-go-lzcapp-demo.git ``` -------------------------------- ### Install a Manually Created LPK Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/getting-started/lpk-how-it-works.md Install an LPK package that was manually created using the lzc-cli. This command assumes the LPK file is in the current directory. ```bash lzc-cli lpk install hello-manual.lpk ``` -------------------------------- ### Install System Dependencies on macOS Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/lzc-cli.md Installs rsync and openssh using Homebrew on macOS. It's recommended to use the Homebrew version of rsync for compatibility. ```bash brew install rsync brew install openssh ``` -------------------------------- ### Example HTTP Access to Another App Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/advanced-app-interconnect.md This is an example of accessing a task API in the 'todo' application. Ensure your application has the necessary permissions declared in `package.yml`. ```http http://app.cloud.lazycat.app.todo.lzcx/api/tasks ``` -------------------------------- ### Create New Project with Vue Template Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/hello-world.md Use the lzc-cli to create a new project. Select the 'hello-vue' template and accept the default application ID. ```bash lzc-cli project create helloworld ``` -------------------------------- ### Install System Dependencies on Ubuntu/Debian Source: https://github.com/lazycatcloud/lzc-developer-doc/blob/master/docs/lzc-cli.md Installs necessary system packages, openssh-client and rsync, required for remote command execution and file synchronization on Ubuntu or Debian-based systems. ```bash sudo apt update sudo apt install openssh-client rsync ``` -------------------------------- ### Install lzc-cli and System Dependencies Source: https://context7.com/lazycatcloud/lzc-developer-doc/llms.txt Install the Node.js 18+ lzc-cli globally and necessary system dependencies for Ubuntu/Debian and macOS. This includes generating SSH keys and managing microservices. ```bash npm install -g @lazycatcloud/lzc-cli lzc-cli --version ``` ```bash sudo apt update && sudo apt install openssh-client rsync ``` ```bash brew install rsync openssh ``` ```bash [ -f ~/.ssh/id_ed25519.pub ] || ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N "" ``` ```bash lzc-cli box list lzc-cli box switch lzc-cli box default ``` ```bash lzc-cli box add-by-ssh
``` ```bash lzc-cli box add-public-key ``` ```bash lzc-cli project --help ```