Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от modbender★ 21 звезда на GitHub

Об этом скилле

Alpaca Trading (Python CLI) - OpenClaw Agent Skill

ClawHub GitHub

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 init displays registration steps for agent automation
  • alpaca auth saves 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:

  1. Get user consent - Explain that setup will modify shell config
  2. Use paper trading keys - Test with virtual money first ($100k virtual)
  3. Least privilege - Use API keys with minimal required permissions
  4. Monitor activity - Check your Alpaca account regularly

For agents:

  • Get explicit user permission before running alpaca auth (saves keys to shell config)
  • alpaca init is safe to run - it only displays instructions
  • Use browser automation to complete registration steps automatically
  • After obtaining keys via browser, call alpaca auth to save them

Links:

Alpaca Trading (Python CLI)

ClawHub GitHub

Trade stocks and crypto programmatically via Alpaca's API using a Python-based CLI tool.

Links:

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:

  1. Enter API Key
  2. Enter Secret Key (hidden)
  3. Choose trading mode (Paper/Live)
  4. 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
Полный SKILL.md на GitHub

Установить alpaca-py-cli в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

README.mdsetup.json

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), без исполняемых скриптов.

Похожие скиллы

Сравнить alpaca-py-cli с