Command Line Interface

Foundry includes a CLI for terminal-based workflows.

Basic Usage

foundry --help

Commands

Search Datasets

# Search by keyword
foundry search "band gap"

# Limit results
foundry search "band gap" --limit 10

# JSON output (for scripting)
foundry search "band gap" --json

Get Dataset Info

# Get info by DOI
foundry get 10.18126/abc123

# JSON output
foundry get 10.18126/abc123 --json

View Schema

See what fields a dataset contains:

Output:

List All Datasets

Check Publication Status

Version

HuggingFace Export

Export a Foundry dataset to HuggingFace Hub:

Options:

  • --repo - HuggingFace repository ID (required)

  • --token - HuggingFace API token (or set HF_TOKEN env var)

  • --private - Create a private repository

MCP Server

Start the MCP server for AI agent integration:

See MCP Server for details.

JSON Output

Most commands support --json for machine-readable output:

Exit Codes

Code
Meaning

0

Success

1

Error (see message)

Environment Variables

Variable
Purpose

HF_TOKEN

HuggingFace API token

GLOBUS_TOKEN

Globus authentication

Examples

Find and Download a Dataset

Export to HuggingFace

Scripting with JSON

Last updated

Was this helpful?