# CLI-Anything | ✨Data Intelligence Lab@HKU✨ | Knowledge Base | Instagit

"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/

GitHub Stars: 36.3k

Repository: https://github.com/HKUDS/CLI-Anything

---

## Articles

### [How Horizontal-Stack Layout Handles justify-content in HKUDS/CLI-Anything](/HKUDS/CLI-Anything/how-does-horizontal-stack-layout-handle-justify-content-start-center-end-space-between-in-hkuds-cli-anything)

Discover how HKUDS/CLI-Anything's horizontal-stack layout handles justify-content start, center, end, and space-between. Learn about dynamic coordinate and gap calculations for effective alignment.

- Tags: how-to-guide
- Published: 2026-08-16

### [How CLI-Anything Merges CLI-Provided Tokens with Spec-Defined Tokens](/HKUDS/CLI-Anything/what-is-the-process-for-merging-cli-provided-tokens-with-spec-defined-tokens-in-hkuds-cli-anything)

Learn how CLI-Anything merges CLI provided tokens with spec defined tokens using a strict precedence hierarchy and directory-based security validation.

- Tags: how-to-guide
- Published: 2026-08-16

### [How Border and Background Styles Are Applied to Group Layers in CLI-Anything](/HKUDS/CLI-Anything/how-are-border-and-background-styles-applied-to-group-layers-in-hkuds-cli-anything)

Learn how CLI-Anything applies border and background styles to group layers by injecting an auxiliary background rectangle. Understand this unique container approach.

- Tags: how-to-guide
- Published: 2026-08-16

### [How HKUDS CLI-Anything Parses and Validates Input/Output File Paths](/HKUDS/CLI-Anything/how-does-the-hkuds-cli-anything-cli-parse-and-validate-input-output-file-paths)

Learn how HKUDS CLI-Anything parses and validates file paths using Click and pathlib for robust error handling. Ensure your CLI applications handle paths correctly.

- Tags: how-to-guide
- Published: 2026-08-16

### [Understanding the Previews Folder in HKUDS/CLI-Anything Generated .sketch Files](/HKUDS/CLI-Anything/what-is-the-purpose-of-the-previews-folder-in-hkuds-cli-anything-generated-sketch-files)

Discover the purpose of the previews folder in HKUDS/CLI-Anything generated .sketch files. Learn how it aids real-time monitoring and replay of workflow steps.

- Tags: deep-dive
- Published: 2026-08-16

### [How HKUDS/CLI-Anything Creates Labeled Rectangles (Buttons) with Background and Text](/HKUDS/CLI-Anything/how-does-hkuds-cli-anything-create-labeled-rectangles-like-buttons-with-background-and-text)

Discover how HKUDS/CLI-Anything crafts labeled rectangles with background and text. Learn about its unique approach using styled primitives and heuristics for perfect alignment.

- Tags: how-to-guide
- Published: 2026-08-16

### [How the CLI-Anything Layout Engine Calculates Intrinsic Sizes for Different Layer Types](/HKUDS/CLI-Anything/how-does-the-hkuds-cli-anything-layout-engine-calculate-intrinsic-sizes-for-different-layer-types)

Discover how the CLI-Anything layout engine calculates intrinsic sizes. Learn about its type-aware algorithm for spacers, text, and default dimensions.

- Tags: internals
- Published: 2026-08-16

### [What Happens When a Layer Type Is Not Recognized During the HKUDS/CLI-Anything Build Process](/HKUDS/CLI-Anything/what-happens-when-a-layer-type-is-not-recognized-during-the-hkuds-cli-anything-build-process)

Discover what happens when HKUDS CLI-Anything encounters an unknown layer type. Learn how it raises a ValueError and aborts the build to ensure artifact integrity.

- Tags: internals
- Published: 2026-08-16

### [How Artboards and Pages Are Structured in Sketch Documents Generated by HKUDS/CLI-Anything](/HKUDS/CLI-Anything/how-are-artboards-and-pages-structured-in-sketch-documents-generated-by-hkuds-cli-anything)

Understand how HKUDS/CLI-Anything structures Sketch artboards and pages within Sketch documents. Explore the hierarchical organization from Sketch to layers, generated programmatically.

- Tags: internals
- Published: 2026-08-16

### [How the HKUDS/CLI-Anything Builder Handles Missing or Unknown Style Tokens](/HKUDS/CLI-Anything/how-does-the-hkuds-cli-anything-builder-manage-missing-or-unknown-style-tokens)

Discover how HKUDS/CLI-Anything handles unknown style tokens. Learn how it logs warnings and continues building with valid tokens for seamless development.

- Tags: internals
- Published: 2026-08-16

### [CLI-Anything Compression Strategy for .sketch ZIP Files: Deflate Algorithm Deep Dive](/HKUDS/CLI-Anything/what-compression-strategy-does-hkuds-cli-anything-use-for-generating-sketch-zip-files)

Discover how CLI-Anything uses the Deflate algorithm to create compatible .sketch ZIP files. Learn about the ZIP DEFLATED compression strategy.

- Tags: deep-dive
- Published: 2026-08-16

### [How HKUDS/CLI-Anything Processes Nested Groups with Layouts Recursively](/HKUDS/CLI-Anything/how-are-nested-groups-with-their-own-layouts-processed-recursively-by-hkuds-cli-anything)

Learn how HKUDS/CLI-Anything recursively processes nested groups with layouts. Discover the caching mechanism used to build complex structures efficiently.

- Tags: internals
- Published: 2026-08-16

### [Security Measures for Loading Token Files via CLI Arguments in CLI‑Anything](/HKUDS/CLI-Anything/what-security-measures-are-in-place-for-loading-token-files-via-cli-arguments-in-hkuds-cli-anything)

Discover robust security measures for loading token files via CLI arguments in HKUDS/CLI-Anything. Learn about private directories, strict file modes, and Windows ACL isolation for enhanced protection.

- Tags: security-measures
- Published: 2026-08-16

### [How the HKUDS/CLI-Anything Builder Handles JSONC-Style Comments in Spec Files](/HKUDS/CLI-Anything/how-does-the-hkuds-cli-anything-builder-handle-jsonc-style-comments-in-spec-files)

Learn how the HKUDS CLI-Anything builder handles JSONC comments. It strips // style comments via regex, allowing JSONC-compatible spec files without extra dependencies.

- Tags: how-to-guide
- Published: 2026-08-16

### [CLI-Anything Design Token Architecture: Organization Guide for Colors, Radius, Spacing, Shadows, and Typography](/HKUDS/CLI-Anything/what-is-the-organization-structure-for-design-tokens-colors-radius-spacing-shadows-typography-in-hkuds-cli-anything)

Discover the CLI-Anything design token architecture. Learn how HKUDS organizes colors, radius, spacing, shadows, and typography in a single JSON file for efficient design system management.

- Tags: architecture
- Published: 2026-08-16

### [How 'Fill' Width Behavior Works in Horizontal Containers in CLI‑Anything](/HKUDS/CLI-Anything/how-does-the-fill-width-behavior-work-in-horizontal-containers-within-hkuds-cli-anything)

Understand why width fill in CLI-Anything's horizontal containers defaults to 300px. Learn how to leverage parent width context for true fill behavior and avoid unexpected fallbacks.

- Tags: deep-dive
- Published: 2026-08-16

### [What Layer Types Does HKUDS/CLI-Anything Support and How Are They Mapped to Sketch Primitives](/HKUDS/CLI-Anything/what-layer-types-does-hkuds-cli-anything-support-and-how-are-they-mapped-to-sketch-primitives)

Discover HKUDS/CLI-Anything supported layer types like paintlayer and grouplayer. Learn how they map to Sketch primitives including Bitmap and Group for seamless design workflows.

- Tags: architecture
- Published: 2026-08-16

### [How CLI-Anything Estimates Text Size for ASCII and CJK Characters](/HKUDS/CLI-Anything/how-is-text-size-estimated-for-ascii-and-cjk-characters-in-hkuds-cli-anything)

Discover how CLI-Anything estimates text size for ASCII and CJK characters. Learn about UTF-8 byte counting and wcwidth library for terminal display.

- Tags: internals
- Published: 2026-08-16

### [How HKUDS/CLI-Anything Path Validation Prevents Directory Traversal When Loading Token Files](/HKUDS/CLI-Anything/how-does-hkuds-cli-anything-path-validation-prevent-directory-traversal-when-loading-token-files)

Learn how HKUDS/CLI-Anything path validation secures token file loading by using absolute paths, rejecting user input, and enforcing strict permissions, preventing directory traversal.

- Tags: security
- Published: 2026-08-16

### [HKUDS/CLI-Anything Sketch File Build Process: UTF-8 Encoding Support for CJK Characters](/HKUDS/CLI-Anything/does-the-hkuds-cli-anything-custom-sketch-file-build-process-support-utf-8-encoding-for-cjk-characters)

Discover how HKUDS/CLI-Anything ensures UTF-8 encoding support for CJK characters in its Sketch file build process, bypassing default serializers for full character compatibility.

- Tags: how-to-guide
- Published: 2026-08-16

### [How the HKUDS/CLI-Anything Layout Engine Computes Positions for Nested Group Layers](/HKUDS/CLI-Anything/how-does-the-hkuds-cli-anything-layout-engine-compute-positions-for-nested-group-layers)

Discover how the HKUDS/CLI-Anything layout engine computes positions for nested group layers using QGIS's mapLayers API to flatten and unify layer extents into a bounding rectangle.

- Tags: internals
- Published: 2026-08-16

### [Vertical-Stack, Horizontal-Stack, and Absolute Layout Modes in HKUDS/CLI-Anything: A Complete Guide](/HKUDS/CLI-Anything/what-are-the-differences-between-vertical-stack-horizontal-stack-and-absolute-layout-modes-in-hkuds-cli-anything)

Understand HKUDS/CLI-Anything's vertical-stack, horizontal-stack, and absolute layout modes. Learn how each positioning strategy renders child layers in containers for complete control over your UI.

- Tags: deep-dive
- Published: 2026-08-16

### [How HKUDS/CLI-Anything Handles Token Resolution for $-References in Style Fields](/HKUDS/CLI-Anything/how-does-hkuds-cli-anything-handle-token-resolution-for-dollar-references-in-style-fields)

Discover how HKUDS/CLI-Anything resolves token references in style fields. Learn about token maps, user arguments, and Pi-Coding Agent integration for seamless $-reference replacement.

- Tags: internals
- Published: 2026-08-16

### [Testing Frameworks in CLI-Anything: Pytest and Jest Configuration Guide](/HKUDS/CLI-Anything/cli-anything-testing-frameworks-pytest-jest)

Configure pytest and Jest testing frameworks for CLI-Anything. Learn how to set up Python and JavaScript/TypeScript testing in the HKUDS/CLI-Anything repository.

- Tags: how-to-guide
- Published: 2026-05-18

### [How the 7-Phase Pipeline Handles REST API Wrappers in CLI-Anything: n8n and Mailchimp Case Studies](/HKUDS/CLI-Anything/cli-anything-7-phase-pipeline-rest-api-wrappers-n8n-mailchimp)

Learn how CLI-Anything's 7-phase pipeline integrates REST API wrappers like n8n and Mailchimp. Discover how HTTP APIs become the engine for seamless CLI integration and consistent test generation.

- Tags: deep-dive
- Published: 2026-05-18

### [Difference Between Canonical SKILL.md and Packaged Compatibility Copies in CLI-Anything](/HKUDS/CLI-Anything/cli-anything-canonical-skill-md-vs-packaged-compatibility-copies)

Understand the difference between canonical SKILL.md files and packaged compatibility copies in CLI-Anything. Learn how they ensure consistent CLI functionality.

- Tags: deep-dive
- Published: 2026-05-18

### [How to Add Custom Command Groups to an Existing CLI-Anything Harness](/HKUDS/CLI-Anything/cli-anything-add-custom-command-groups-existing-cli-harness)

Easily add custom command groups to your CLI Anything harness. Define groups with @cli.group(), attach sub-commands, and sync docs automatically. Get started now.

- Tags: how-to-guide
- Published: 2026-05-18

### [Security Hardening Measures in CLI-Anything: MCP Harness Protection Explained](/HKUDS/CLI-Anything/cli-anything-security-hardening-measures)

Discover CLI-Anything's robust security hardening including URL whitelisting, private network blocking, and prompt injection sanitization for protected MCP harnesses.

- Tags: deep-dive
- Published: 2026-05-18

### [How CLI-Anything Handles GUI Software via Headless Mode Execution](/HKUDS/CLI-Anything/cli-anything-handle-gui-software-headless-modes)

Discover how CLI-Anything effectively runs GUI software in headless mode. Learn about Python backend modules and headless flags for seamless execution.

- Tags: how-to-guide
- Published: 2026-05-18

### [CLI-Anything Software-Specific Backends: Blender, OBS-WebSocket, Python, and QGIS](/HKUDS/CLI-Anything/cli-anything-supported-software-backends-bpy-obs-websocket-pyqgis)

Control Blender, OBS-WebSocket, Python, and QGIS with CLI-Anything. Translate uniform CLI commands into native API calls for your favorite software.

- Tags: deep-dive
- Published: 2026-05-18

### [How the CLI-Anything Skill Generator Manages Software with Complex State or Session Management](/HKUDS/CLI-Anything/cli-anything-skill-generator-complex-state-session-management)

Discover how the CLI-Anything skill generator expertly handles complex software state and session management through static analysis and atomic JSON session files, ensuring efficient control.

- Tags: how-to-guide
- Published: 2026-05-18

### [How to Debug Generated CLI Commands Using JSON Output and Trace Flags in CLI-Anything](/HKUDS/CLI-Anything/cli-anything-debug-generated-commands-json-output-trace-flags)

Debug generated CLI commands using JSON output and trace flags in CLI-Anything. Leverage machine-readable output and targeted troubleshooting for efficient debugging.

- Tags: how-to-guide
- Published: 2026-05-18

### [Relationship Between Agent-Harness Directories, cli_anything Namespace, and pip Packages in CLI-Anything](/HKUDS/CLI-Anything/cli-anything-agent-harness-cli-namespace-pip-package-relationship)

Discover how agent-harness directories, the cli_anything namespace, and pip packages in CLI-Anything enable independent Python distributions to coexist without import issues.

- Tags: internals
- Published: 2026-05-18

### [How CLI-Anything Resolves Cross-Platform Paths Including Windows cygpath](/HKUDS/CLI-Anything/cli-anything-cross-platform-path-resolution-windows-cygpath)

Discover how CLI-Anything effortlessly resolves cross-platform paths using cygpath and Python's pathlib for seamless integration across Linux, macOS, and Windows.

- Tags: how-to-guide
- Published: 2026-05-18

### [Protocol Version Schema for Preview-Bundle/v1 and Preview-Trajectory/v1 in CLI-Anything](/HKUDS/CLI-Anything/cli-anything-protocol-version-schema-preview-bundle-trajectory)

Discover the protocol version schema for preview-bundle/v1 and preview-trajectory/v1 in CLI-Anything. Learn about the <type>/v<major> structure.

- Tags: api-reference
- Published: 2026-05-18

### [How the CLI-Anything Skill Generator Parses and Formats YAML Frontmatter for Agent Skill Discovery](/HKUDS/CLI-Anything/cli-anything-skill-generator-yaml-frontmatter-agent-skill-discovery)

Discover how CLI-Anything's skill generator parses and formats YAML frontmatter for agent skill discovery. Learn to create discoverable SKILL.md files for seamless agent interaction.

- Tags: how-to-guide
- Published: 2026-05-18

### [Authentication Methods for API-Based CLI Harnesses in CLI-Anything](/HKUDS/CLI-Anything/cli-anything-authentication-methods-api-cli-harnesses)

Discover CLI-Anything's API authentication methods: OAuth 2.0 for delegated access and Bearer tokens for common integrations like Obsidian and Mailchimp. Secure your CLI harnesses effectively.

- Tags: api-reference
- Published: 2026-05-18

### [How the `refine` Command Performs Incremental Gap Analysis for CLI Coverage in CLI-Anything](/HKUDS/CLI-Anything/cli-anything-refine-command-incremental-gap-analysis-cli-coverage)

Learn how the refine command performs incremental gap analysis for CLI coverage by inventorying commands rescanning capabilities computing a gap report and auto-generating new Click commands without removing existing functional...

- Tags: how-to-guide
- Published: 2026-05-18

### [CLI-Hub Architecture for Autonomous CLI Discovery and Installation in CLI-Anything](/HKUDS/CLI-Anything/cli-hub-architecture-autonomous-cli-discovery-installation)

Discover CLI-Hub's modular three-layer architecture for autonomous CLI discovery and installation. It automatically finds, caches, and installs CLIs across package managers.

- Tags: architecture
- Published: 2026-05-18

### [How ReplSkin Creates a Unified REPL Interface for Different Software Harnesses](/HKUDS/CLI-Anything/cli-anything-replskin-unified-repl-interface-software-harnesses)

Discover how ReplSkin unifies REPL interfaces for diverse software harnesses like ollama and macrocli. Learn how this dependency-free utility ensures consistent UI and branding across all tools.

- Tags: how-to-guide
- Published: 2026-05-18

### [How Preview Bundles and trajectory.json Enable Live Preview for AI Agents in CLI‑Anything](/HKUDS/CLI-Anything/cli-anything-preview-bundles-trajectory-json-live-preview-ai-agents)

Learn how CLI-Anything uses preview bundles and trajectory.json for stateless live AI agent previews. Explore command-to-visual mappings without external state.

- Tags: how-to-guide
- Published: 2026-05-18

### [SKILL.md Schema for CLI-Anything: A Complete Guide to Metadata Extraction and Structure](/HKUDS/CLI-Anything/cli-anything-skill-md-schema-metadata-extraction)

Learn the SKILL.md schema for CLI-Anything. Extract metadata from Python code, READMEs, and package info using structured Markdown for powerful CLI tools.

- Tags: deep-dive
- Published: 2026-05-18

### [How CLI-Anything's 7-Phase Pipeline Analyzes Software APIs and Generates CLI Commands](/HKUDS/CLI-Anything/cli-anything-7-phase-pipeline-api-analysis-cli-generation)

Discover how CLI-Anything's 7-phase pipeline analyzes software APIs and generates CLI commands. Transform GUIs into agent-native CLIs with static analysis and Python harnesses.

- Tags: how-to-guide
- Published: 2026-05-18

