跳到主内容
智客 ZICQ

技能库 智客分类:运维与云 managing-astro-local-env

Managing Astro Local Env

用 Astro CLI( Docker 和独立模式) 管理本地气流环境 。 当用户想要启动,停止,或重新启动气流,查看日志,查询气流API,故障排除,或解决环境问题时使用. 关于项目设置,参见设置-astro-project.

1784 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

用 Astro CLI( Docker 和独立模式) 管理本地气流环境

何时用

用户想要启动、停止或重新启动气流、查看日志、查询气流 API、故障排除或解决环境问题。 关于项目设置,见设置-astro-project

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Astro Local Environment、Start / Stop / Restart (Docker)、Start local Airflow (webserver at http://localhost:8080)、Stop containers (preserves data)、Kill and remove volumes (clean slate)、Restart all containers。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 description(原文)

Manage local Airflow environment with Astro CLI (Docker and standalone modes). Use when the user wants to start, stop, or restart Airflow, view logs, query the Airflow API, troubleshoot, or fix environment issues. For project setup, see setting-up-astro-project.

Astro Local EnvironmentStart / Stop / Restart (Docker)Start local Airflow (webserver at http://localhost:8080)Stop containers (preserves data)Kill and remove volumes (clean slate)Restart all containersRestart specific componentStandalone ModeStartOne-time: set standalone as default modeOr use the flag per invocationStop / Kill / Restart

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
managing-astro-local-env
description
Manage local Airflow environment with Astro CLI (Docker and standalone modes). Use when the user wants to start, stop, or restart Airflow, view logs, query the Airflow API, troubleshoot, or fix environment issues. For project setup, see setting-up-astro-project.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「managing-astro-local-env」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-29638ea7db2eb14d-%E7%AE%A1%E7%90%86-Astro-%E6%9C%AC%E5%9C%B0%E4%BF%A1%E5%B0%81.html
请存为 .cursor/skills/managing-astro-local-env/SKILL.md 或 .claude/skills/managing-astro-local-env/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/astronomer/agents' --list

npx skills add 'https://github.com/astronomer/agents' --skill 'managing-astro-local-env'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: managing-astro-local-env description: Manage local Airflow environment with Astro CLI (Docker and standalone modes). Use when the user wants to start, stop, or restart Airflow, view logs, query the Airflow API, troubleshoot, or fix environment issues. For project setup, see setting-up-astro-project. --- # Astro Local Environment This skill helps you manage your local Airflow environment using the Astro CLI. Two modes: **Docker** (default, uses containers) and **Standalone** (Docker-free, uses a local venv — requires Airflow 3 + `uv`). > **To set up a new project**, see the **setting-up-astro-project** skill. > **When Airflow is running**, use MCP tools from **authoring-dags** and **testing-dags** skills. --- ## Start / Stop / Restart (Docker) ```bash # Start local Airflow (webserver at http://localhost:8080) astro dev start # Stop containers (preserves data) astro dev stop # Kill and remove volumes (clean slate) astro dev kill # Restart all containers astro dev restart # Restart specific component astro dev restart --scheduler astro dev restart --webserver ``` **Default credentials:** admin / admin **Restart after modifying:** `requirements.txt`, `packages.txt`, `Dockerfile` > **Standalone mode?** See the next section. --- ## Standalone Mode Docker-free local development. Runs Airflow directly on your machine in a `.venv/` managed by `uv`. **Requirements:** Airflow 3 (runtime 3.x), `uv` on PATH. Not supported on Windows. > Plain `astro dev init` already pins a runtime 3.x image, so no version flag is needed. See **setting-up-astro-project** for project initialization. ### Start ```bash # One-time: set standalone as default mode astro config set dev.mode standalone # Or use the flag per invocation astro dev start --standalone ``` | Flag | Description | |------|-------------| | `--foreground` / `-f` | Stream output in foreground | | `--port` / `-p` | Override webserver port (default: 8080) | | `--no-proxy` | Disable reverse proxy | ### Stop / Kill / Restart ```bash # Stop (preserves .venv) astro dev stop # Kill (removes .venv and .astro/standalone/ — clean slate) astro dev kill # Restart (preserves .venv for fast restart, use -k to kill first) astro dev restart ``` > If you used `--standalone` on start instead of setting the config, pass `--standalone` on every subsequent command too (stop, kill, restart, bash, run, logs, etc.). **State locations:** venv in `.venv/`, database and logs in `.astro/standalone/`, DAGs from `dags/`. --- ## Reverse Proxy Run multiple Airflow projects locally without port conflicts. Works in both Docker and standalone modes. Each project gets a hostname like `.localhost:6563`. Visit `http://localhost:6563` to see all active projects. ```bash # Check proxy status and active routes astro dev proxy status # Force-stop proxy (auto-restarts on next astro dev start) astro dev proxy stop ``` | Config | Command | |--------|---------| | Change proxy port | `astro config set proxy.port ` | | Disable per-start | `astro dev start --no-proxy` | Default proxy port: **6563** --- ## Check Status ```bash astro dev ps ``` --- ## View Logs ```bash # All logs astro dev logs # Specific component astro dev logs --scheduler astro dev logs --webserver # Follow in real-time astro dev logs -f ``` **Standalone:** `astro dev logs` works the same but shows a unified log (no per-component filtering). --- ## Run Airflow CLI Commands ```bash # Open a shell with Airflow environment astro dev bash # Run Airflow CLI commands astro dev run airflow info astro dev run airflow dags list ``` **Standalone:** Same commands work — `bash` opens a venv-activated shell, `run` executes in the venv. --- ## Querying the Airflow API Use `astro api airflow` to query a running local Airflow instance. Prefer operation IDs over URL paths. **Defaults:** localhost:8080, admin/admin (auto-detected). Override with `--api-url`, `--username`, `--password`. ### Discovery ```bash # List all endpoints astro api airflow ls # Filter by keyword astro api airflow ls dags astro api airflow ls task # Show params and schema for an operation astro api airflow describe get_dag ``` ### Key Flags | Flag | Purpose | |------|---------| | `-p key=value` | Path parameters | | `-F key=value` | Body/query fields (auto-converts booleans/numbers) | | `-q` / `--jq` | jq filter on response | | `--paginate` | Fetch all pages | | `-X` / `--method` | Override HTTP method | | `--generate` | Output curl command instead of executing | ### DAGs ```bash # List all DAGs astro api airflow get_dags # Filter by pattern (SQL LIKE — use % wildcards) astro api airflow get_dags -F dag_id_pattern=%etl% # Get a specific DAG astro api airflow get_dag -p dag_id=my_dag # Get full details (schedule, params, etc.) astro api airflow get_dag_details -p dag_id=my_dag # Pause / unpause astro api airflow patch_dag -p dag_id=my_dag -F is_paused=true astro api airflow patch_dag -p dag_id=my_dag -F is_paused=false # View DAG source code astro api airflow get_dag_source -p dag_id=my_dag # Check import errors astro api airflow get_import_errors ``` ### DAG Runs ```bash # List runs for a DAG astro api airflow get_dag_runs -p dag_id=my_dag # Trigger a run astro api airflow trigger_dag_run -p dag_id=my_dag # Trigger with config astro api airflow trigger_dag_run -p dag_id=my_dag -F conf[key]=value # Get a specific run astro api airflow get_dag_run -p dag_id=my_dag -p dag_run_id=manual__2026-04-07 # Clear (re-run) a DAG run astro api airflow clear_dag_run -p dag_id=my_dag -p dag_run_id=manual__2026-04-07 -F dry_run=false ``` ### Task Instances ```bash # List task instances for a run astro api airflow get_task_instances -p dag_id=my_dag -p dag_run_id=manual__2026-04-07 # Use ~ as wildcard (all DAGs or all runs) astro api airflow get_task_instances -p dag_id=my_dag -p dag_run_id=~ # Get a specific task instance astro api airflow get_task_instance -p dag_id=my_dag -p dag_run_id=manual__2026-04-07 -p task_id=extract # Clear/retry failed tasks astro api airflow post_clear_task_instances -p dag_id=my_dag \ -F dag_run_id=manual__2026-04-07 -F only_failed=true -F dry_run=false # Get task logs astro api airflow get_log -p dag_id=my_dag -p dag_run_id=manual__2026-04-07 \ -p task_id=extract -p try_number=1 ``` ### Config & Connections ```bash astro api airflow get_connections astro api airflow get_variables astro api airflow get_config ``` ### Filtering with jq ```bash # List only DAG IDs astro api airflow get_dags -q '.dags[].dag_id' # Get failed task IDs from a run astro api airflow get_task_instances -p dag_id=my_dag -p dag_run_id=~ \ -q '[.task_instances[] | select(.state=="failed") | .task_id]' ``` --- ## Troubleshooting | Issue | Solution | |-------|----------| | Port 8080 in use | Stop other containers or edit `.astro/config.yaml` | | Container won't start | `astro dev kill` then `astro dev start` | | Package install failed | Check `requirements.txt` syntax | | DAG not appearing | Run `astro dev parse` to check for import errors | | Out of disk space | `docker system prune` | | Standalone won't start | Ensure `uv` is on PATH and runtime is 3.x | | Proxy port conflict | `astro config set proxy.port ` | | `.venv` corrupted | `astro dev kill` then `astro dev start --standalone` | ### Reset Environment When things are broken: ```bash astro dev kill astro dev start ``` --- ## Upgrade Airflow ### Test compatibility first ```bash astro dev upgrade-test ``` ### Change version 1. Edit `Dockerfile`: ```dockerfile FROM quay.io/astronomer/astro-runtime:13.0.0 ``` 2. Restart: ```bash astro dev kill && astro dev start ``` --- ## Related Skills - **setting-up-astro-project**: Initialize projects and configure dependencies - **authoring-dags**: Write DAGs (uses MCP tools, requires running Airflow) - **testing-dags**: Test DAGs (uses MCP tools, requires running Airflow) - **deploying-airflow**: Deploy DAGs to production (Astro, Docker Compose, Kubernetes)

相关技能

运维与云

Docker Essentials

用于容器管理,图像操作,调试的基本道克命令和工作流程.

运维与云

Find Skills

从开放的代理技能生态系统中发现并安装技能. 使用时:(1)用户问"我如何做X",X可能拥有现有技能,(2)用户说"为X找到技能"或"是否为X有技能",(3)用户问"你能否做X",X是专门能力,(4)用户想扩展代理能力,(5)用户想搜索工具,模板,或工作流程,(6)用户提到他们希望…

运维与云

Microsoft Foundry

构建,部署,评价,优化,微调,管理微软创始代理,模型,资源最终结束. 用法:铸造、azd ai代理、azd 提供/部署、托管代理脚手架/开发/运行/部署/拖放、即时代理创建、创建代理、更新代理、添加代理工具、援引代理、代理.yaml、评估代理、批量活化、连续活化、持续监测、代理C…

运维与云

Azure Deploy

执行已有.azure/部署计划.md和基础设施文件的ALREADY-PREPARED应用程序的Azure部署。 当用户向 CREATE 请求新应用程序时, 请不要使用此技能 。 这种技能运行了 azd上行, azd 部署, trarraform 应用, 和 az 部署命令带有内置…