Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

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.

  • Score 74
  • 216 stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

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-cli

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install alpaca-cli in Claude Code

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

A

No 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 →

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.

alpaca-cli Install

Add to stack

Loading.