Skip to main content
Use fcontext from your terminal to query Financial Context market data, manage sign-in, and produce JSON output for scripts or agents. The CLI talks to Financial Context by default:
Commands call read-only market-data endpoints under /api/market-data/*. The current CLI focuses on US stock data: symbols must use the CODE.US format, and market filters must be US.

Command Basics

Use either command name. fctx is the short alias for fcontext and supports the same subcommands, flags, output formats, and schemas.

Install

Install the fcontext-cli cask from the Aitaport tap:
Release artifacts use the fcontext-cli-* package names, including fcontext-cli-darwin-amd64.tar.gz, fcontext-cli-darwin-arm64.tar.gz, fcontext-cli-linux-musl-amd64.tar.gz, fcontext-cli-linux-musl-arm64.tar.gz, and fcontext-cli-windows-amd64.zip. The shell and PowerShell installers download the matching archive, verify its .sha256 checksum, and install both fcontext and fctx. Legacy hosted /fcontext/fcontext-terminal/* installer URLs continue to redirect or mirror the latest release for compatibility.

Authenticate

Manage CLI authentication: sign in, sign out, and inspect the local token status.

OAuth 2.0 Login

Use the OAuth 2.0 authorization-code flow to sign in. This works in local terminals, SSH sessions, and headless servers because the CLI prints the authorization URL and the next command to run.
Open the printed authorization URL in any browser, complete authorization, then copy the returned code and redeem it:
The CLI stores the token as oauth-token.json in the local fcontext config directory. Later commands reuse that token automatically.

Authorization Code

If no browser is available on the current machine, generate a one-time authorization code from Financial Context Connect and redeem it directly:

Auth Logout

Clear the locally stored OAuth token. The next authenticated command will require a new login.

Auth Status

Inspect the current base URL and sign-in status.

Check

Validate sign-in and Financial Context API connectivity without relying on an active market session. The report includes endpoint status and latency.

Update

Download and run the official installer script to replace the current CLI binary with the latest release.

First Commands

Market Data

Use fear-greed to inspect the Fear & Greed Index, a market-sentiment indicator that summarizes investor appetite for risk on a scale from extreme fear to extreme greed:

Company Data

News And Events

Trading Activity

Screeners

Direct Endpoint Access

Use api get when you need a supported read-only endpoint before a dedicated command exists:
The CLI rejects absolute URLs, streaming endpoints, non-US market filters, and unsupported account or trading paths before sending a request.

Output For Agents

Every command supports JSON output:
Use --schema to print a machine-readable response schema:
Generate shell completions:

Troubleshooting