CLI and local MCP server for the OpenCosmo platform
Project description
OpenCosmo Portal CLI (ocp)
Command-line interface and local MCP server for the OpenCosmo platform. Query cosmological simulation datasets at DOE Leadership Computing Facilities from your terminal.
Installation
pip install opencosmo-portal
Or for development:
cd cli
uv sync
Quick Start
The default profile points to http://localhost:8000 (local development).
For development against a local backend:
# Authenticate via browser (Globus OAuth)
ocp auth login
# Browse available tasks
ocp task list
ocp task info <slug>
# Submit a task and monitor the run
ocp task run <slug>
ocp run status <run-id> --watch
ocp run results <run-id>
Commands
ocp auth — Authentication
| Command | Description |
|---|---|
ocp auth login |
Authenticate via browser (Globus OAuth) |
ocp auth logout |
Clear stored tokens |
ocp auth status |
Show token status and expiry |
ocp config — Profile Management
| Command | Description |
|---|---|
ocp config list |
List all profiles |
ocp config add-profile <name> <url> |
Add or update a profile |
ocp config set-profile <name> |
Set default profile |
ocp config remove-profile <name> |
Delete a profile |
ocp config show [name] |
Show profile details |
ocp task — Tasks
| Command | Description |
|---|---|
ocp task list |
List available tasks |
ocp task info <slug> |
Show task details and input parameters |
ocp task run <slug> |
Submit a task (interactive or --input) |
ocp run — Runs
| Command | Description |
|---|---|
ocp run list |
List your runs |
ocp run status <id> [--watch] |
Check run status |
ocp run logs <id> |
View run logs |
ocp run results <id> |
Download results |
ocp run cancel <id> |
Cancel a run |
ocp run archive <id> |
Archive a run |
ocp whoami — User
Show current user info.
ocp mcp — MCP Server
Start a local stdio MCP server for AI assistants like Claude Desktop.
ocp mcp start
Configure in Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"opencosmo": {
"command": "ocp",
"args": ["mcp", "start"]
}
}
}
Global Options
| Option | Description |
|---|---|
--profile, -p |
Use a specific profile |
--format, -f |
Output format: table (default) or json |
--version |
Show version |
--help |
Show help for any command |
Releasing
The CLI is published to PyPI as opencosmo-portal via GitHub Actions (trusted publisher / OIDC).
Automated (recommended)
Use the Release CLI workflow in GitHub Actions:
- Go to Actions → Release CLI → Run workflow
- Select the bump type (
patch,minor, ormajor) - The workflow bumps
cli/pyproject.toml, commits, tags, and pushes — which triggers the publish workflow automatically
Manual
- Bump
versionincli/pyproject.toml(or runcd cli && uv version --bump patch) - Commit:
git commit -am "release: CLI v0.2.0" - Tag:
git tag cli-v0.2.0 - Push both:
git push origin main cli-v0.2.0
The publish-cli.yml workflow will:
- Run the full test suite
- Verify the tag version matches
pyproject.toml - Build and publish to PyPI
First-time setup
Register a trusted publisher on pypi.org:
| Field | Value |
|---|---|
| Package name | opencosmo-portal |
| Owner | ArgonneCPAC |
| Repository | OpenCosmoPortal |
| Workflow | publish-cli.yml |
| Environment | pypi |
Then create a pypi environment in GitHub repo settings → Environments.
Configuration
Config and tokens are stored in ~/.opencosmo/:
~/.opencosmo/
├── config.json # Profiles (name → API URL)
└── tokens/
└── <profile>.json # OAuth tokens per profile
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opencosmo_portal-0.1.1.tar.gz.
File metadata
- Download URL: opencosmo_portal-0.1.1.tar.gz
- Upload date:
- Size: 85.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7f083b6bd4ac3a3f3808bc89971a6d002f27a68a6e6ea692175afade37d54cf
|
|
| MD5 |
4664217092d8e6b2cfaa621603c1d068
|
|
| BLAKE2b-256 |
c9a9fa63a90632aa01395cacfe99a38b4b7afcdc7b8404240c216acdb058f50c
|
Provenance
The following attestation bundles were made for opencosmo_portal-0.1.1.tar.gz:
Publisher:
publish-cli.yml on ArgonneCPAC/OpenCosmoPortal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opencosmo_portal-0.1.1.tar.gz -
Subject digest:
a7f083b6bd4ac3a3f3808bc89971a6d002f27a68a6e6ea692175afade37d54cf - Sigstore transparency entry: 1009613604
- Sigstore integration time:
-
Permalink:
ArgonneCPAC/OpenCosmoPortal@8c5d4bc2555570cb0fcdcf210b94cb7eaee46710 -
Branch / Tag:
refs/tags/cli-v0.1.1 - Owner: https://github.com/ArgonneCPAC
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-cli.yml@8c5d4bc2555570cb0fcdcf210b94cb7eaee46710 -
Trigger Event:
push
-
Statement type:
File details
Details for the file opencosmo_portal-0.1.1-py3-none-any.whl.
File metadata
- Download URL: opencosmo_portal-0.1.1-py3-none-any.whl
- Upload date:
- Size: 38.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02c146ad63e46367744045d5ea050fbc8c11b8937793ab6bd69cb09570fb65eb
|
|
| MD5 |
c3dd8d88809fb5ee291ca6f4d6106e21
|
|
| BLAKE2b-256 |
665a1c73f499138615c946e8bc9311c91ab367dfa47343bc3deab159aec4e3ca
|
Provenance
The following attestation bundles were made for opencosmo_portal-0.1.1-py3-none-any.whl:
Publisher:
publish-cli.yml on ArgonneCPAC/OpenCosmoPortal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opencosmo_portal-0.1.1-py3-none-any.whl -
Subject digest:
02c146ad63e46367744045d5ea050fbc8c11b8937793ab6bd69cb09570fb65eb - Sigstore transparency entry: 1009613607
- Sigstore integration time:
-
Permalink:
ArgonneCPAC/OpenCosmoPortal@8c5d4bc2555570cb0fcdcf210b94cb7eaee46710 -
Branch / Tag:
refs/tags/cli-v0.1.1 - Owner: https://github.com/ArgonneCPAC
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-cli.yml@8c5d4bc2555570cb0fcdcf210b94cb7eaee46710 -
Trigger Event:
push
-
Statement type: