alpaca-cli
Skill by alpacahq
Installs, configures and uses the Alpaca CLI, a command-line tool for the Alpaca Trading API. It is for users and AI agents who trade stocks or crypto or fetch market data from a terminal or script.
Install alpaca-cli
Built from the published package, never by AI.
git clone --depth 1 https://github.com/alpacahq/cli /tmp/cli && mkdir -p ~/.claude/skills && cp -r /tmp/cli/.agents/skills/alpaca-cli ~/.claude/skills/alpaca-cliRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/alpacahq/cli /tmp/cli && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/cli/.agents/skills/alpaca-cli ~/.gemini/antigravity-cli/skills/alpaca-cliAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The Alpaca CLI is a command-line tool for the Alpaca Trading API. This skill explains how to install it with Go, authenticate with API keys or OAuth, and manage profiles. It also covers how to use the CLI for trading, market data and account lookups.
The skill sets out rules for automation and agent use. Commands should run with --quiet so output is machine-readable, and errors are returned as JSON on stderr. Orders should include a client order ID so retries do not create duplicates, and --dry-run can preview an order. It is intended for developers, scripts, CI pipelines and AI agent workflows that use Alpaca.
Written from the project's SKILL.md and checked against it.
What it can do
- Install and verifyChecks for an existing install, installs the CLI with go install, and confirms credentials with version, clock and account commands.
- Authentication and profilesCovers interactive login, API key setup, multiple named profiles and switching between them.
- Environment variable authLets scripts, CI and agents supply ALPACA_API_KEY and ALPACA_SECRET_KEY without writing secrets to disk.
- Order submissionSubmits orders with options such as symbol, side, quantity, type and limit price, with a dry-run preview.
- Idempotent ordersPasses a client order ID on submit and checks order status by client ID before any retry.
- Market dataRetrieves market data such as latest trades and bars, with pagination via limit and page token.
- Structured errors and exit codesReturns JSON errors on stderr and exit codes 0, 1 and 2 for success, API error and authentication error.
- Command discoveryUses --help-all, --help and --schema to list commands, flags and response fields.
- Update checkChecks for a newer CLI version and returns the update command in machine-readable form.
What you need
- Go, for installation with go install
- Alpaca API key and secret key
- macOS, Linux or Windows
Try asking
- Install the Alpaca CLI and check that my credentials work.
- Preview a limit buy of 10 AAPL at 185 with a dry run.
- Show my open positions as JSON using the Alpaca CLI.
Good to know
- alpaca profile login uses OAuth, which is paper-only.
- Live trading requires API keys and ALPACA_LIVE_TRADE=true or --live.
- Retries on 429 and 5xx are limited to 3 attempts.
- alpaca locate create may incur locate fees.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/alpaca-cli/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to alpaca-cli
All alternatives →Lists live launchpad token feeds and AI-detected hot topics for meme tokens on BSC, Solana and Base. Covers new, finalizing and just-migrated tokens on launchpads such as Pump.fun and Four.meme.
The okx-market skill lets an AI assistant retrieve cryptocurrency market data from the OKX V5 REST API. It is aimed at users who want spot, derivatives and index data in Python without an account.
Calculates key SaaS health metrics such as ARR, churn, LTV and CAC from raw business numbers, then gives prioritized advice. Built for founders and finance leads who share revenue or customer figures.
Fetches U.S. SEC EDGAR data for research. It resolves a ticker to its CIK, lists recent filings with primary-document URLs, and pulls XBRL financial series. Built for analysts who need free, U.S.-only filing data.
Provides free, no-auth access to Eastmoney market data for A-shares, Hong Kong stocks and US stocks. It covers fund flows, dragon-tiger lists, financial statements and stock screening.
Reads and manages a user's QuickBooks business through Intuit's official MCP server. It answers finance questions from reports, invoices, customers, products and benchmarks, and completes approved actions.
Compare with meme-rush, okx-market or saas-metrics-coach
alpaca-cli: common questions
Is paper trading the default?
Yes. alpaca profile login defaults to paper trading, and live trading needs API keys with --live or ALPACA_LIVE_TRADE=true.
How do I keep API keys out of scripts?
Set ALPACA_API_KEY and ALPACA_SECRET_KEY as environment variables. The source says no secrets touch disk on this path, and it advises against passing --secret as a flag.
What do the exit codes mean?
Exit code 0 means success, 1 means an API or general error, and 2 means an authentication error (401). The source says not to retry on exit code 2.
How do I install alpaca-cli?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is alpaca-cli free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is alpaca-cli safe to use?
It scores 74 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to alpaca-cli?
Similar skills: meme-rush, okx-market, saas-metrics-coach, sec-edgar.
