alpaca-py-cli
БесплатноБез исполняемых скриптовНе проверенAI agent skill for Alpaca Markets trading. Intelligent setup wizard (alpaca init) guides users through registration. Trade stocks/crypto, manage portfolios…
от modbender★ 21 звезда на GitHubОб этом скилле
Alpaca Trading (Python CLI) - OpenClaw Agent Skill
Trade stocks and crypto programmatically via Alpaca's API using a Python-based CLI tool.
⚠️ Security & Setup Requirements
IMPORTANT - READ BEFORE USE:
This skill stores API keys as environment variables in your shell config file.
What happens during setup:
alpaca initdisplays registration steps for agent automationalpaca authsaves API keys to shell startup files (~/.zshrc, ~/.bashrc, or ~/.profile)- This creates persistent environment variables accessible to all shell sessions
Security considerations:
- ✅ API keys are stored as environment variables (standard practice)
- ✅ Paper trading by default (virtual money, no risk)
- ⚠️ Keys in shell config are accessible to any process in that shell
- ⚠️ Setup modifies user's shell configuration files
Recommended practices:
- Get user consent - Explain that setup will modify shell config
- Use paper trading keys - Test with virtual money first ($100k virtual)
- Least privilege - Use API keys with minimal required permissions
- Monitor activity - Check your Alpaca account regularly
For agents:
- Get explicit user permission before running
alpaca auth(saves keys to shell config) alpaca initis safe to run - it only displays instructions- Use browser automation to complete registration steps automatically
- After obtaining keys via browser, call
alpaca authto save them
Links:
- ClawHub: https://clawhub.ai/skills/alpaca-py-cli
- GitHub: https://github.com/zijunl/alpaca-py-cli
- Alpaca Markets: https://alpaca.markets
Alpaca Trading (Python CLI)
Trade stocks and crypto programmatically via Alpaca's API using a Python-based CLI tool.
Links:
- ClawHub: https://clawhub.ai/skills/alpaca-py-cli
- GitHub: https://github.com/zijunl/alpaca-py-cli
- Alpaca Markets: https://alpaca.markets
Overview
Manage your Alpaca Markets trading account using the alpaca CLI tool and Python SDK. Supports both paper trading (simulated) and live trading.
Installation
Recommended: Homebrew Python (avoids urllib3/LibreSSL warnings)
# Install Homebrew Python 3.11+
brew install [email protected]
# Install alpaca-py
/opt/homebrew/bin/pip3.11 install alpaca-py pytz
Alternative: System Python
pip3 install alpaca-py pytz
Note: System Python may show urllib3 warnings on macOS due to LibreSSL compatibility. Use Homebrew Python for a cleaner experience.
Configuration
Quick Setup with CLI
alpaca auth
This will interactively prompt you for:
- API Key
- Secret Key (hidden input)
- Trading mode (Paper or Live)
The command automatically saves your credentials to your shell config file (~/.zshrc, ~/.bashrc, or ~/.profile).
Manual Setup
Alternatively, set these in your shell profile manually:
export ALPACA_API_KEY="your_api_key"
export ALPACA_SECRET_KEY="your_secret_key"
export ALPACA_PAPER="true" # Use "false" for live trading
Get your API keys from https://alpaca.markets (Dashboard → API Keys)
Paper Trading (recommended for testing):
- Use paper trading API keys
- Virtual $100,000 starting balance
- No real money at risk
Live Trading (real money):
- Use live trading API keys
- Real money, real risk
- Test thoroughly with paper trading first
CLI Commands
Setup & Configuration
Configure Credentials
alpaca auth
Interactive setup wizard that guides you through:
- Enter API Key
- Enter Secret Key (hidden)
- Choose trading mode (Paper/Live)
- Automatically saves to shell config
Account & Market Info
Check Account
alpaca account
Shows:
- Account number and status
- Portfolio value, cash, buying power
- P&L (equity, last equity)
- Trading restrictions (pattern day trader, blocks)
Check Market Status
alpaca clock
Shows:
- Market status (🟢 OPEN or 🔴 CLOSED)
- Current time
- Next open/close times
View Market Calendar
# Show next 30 trading days (default)
alpaca calendar
# Show next 7 trading days
alpaca calendar --days 7
Shows trading days with open/close times (Eastern Time).
View Portfolio History
# Default: 1 month, daily bars
alpaca history
# Last week
alpaca history --period 1W
# Last 3 months with hourly bars
alpaca history
Установить alpaca-py-cli в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл alpaca-py-cli?
AI agent skill for Alpaca Markets trading. Intelligent setup wizard (alpaca init) guides users through registration. Trade stocks/crypto, manage portfolios, execute orders via natural language. Token-efficient design with runtime guidance. Paper trading by default ($100k virtual money). IMPORTANT - Setup requires user interaction to configure API keys in shell environment.
Как установить скилл alpaca-py-cli?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл alpaca-py-cli запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic