Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计提醒

shellflowshellflow 命令行

Agent Skill

shellflow 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

210

周安装

9

GitHub Stars

公开资料未说明

下载量

73
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:shellflow(shellflow 命令行)
来源仓库:https://github.com/longcipher/shellflow
仓库路径:skills/shellflow
安装命令:
npx skills add https://github.com/longcipher/shellflow --skill shellflow
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/longcipher/shellflow --skill shellflow

简介

用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。

  • 适合整理代码变更、跟踪任务状态或分析协作流程。
  • 可通过 GitHub API 获取仓库元数据和事件历史。
  • 安装前需确认账号权限,避免越权访问敏感仓库。shellflow 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 建议结合原始 README 了解具体命令和数据格式。

SKILL.md

Shellflow Playbook Authoring

Overview

Shellflow playbooks are standard bash scripts with comment markers that split execution into sequential local and remote blocks.

The agent should generate normal shell code first, then apply Shellflow-specific rules for block boundaries, shared prelude handling, remote host selection, and cross-block data passing.

When to Use

Use this skill when:

  • Writing a new Shellflow playbook.
  • Refactoring an existing bash script into # @LOCAL and # @REMOTE blocks.
  • Reviewing whether a script actually matches Shellflow's parser and execution model.
  • Explaining why a Shellflow script behaves differently from a single long-running shell session.

Do not use this skill for:

  • Generic bash scripting unrelated to Shellflow.
  • Arbitrary SSH orchestration syntax that Shellflow does not parse.
  • Multi-host fan-out or non-bash execution models.

Core Rules

1. Write a normal bash script

  • Use a regular .sh file.
  • Keep the shebang at the top when it helps editors and humans, for example #!/bin/bash.
  • Put shell options such as set -euo pipefail near the top if every block should inherit them.

2. Use only supported block markers

Shellflow recognizes these standalone marker lines:

  • # @LOCAL
  • # @REMOTE <ssh-host>

Rules:

  • Markers must appear on their own line as comments.
  • @REMOTE must include exactly one host argument.
  • Marker names are uppercase in current Shellflow usage.
  • Unknown markers fail parsing.

Good:

# @LOCAL
echo "build locally"

# @REMOTE staging
uname -a

Bad:

# @remote staging
uname -a

echo "# @LOCAL"

3. Treat everything before the first marker as shared prelude

Lines before the first marker are prepended to every executable block.

This area is appropriate for:

  • Shebangs
  • Shell safety flags such as set -euo pipefail
  • Small helper functions
  • Shared constants that should exist in every block

This area is not appropriate for one-time side effects, because they will run once per block:

  • cd some/dir
  • echo "starting deployment"
  • export BUILD_ID=$(date +%s) when you expect a single shared value
  • Any command that should happen only once

Good:

#!/bin/bash
set -euo pipefail

log() {
  printf '[shellflow] %s\n' "$*"
}

# @LOCAL
log "building"

Bad:

#!/bin/bash
cd /srv/app

# @LOCAL
pwd

# @REMOTE staging
pwd

Why it is bad: the cd /srv/app line becomes part of every block, including remote blocks.

4. Use block directives for timeout, retry, and exports

Block directives must appear immediately after the # @LOCAL or # @REMOTE <host> marker, before any command lines. They configure execution behavior for that specific block.

Timeout Directive

# @TIMEOUT <seconds> - Abort the block if it exceeds the specified duration.

# @LOCAL
# @TIMEOUT 30
sleep 60

Retry Directive

# @RETRY <count> - Retry the block up to N times on failure (0 means no retry).

# @LOCAL
# @RETRY 3
curl -f https://api.example.com/health

Export Directive

# @EXPORT NAME=source - Capture a value from the block result and pass it to subsequent blocks as an environment variable.

Valid sources:

  • stdout - The block's standard output
  • stderr - The block's standard error
  • output - Combined stdout and stderr
  • exit_code - The block's exit code (as string)
# @LOCAL
# @EXPORT BUILD_ID=stdout
echo "build-$(date +%s)"

# @LOCAL
echo "Building: $BUILD_ID"

You can use multiple exports in a single block:

# @LOCAL
# @EXPORT STATUS_CODE=exit_code
# @EXPORT RESPONSE=stdout
curl -s -w "%{http_code}" -o response.txt https://api.example.com

Shell Directive

# @SHELL <shell> - Specify the shell to use for executing this block.

Use this when targeting remote hosts that use a non-bash default shell (e.g., zsh).

# @REMOTE zsh-server
# @SHELL zsh
# zsh-specific commands now work
reload
compdef

Without @SHELL, Shellflow defaults to bash for all remote blocks.

5. Assume every block runs in a fresh shell

Each block is isolated.

Do not assume these persist into the next block:

  • Current working directory
  • Shell variables
  • export values
  • Aliases
  • Functions defined inside a block
  • Shell options set inside a block

Write each block so it can run independently.

Good:

# @LOCAL
cd /tmp
artifact=$(mktemp)
printf 'ready' > "$artifact"
echo "$artifact"

# @LOCAL
artifact="$SHELLFLOW_LAST_OUTPUT"
test -f "$artifact"
cat "$artifact"

Bad:

# @LOCAL
cd /tmp
artifact=$(mktemp)

# @LOCAL
printf 'ready' > "$artifact"
pwd

Why it is bad: artifact and the working directory do not persist.

6. Use SHELLFLOW_LAST_OUTPUT for explicit handoff

Shellflow passes the previous block's combined output into the next block as SHELLFLOW_LAST_OUTPUT.

