Asi osf-datasets
Access Open Science Framework (OSF) datasets via CLI using osfclient and the OSF v2 API. Load when downloading research datasets, searching public OSF projects, or uploading data to OSF repositories.
install
source · Clone the upstream repo
git clone https://github.com/plurigrid/asi
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/plurigrid/asi "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/osf-datasets" ~/.claude/skills/plurigrid-asi-osf-datasets && rm -rf "$T"
manifest:
skills/osf-datasets/SKILL.mdsource content
OSF Datasets
Setup
pip install osfclient
Authentication
# Option A: Personal Access Token (preferred) -- generate at osf.io/settings/tokens export OSF_TOKEN=<pat> # Option B: credentials export OSF_USERNAME=user@example.com export OSF_PASSWORD=pass
Or per-directory
.osfcli.config:
[osf] username = user@example.com project = abc12
Project ID
The 5-character alphanumeric slug from any
osf.io/<id> URL. Example: osf.io/abc12 -> project ID is abc12.
Core Commands
| Command | Purpose |
|---|---|
| List all files |
| Download entire project |
| Download single file |
| Upload file |
| Get web URL |
Remote paths are prefixed with the storage provider, typically
osfstorage/.
Direct API Access
Base URL:
https://api.osf.io/v2/
Use
--globoff with curl -- OSF query params use [] which curl interprets as glob ranges.
# List project files curl -sL --globoff "https://api.osf.io/v2/nodes/<id>/files/osfstorage/" | jq '.data[].attributes.name' # Get project metadata curl -sL --globoff "https://api.osf.io/v2/nodes/<id>/" | jq '.data.attributes' # Search public nodes by title curl -sL --globoff "https://api.osf.io/v2/nodes/?filter[title]=keyword&page[size]=20" | jq '.data[] | {id, title: .attributes.title}' # Browse subfolder (use folder ID from parent listing) curl -sL --globoff "https://api.osf.io/v2/nodes/<id>/files/osfstorage/<folder_id>/" | jq '.data[].attributes.name' # With auth curl -sL --globoff -H "Authorization: Bearer $OSF_TOKEN" "https://api.osf.io/v2/nodes/<id>/files/osfstorage/"
File download links are in
data[].links.download -- follow redirects with curl -L -o.
Helper Scripts
-- search public OSF projects by keywordscripts/osf-search.sh <keyword> [page_size]
-- browse project files via API (no osfclient needed)scripts/osf-browse.sh <project_id> [path]
Guidelines
- Public projects need no auth; private ones require
or credentialsOSF_TOKEN
mirrors the remote directory structure locallyclone
requires both remote and local path argumentsfetch- The API paginates at 10 items by default; use
for larger listings?page[size]=100 - Rate limits apply -- add brief sleeps for batch operations