惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
博客园 - 司徒正美
WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
T
Tailwind CSS Blog
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
L
LangChain Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
Visual Studio Blog
S
SegmentFault 最新的问题
Google DeepMind News
Google DeepMind News
博客园 - 聂微东

博客园 - 荣锋亮

just-git 纯js 的git 实现 阿里开源的UnifiedModel agno agentos interfaces 简单说明 agno agentos ag-ui 协议 agno agentos 暴露a2a 协议 agno gateway模式 agno 多agent 框架集成能力 agno agentos 简单说明 agno workflow 模式简单说明 agno team agent 简单说明 agno remote agent 简单说明 agno agent 使用 agno agent 平台 sshpiper 简单试用 sshpiper ssh 的反向代理服务 context-propagation spring reactor 的上下文传递包 nginx 发布1.31.2 了 reductstore 的一些部署模式 reductstore 数据写入模式 reductstore bridge 方便reductstore数据bridge 扩展 reductstore zenoh 集成 zenoh 1.9.x 一些新特性 ladybugdb嵌入式图数据库 BlockHound 检测 reactor阻塞调用的agent reductstore 高性能面向机器人以及IOT场景的存储以及流数据基石 zerofs 一些新功能 java nats request-many 支持的一些模式 java nats RequestMany context7 面向llm 以及ai代码编辑器的依赖包更新平台 NATS Agents Protocol nats 团队提出的agent 通信协议
zx 试用
荣锋亮 · 2026-04-09 · via 博客园 - 荣锋亮

zx 的语法简单,就是js,对于进行script 操作比较方便,以下是一个简单试用

安装

方法比较多,可以是cli模式,也可以是npm包模式

基于cli模式的试用

  • 执行markdown文件 这个是很有意思的一个功能 demo.md
# Some script
`ls` — is an unix command to get directory contents. Let's see how to use it in `zx`:

```js
// ts, js, cjs, mjs, etc
const {stdout} = await $`ls -l`
console.log('directory contents:', stdout)
执行 

```Plain Text
zx demo.md

效果

image

  • 自动安装依赖

a.mjs

import sh from 'tinysh'

sh.say('Hello, world!')

npm 包模式

npm 包模式对于代码集成比较方便

  • 一个示例

pipe 模式的shell 处理

#!/usr/bin/env zx
import { $, echo } from 'zx'

$.nothrow = true

const list =  $`ls -la`.pipe($`grep .mjs`)

echo(await list.text())

效果

image

说明

zx 作为shell script 开发还是比较方便的,值得尝试下

参考资料

https://google.github.io/zx/markdown

https://github.com/google/zx

https://google.github.io/zx/api