Guidelines:

  • Prefer passing a single path, ID, or compact value.
  • Quote it when reading: "$SHELLFLOW_LAST_OUTPUT".
  • If the previous block prints multiple lines, expect a multi-line string.
  • Do not treat it as structured JSON unless you intentionally emitted JSON in the previous block.

Good:

# @LOCAL
echo "/tmp/release.tar.gz"

# @REMOTE staging
tar -tf "$SHELLFLOW_LAST_OUTPUT" >/dev/null

Better for structured data:

# @LOCAL
python - <<'PY'
import json
print(json.dumps({"release": "2026.03.15"}))
PY

# @LOCAL
python - <<'PY'
import json
import os
payload = json.loads(os.environ["SHELLFLOW_LAST_OUTPUT"])
print(payload["release"])
PY

7. Use SSH config host aliases, not ad-hoc targets

# @REMOTE <ssh-host> should point to a host that resolves through SSH config.

Prefer:

  • # @REMOTE staging
  • # @REMOTE production-app

Avoid assuming Shellflow accepts any arbitrary free-form destination unless it is resolvable by the SSH config in use.

If a remote host is unknown, Shellflow fails before execution.

8. Keep blocks self-contained and fail-fast

Shellflow runs blocks in order and stops on the first failure.

Write blocks so that:

  • Preconditions are checked inside the block that needs them.
  • Cleanup is local to the block when necessary.
  • Output is intentional and not noisy when later blocks depend on it.

Prefer this:

# @REMOTE staging
cd /srv/app
test -f docker-compose.yml
docker compose pull
docker compose up -d

Over this:

# @REMOTE staging
cd /srv/app

# @REMOTE staging
docker compose pull
docker compose up -d

Why: the second block cannot rely on the first block's cd.

9. CLI Options and Output Modes

Shellflow provides several CLI options for different use cases:

Basic Options

shellflow run script.sh              # Run a script
shellflow run script.sh -v          # Run with verbose output
shellflow run script.sh --dry-run   # Preview execution plan without running

Structured Output

shellflow run script.sh --json       # Single JSON report
shellflow run script.sh --jsonl       # Streaming JSON Lines events
  • --json: Outputs a single JSON object with the complete run report
  • --jsonl: Outputs one JSON object per event (run_started, block_started, block_finished, run_finished)

Execution Control

shellflow run script.sh --no-input   # Non-interactive mode (stdin closed)
shellflow run script.sh --ssh-config /path/to/config  # Custom SSH config
  • --no-input: Closes stdin before running blocks; useful for automation
  • --ssh-config: Override the default SSH config path (~/.ssh/config)

Audit Logging

shellflow run script.sh --audit-log audit.jsonl --jsonl

The --audit-log option writes redacted JSON Lines events to a file. Secret-like exports (containing TOKEN, SECRET, or PASSWORD in the name) are automatically redacted to [REDACTED].

10. Exit Codes

Shellflow returns distinct exit codes for different failure types:

  • 0: Success
  • 1: General execution failure
  • 2: Parse failure (invalid script syntax)
  • 3: SSH config failure (host not found)
  • 4: Timeout failure (block exceeded timeout)

Authoring Checklist

Before returning a Shellflow playbook, verify that:

  • The script is valid bash without custom DSL syntax.
  • Only # @LOCAL, # @REMOTE <host>, and block directives (# @TIMEOUT, # @RETRY, # @EXPORT, # @SHELL) are used.
  • Block directives appear immediately after the block marker, before any commands.
  • Anything before the first marker is safe to repeat for every block.
  • Every block can run independently in a fresh shell.
  • Cross-block data uses SHELLFLOW_LAST_OUTPUT or @EXPORT explicitly.
  • Remote targets match the intended SSH host aliases.
  • Commands that should happen once are not accidentally placed in the shared prelude.
  • Export sources are valid (stdout, stderr, output, exit_code).

Reference Example

#!/bin/bash
set -euo pipefail

log() {
  printf '[deploy] %s\n' "$*"
}

# @LOCAL
# @EXPORT BUILD_ID=stdout
log "building artifact"
build_id="build-$(date +%Y%m%d%H%M%S)"
echo "$build_id"

# @LOCAL
# @TIMEOUT 60
# @RETRY 2
log "deploying to staging"
echo "Deploying $BUILD_ID to staging"

# @REMOTE staging
# @EXPORT DEPLOYED_HOST=stdout
log "receiving deployment"
hostname

# @LOCAL
log "deployed to: $DEPLOYED_HOST"
log "build $BUILD_ID complete"

Common Mistakes

  • Putting one-time commands before the first marker, then being surprised when they run for every block.
  • Expecting cd, export, or local shell variables from one block to exist in the next block.
  • Using an undefined remote host alias.
  • Placing block directives after commands instead of immediately after the marker.
  • Using invalid export sources (not stdout, stderr, output, or exit_code).
  • Forgetting that @SHELL must be specified before any commands in the block.
  • Forgetting that @RETRY 0 means no retry attempts.
  • Using @TIMEOUT with values too small for normal operation.
  • Printing extra debug output from a block whose output is consumed by the next block via @EXPORT.
  • Forgetting to quote "$SHELLFLOW_LAST_OUTPUT".
  • Treating Shellflow as a persistent session instead of sequential isolated shells.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.92%
按下载量换算25

Claude

30.01%
按下载量换算22

Cursor

18.29%
按下载量换算13

Gemini CLI

10.17%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills