Skip to content

docs: describe CLI HLD - #1291

Merged
antongolub merged 2 commits into
google:mainfrom
antongolub:docs-arch-cli
Jul 29, 2025
Merged

docs: describe CLI HLD#1291
antongolub merged 2 commits into
google:mainfrom
antongolub:docs-arch-cli

Conversation

@antongolub

Copy link
Copy Markdown
Collaborator
  • Tests pass
  • Appropriate changes to README are included in PR

@antongolub
antongolub requested a review from Copilot July 29, 2025 12:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds documentation for the CLI component in the zx library's architecture guide, providing a high-level design overview of how the CLI processes and executes scripts.

  • Adds a new CLI section to the architecture documentation
  • Documents three key CLI helper functions and their responsibilities
  • Includes a structured table describing the main components of the CLI workflow

Comment thread docs/architecture.md Outdated
Consolidates error handling functionality across the zx library: errors codes mapping, formatting, stack parsing.

## CLI
zx provides CLI with embedded script preprocessor to construct an execution context (apply presets, injects global vars) and to install the required deps. Then runs the specified script.

Copilot AI Jul 29, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sentence has a grammatical error. 'injects' should be 'inject' to maintain parallel structure with 'apply'.

Suggested change
zx provides CLI with embedded script preprocessor to construct an execution context (apply presets, injects global vars) and to install the required deps. Then runs the specified script.
zx provides CLI with embedded script preprocessor to construct an execution context (apply presets, inject global vars) and to install the required deps. Then runs the specified script.

Copilot uses AI. Check for mistakes.
Comment thread docs/architecture.md Outdated

| Helper | Description |
|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `main()` | Inits a preset from flags, env vars and pushes the reader. |

Copilot AI Jul 29, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Inits' is not a proper word. It should be 'Initializes' for better documentation clarity.

Suggested change
| `main()` | Inits a preset from flags, env vars and pushes the reader. |
| `main()` | Initializes a preset from flags, env vars and pushes the reader. |

Copilot uses AI. Check for mistakes.
Comment thread docs/architecture.md
| Helper | Description |
|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `main()` | Inits a preset from flags, env vars and pushes the reader. |
| `readScript()` | Fetches, parses and transforms the specified source into a runnable form. `stdin` reader, `https` loader and `md` transformer act right here. Deps analyzer internally relies on [depseek](https://www.npmjs.com/package/depseek) and inherits its limitations |

Copilot AI Jul 29, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing comma after 'parses' for proper list formatting. It should be 'Fetches, parses, and transforms'.

Suggested change
| `readScript()` | Fetches, parses and transforms the specified source into a runnable form. `stdin` reader, `https` loader and `md` transformer act right here. Deps analyzer internally relies on [depseek](https://www.npmjs.com/package/depseek) and inherits its limitations |
| `readScript()` | Fetches, parses, and transforms the specified source into a runnable form. `stdin` reader, `https` loader and `md` transformer act right here. Deps analyzer internally relies on [depseek](https://www.npmjs.com/package/depseek) and inherits its limitations |

Copilot uses AI. Check for mistakes.
@antongolub
antongolub merged commit cbc6999 into google:main Jul 29, 2025
28 checks passed
@antongolub
antongolub deleted the docs-arch-cli branch July 29, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants