OpenYida CLI

repository·main·Indexed 41 days ago

https://github.com/openyida/openyida

An AI-native CLI tool designed to bridge AI coding agents with the DingTalk Yida low-code platform. It enables developers to build, manage, and deploy Yida applications, including forms, workflows, custom React-based pages, and HTTP integrations, using natural language and chat-driven development workflows. Version 2026.9.18-1.

Tokens
380.3K
Snippets
613
Records
1.2K
Agent score
52%

What's inside OpenYida

  1. Overview of OpenYida capabilities

    main

    OpenYida acts as a bridge between AI coding agents and the Yida low-code platform, providing a CLI for the full application lifecycle:

    • Application delivery: Create, update, export, and import Yida applications.
    • Form modeling: Create forms, update fields, inspect schemas, and manage permissions.
    • Custom pages: Generate React-based pages, lint Yida runtime rules, compile, and publish.
    • Workflow automation: Create process forms, configure approval flows, and preview process instances.
    • Data operations: Query form/process/task/subform data and run anomaly checks.
    • Integrations: Manage HTTP connectors, connector actions, auth accounts, and automation flows.
    • Operations: Diagnose environment issues, manage login state, configure sharing, and upload CDN assets.
  2. Data Management Skill Overview

    main

    The yida-data-management skill provides capabilities for querying, adding, updating, and deleting data within OpenYida. It handles three main types of data:

    1. Form Instances: Standard form records.
    2. Sub-tables: Detailed records within a form.
    3. Process Instances/Tasks: Workflow-related data.

    Critical Distinction: Form operations use the /v1/form/ API, while process operations use the /v1/process/ API. These are completely independent; you must not mix their parameters or return structures.

    Use Cases:

    • Querying data, adding new records, or updating existing ones.
    • Viewing form instances or initiating processes.
    • Bulk importing data.
    • Querying pending tasks.
  3. Manage Agent Center (代理中心管理)

    main

    The agent-center skill allows you to query, create, edit, and revoke proxy settings for active employees (in-service) and departing employees (resignation). This is used to set up proxy persons for process approvals or submissions.

    Critical Safety Requirements

    • Confirm Identities: Before any operation, you must confirm the userId and department path of both the source user (the person being proxied) and the target user (the proxy person) using agent-center search-user. Never rely on names alone.
    • Verify Existing Proxies: Use agent-center list --keyword <userId> to check if proxy records already exist before creating new ones.
    • Permission Constraints: Resignation proxies (--type departure) can only be managed by platform administrators. If you receive a permission error, do not retry; instead, prompt the user to switch to an administrator account.
    • Time Range Requirements:
      • For normal (in-service) proxies, you must provide both --start and --end timestamps.
      • For resignation proxies, do not provide time parameters; the proxy becomes effective based on the user's resignation status.
    • Partial Range Requirements: If using --range part, you must specify the scope via --range-form <appType:formUuid>, --range-json, or --range-file.
  4. Use the yida-chart skill for ECharts advanced visualization

    main

    The yida-chart skill is used to create high-end ECharts visualization dashboards. It relies on the native Yida report interfaces (getDataAsync.json or getCacheData.json) to fetch aggregated data.

    When to use this skill:

    • User intents: "more beautiful", "advanced", "customized", "ECharts", or "data dashboard".
    • When a user provides an existing report URL and wants to beautify the display (Scenario C).
    • When a user needs advanced ECharts but has no native report yet (Scenario B).

    When NOT to use this skill:

    • For standard reporting or simple statistics (use yida-report instead).
    • For multi-table relational analysis (currently unsupported; clarify requirements first).

    Core Constraint: Never perform aggregation (KPI, grouping, sum, average, trends, proportions) on the frontend. All aggregation must be handled by the native report backend.

  5. Design System Overview: Soft Spectral Panels

    main

    The soft-spectral-panels theme is characterized by a near-black canvas with slightly lighter, large-rounded theme-dark panels. It uses a high-contrast approach where brand-colored solid interactive elements are paired with dark foreground text, while data focus is achieved through localized highlights (fine lines, light nodes, and small glows).

    Core Design Principles

    • Low-saturation layered surfaces: Uses a near-black shell and slightly lighter content cards with soft, rounded boundaries. Avoid filling backgrounds with high-saturation brand colors.
    • Large rounded surfaces with compact controls: Outer cards have significant corner radii, while inputs and controls use smaller radii. Avoid using a single corner radius for all objects.
    • Brand interactions and sparse data colors: Primary interactions use brand backgrounds with dark foregrounds. Specific colors like 'Acid Yellow' and 'Dark Red' are reserved for real data series, not for success/error states.
    • Localized highlights for readings: Use light points, thin vertical lines, and small reading bubbles to emphasize specific positions. Avoid large-scale neon effects or continuous animations that disrupt attention.
  6. Manage Yida Aggregate Tables (virtualView)

    main

    The yida-aggregate-table skill is used to manage Yida Aggregate Tables (also known as virtualView). This includes listing existing tables, creating empty ones, inspecting current configurations, previewing designs, saving drafts, and publishing live configurations.

    Important Distinctions:

    • Aggregate Tables (virtualView): Use this skill.
    • Statistical Reports: Use yida-report instead.
    • Custom Dashboards: Use yida-dashboard or yida-rechart instead.

    This skill orchestrates deterministic commands from the openyida aggregate-table CLI and does not implement a high-level DSL or a local formula engine.

  7. Supported Dashboard Interaction Patterns

    main

    The dashboard supports five major interaction closed-loop patterns:

    1. DingTalk Task Assignment (钉钉派单闭环): A flow that moves from frontend saveFormData to a task trigger, integrates an automated insert event, uses the Todo 2.0 connector, and results in a real DingTalk Todo.
    2. Responsible Person Search (searchUser): Searching for users within the organization.
    3. Card Screenshot Sharing: Using html2canvas to capture and share card views.
    4. AI News Marquee: Implementing CSS-based scrolling for AI news updates.
    5. Internal Short Links + Hidden Navigation: Managing navigation and deep linking within the organization.
  8. Understand OpenYida Platform Verification Standards

    main

    OpenYida uses a strict verification protocol to determine if a platform operation is a PASS. A successful API response (e.g., success) is insufficient on its own. To achieve a PASS, the following criteria must be met:

    1. Applicable Local Contract: The operation must satisfy the local contract/schema requirements.
    2. Platform Publish/Exact Readback: The platform must successfully publish the change, and a subsequent 'exact readback' (reading the data back from the server) must match the intended state.
    3. Runtime Side-effects/Provenance/Restore: For runtime-sensitive operations, there must be evidence of unique side-effects, provenance (origin tracking), or successful restoration of state.
    4. UI Evidence: Screenshots or UI states serve only as supplementary evidence and cannot replace API/Platform readback.

    Common verification statuses include:

    • PLATFORM_PUBLISH_PREVIEW_RUNTIME_VERIFIED: Control plane and runtime preview are verified.
    • PLATFORM_READBACK_VERIFIED: Data was successfully written and read back exactly.
    • PLATFORM_CONTROL_PLANE_VERIFIED_RUNTIME_PROBE_REQUIRED: The configuration (control plane) is correct, but the actual runtime behavior requires further probing.
  9. Extend platform variables with project-specific tokens

    main

    The platform provides a base set of semantic variables (for navigation, forms, tables, etc.) that must be preserved. To implement a unique project style, you should extend these variables rather than replacing them.

    Extension Strategies

    • Project Extensions: Add variables for gradients, textures, font hierarchies, content widths, grid spacing, materials, shadows, animations, and component states.
    • Naming Conventions: Use project or component-specific namespaces. While --oyd-* is the existing convention, you may use specific prefixes like --magazine-* to avoid masquerading as platform-supported variables.
    • Consumption: Clearly document which component or CSS property a new variable serves. New variables can be shared across multiple custom pages and components.
    • Value Types: Match CSS property requirements (e.g., use color values for background-color platform variables, but use gradients/images for theme variables consumed by background-image).
  10. Handle tab switching and routing in custom navigation

    main

    When implementing custom navigation, understand how the URL and routing interact:

    • Purpose vs. Display: The path (workbench vs submission) determines the intent (management vs entry), while parameters (hideLeftNav vs isRenderNav) determine the visual display (navigation visibility). They are independent.
    • Updating Content: When using a custom navigation shell, you should update the content within the iframe for same-app navigation.
    • Cross-Page Navigation: For transitions between different real pages, use the data bridge: router.push(href, params, false, true).
    • URL Integrity: Always use full URL patterns when calling router.push to prevent the router from incorrectly prepending application prefixes or failing to resolve the path. The data bridge supports omitting the fourth parameter to auto-identify full addresses, but explicitly passing false is supported.
    // Use the data bridge for cross-page navigation
    // router.push(href, params, [isReplace], [isFullUrl])
    router.push(fullUrl, params, false, true);
  11. Understand the risks of Full Replacement vs. Partial Merging in Schema publishing

    main

    When publishing changes to OpenYida, you can choose between two strategies. Understanding the trade-offs is critical for maintaining system stability, especially when using AI agents.

    Full Replacement

    Model: New Schema = f(Local Code)

    • Pros: Deterministic, reproducible (can test offline), and independent of the current online state. It is highly predictable for AI models.
    • Cons: It ignores the current online state and will overwrite any manual changes made by users directly on the production environment.

    Partial Merging

    Model: New Schema = f(Local Code, Current Online State)

    • Pros: Protects user data by preserving manual online configurations.
    • Cons: Introduces a 'live, untrusted input' (the online state). This makes the process non-deterministic, harder to reproduce locally, and more complex for AI agents to reason about.

    Key takeaway: Partial merging is safer for data but riskier for system predictability. If using merging, you must implement engineering safeguards (backups, validation, and honest summaries) to compensate for the loss of determinism.

  12. How custom page structure works

    main

    Custom pages should be organized into three distinct layers to maintain separation of concerns:

    1. State Layer (_customState): Holds UI state like loading, list/tableData, currentPage, pageSize, totalCount, filters/searchFieldJson, selectedRowKeys, and dialogVisible. Crucial: All failure paths must reset loading: false.
    2. Data Source Layer: Handles fetching and mutating data.
      • For standard applications, use this.utils.yida.searchFormDatas(params) to query form data.
      • Avoid using this.dataSourceMap.<name>.load() unless the specific data source has been explicitly created and bound in the current session.
    3. Interaction Layer: Handles the UI components (filters, tables, pagination, dialogs). The renderJsx function should focus strictly on rendering and event dispatching, while business logic should be moved to exported functions.