← 返回 Skills 市场
oscraters

Alpaca Markets CLI

作者 oscraters · GitHub ↗ · v1.0.1
cross-platform ✓ 安全检测通过
460
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install alpaca-markets
功能描述
This skill provides integration with the Alpaca Markets API for trading stocks, options, and cryptocurrencies. Use it when you need to interact with Alpaca's...
使用说明 (SKILL.md)

Alpaca

Overview

This skill enables programmatic access to Alpaca Markets for automated trading, portfolio management, and market data retrieval via their REST API. It supports both live and paper trading accounts for stocks, options, and crypto.

Quick Start

Authentication

To use the Alpaca API, you need an API key and secret. Obtain these from your Alpaca account dashboard.

  • Paper trading: https://paper-api.alpaca.markets
  • Live trading: https://api.alpaca.markets

Set environment variables:

  • ALPACA_API_KEY
  • ALPACA_API_SECRET
  • ALPACA_BASE_URL (optional; defaults to paper trading URL)

Security / Credential Use

  • Use paper trading credentials by default.
  • Do not use live trading credentials until you have audited the code path you plan to run.
  • Keep ALPACA_BASE_URL unset unless you intentionally need a non-default environment.
  • Consider running the helper scripts in an isolated container or VM during evaluation.

Example Usage

  • Place a stock or crypto order: POST /v2/orders
  • Fetch account balance: GET /v2/account
  • Get positions (stocks/options/crypto): GET /v2/positions
  • List orders: GET /v2/orders

API Operations

Trading API

  • Get Account: GET /v2/account
  • Place Order: POST /v2/orders (stocks, options, crypto)
  • List Orders: GET /v2/orders
  • Get Order: GET /v2/orders/{order_id}
  • Replace Order: PATCH /v2/orders/{order_id}
  • Cancel Order: DELETE /v2/orders/{order_id}
  • Cancel All Orders: DELETE /v2/orders
  • Get Positions: GET /v2/positions
  • Close Position: DELETE /v2/positions/{symbol}
  • Close All Positions: DELETE /v2/positions
  • Get Assets: GET /v2/assets

Market Data

  • Use Alpaca Market Data API endpoints for crypto quotes and bars (see references/api_reference.md).

Included Files

  • scripts/alpaca_api.py: command-line helper for calling Alpaca endpoints with robust error handling and exit codes.
  • scripts/example.py: sample script showing account and order calls.
  • agents/openai.yaml: Clawhub/OpenClaw interface manifest for display name and default prompt metadata.
  • references/api_reference.md: concise endpoint reference and payload examples.
安全使用建议
This skill appears to do what it says: a small set of Python helpers to call Alpaca's REST API. Before installing or running: (1) prefer paper-trading credentials and never use live keys until you audit and test; (2) review alpaca_api.py yourself (it’s included) to confirm behaviors you expect; (3) do not set ALPACA_BASE_URL to a URL you don't control or trust (an attacker-controlled base URL would receive your API key/secret); (4) consider running the scripts in an isolated container or VM and restrict network egress if you want extra protection; (5) check network activity and logs when first running to ensure requests go to Alpaca endpoints.
功能分析
Type: OpenClaw Skill Name: alpaca-markets Version: 1.0.1 The skill provides a transparent interface to the Alpaca Markets API for trading, with clear documentation and code (`scripts/alpaca_api.py`) that directly implements its stated purpose. Crucially, `SKILL.md`, `README.md`, and `agents/openai.yaml` contain explicit security warnings and instructions for the AI agent to prioritize paper trading credentials and audit code before live trading, demonstrating responsible design rather than malicious intent. There is no evidence of data exfiltration, persistence mechanisms, obfuscation, or prompt injection designed to subvert the agent's behavior for harmful purposes.
能力评估
Purpose & Capability
Name/description (Alpaca Markets integration) match the required environment variables (ALPACA_API_KEY, ALPACA_API_SECRET), the included helper script (alpaca_api.py) which sends HTTP requests to Alpaca endpoints, and the example usage. No unrelated credentials or tools are requested.
Instruction Scope
SKILL.md and the scripts restrict activity to Alpaca API endpoints and advise using paper trading credentials and isolated environments. One small caveat: the code uses ALPACA_BASE_URL (optional) as the request base; if a user sets this to an attacker-controlled URL, the script would send credentials and requests there. This is a configurable risk (declared in frontmatter) rather than hidden behavior.
Install Mechanism
No install spec; the skill ships as source files (Python scripts) and a requirements.txt (requests). There are no downloads or installers that fetch arbitrary remote code at install time. This is low-risk for supply-chain surprises.
Credentials
Only ALPACA_API_KEY and ALPACA_API_SECRET are required (ALPACA_BASE_URL optional). These are exactly the credentials needed to call Alpaca's API; their presence is proportionate to the skill's trading purpose and are declared in metadata/frontmatter.
Persistence & Privilege
always is false; the skill does not request persistent/privileged presence or modify other skills. Model invocation is allowed (default) but that is normal and not combined with other red flags.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install alpaca-markets
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /alpaca-markets 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Added registry metadata and validation workflow for improved Clawhub/OpenClaw integration. - Introduced agents/openai.yaml for interface manifest support. - Enhanced SKILL.md with distribution metadata, homepage, and explicit credential/security guidance. - No changes to API operations or trading logic.
v1.0.0
Initial release of Alpaca Markets integration skill. - Enables programmatic trading of stocks, options, and cryptocurrencies via Alpaca's REST API. - Supports account management, order placement, position tracking, and market data retrieval. - Includes quick setup instructions for API authentication (paper and live trading). - Provides sample scripts and a concise API endpoint reference for easy onboarding.
元数据
Slug alpaca-markets
版本 1.0.1
许可证
累计安装 1
当前安装数 1
历史版本数 2
常见问题

Alpaca Markets CLI 是什么?

This skill provides integration with the Alpaca Markets API for trading stocks, options, and cryptocurrencies. Use it when you need to interact with Alpaca's... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 460 次。

如何安装 Alpaca Markets CLI?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install alpaca-markets」即可一键安装,无需额外配置。

Alpaca Markets CLI 是免费的吗?

是的,Alpaca Markets CLI 完全免费(开源免费),可自由下载、安装和使用。

Alpaca Markets CLI 支持哪些平台?

Alpaca Markets CLI 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Alpaca Markets CLI?

由 oscraters(@oscraters)开发并维护,当前版本 v1.0.1。

💬 留言讨论