SDK & CLI Overview
Use SkyPortal from Python applications, automation scripts, and interactive terminal workflows with the open-source SDK and CLIs.
Requirements
- Python 3.11+ is required.
- The
skyportalaiproject is currently alpha (pre-1.0). - Source repository: github.com/SkyportalAi/skyportalai
Interfaces
| Interface | Command/import | Best for |
|---|---|---|
| Python SDK | from skyportalai import Skyportal |
Applications, internal tools, and Python automation |
| Automation CLI | skyportalai |
Scripts, CI/CD, and stable JSON output |
| Interactive terminal | skyportal |
Persistent human-driven chats and approval prompts |
The agent executes server-side. SDK and CLI operations create chats, poll status, retrieve messages, and submit explicit approval decisions.
Install
With Poetry:
From a local clone:
Optional local observability agent:
Note
The SDK and both CLI commands are in the base package. There is no separate cli extra.
Authentication
Set a credential before using the SDK or automation CLI:
Or use interactive login:
Saved credentials are stored in ~/.skyportal/credentials.json with user-only permissions on POSIX systems.
Credential safety
Never place real API keys, tokens, approval IDs, hosts, or private infrastructure details in code, logs, screenshots, issues, or docs.
Choose the right interface
Use skyportalai for programmatic and script-safe output:
Use skyportal for human-in-the-loop interactive workflows:
Use the Python SDK for application-level integration:
Configuration precedence
Automation CLI (skyportalai)
Base URL precedence:
- Root
--base-urloption SKYPORTAL_BASE_URLSKYPORTAL_URLportal.base_urlin~/.skyportal/config.yaml- Deployment saved with
~/.skyportal/credentials.json https://app.skyportal.ai
Credential precedence:
SKYPORTAL_API_KEYSKYPORTAL_ACCESS_TOKENaccess_tokenin~/.skyportal/credentials.json
Path overrides:
| Variable | Purpose |
|---|---|
SKYPORTAL_CONFIG_PATH |
Override YAML config path |
SKYPORTAL_CREDENTIALS_PATH |
Override saved credentials path |
Example config:
Python SDK (Skyportal)
Automatically resolves only:
| Variable | Purpose |
|---|---|
SKYPORTAL_API_KEY |
API credential when api_key is omitted |
SKYPORTAL_BASE_URL |
API root when base_url is omitted |
SKYPORTAL_ALLOW_INSECURE=1 |
Allow trusted non-loopback HTTP target with warning |
The SDK does not automatically read CLI config or credentials files.