Skip to main content

cytario-cli

CLI for working with Cytario storage connections as the signed-in user — designed for AI agents and analysts who need to work with connection data using the workstation's standard AWS tooling.

What it does

  • cytario auth login --host <url> — browser sign-in (OAuth 2.0 Authorization Code + PKCE against the deployment's identity service; a loopback redirect receives the result). The refresh grant is stored user-private (~/.config/cytario/cli, 0600).
  • cytario connections list [--json] — the connections visible to you, with the storage role and access level your grant resolves to.
  • cytario connections setup [--all | <name>] — writes one AWS CLI profile per connection into ~/.aws/config ([profile cytario-<org>-<name>]) with web_identity_token_file, so aws / boto3 / pandas perform AssumeRoleWithWebIdentity themselves — with exactly your grant's authorization, never wider. RustFS-backed connections additionally get endpoint_url (federation and data calls both go to the provider's own S3-compatible endpoint) and a placeholder role_arn — RustFS has no role ARNs; the entitlement is your Cytario grant, mapped from the OIDC token. Public (credential-less) connections are skipped — no profile can express anonymous reads; rclone setup covers them. Connections are listed across all your organizations; the org qualifier in the profile name keeps same-named connections from different orgs distinct (single-org setups are unaffected).
  • cytario rclone setup [--all | <name>] — writes one rclone remote per connection ([cytario-<org>-<name>], env_auth = true + profile, no credentials stored) into the rclone config, refreshing the AWS profile it federates through, and prints a ready-to-run mount command for your OS — so the bucket can be mounted locally with rclone mount/nfsmount and browsed as a local folder (Linux/macOS) or drive letter (Windows, needs WinFsp). A public (credential-less) connection gets an anonymous remote instead (blank credentials, rclone's documented public-bucket shape): listing and copying work, uploading is impossible — matching the read-only grant.
  • cytario auth status [--json] — the signed-in host, user (Keycloak sub, email, name), and token state; --json emits it machine-readable (agents need the sub to address per-user files such as settings.<sub>.json view presets).
  • cytario image describe s3://<bucket>/<key> — an image's metadata and per-channel contrast limits as JSON, computed by the web app's real viewer code: opens the /agent/describe route in the browser under your signed-in session and receives the result on a loopback redirect. Requires a cytario-web deployment that ships the route.
  • cytario auth token / cytario auth refresh — a fresh ID token on stdout, and a rewrite of all managed token files (tokens live ~1 hour).

Agents: see the packaged skill file (src/cytario_cli/skills/cytario-cli.md) for the tool-neutral agent workflow shipped with this repo — what Cytario is, how its data (annotations, view settings, results, job configs) is laid out in your buckets, and the CLI workflow on top.

Installing the skill

The skill file ships inside the PyPI package and is installed for your AI tooling with one command (no network fetch — the copy always matches the installed CLI version):

cytario skill install

The command probes the config directories of common AI tools (Claude Code, OpenCode, Cursor, Codex CLI) and writes the skill where each tool discovers it: <skills>/cytario-cli/SKILL.md for Claude Code, OpenCode, and Codex CLI (per-skill directory convention), a flat rule file for Cursor. Re-running it after a CLI update refreshes stale copies (a locally modified copy is never overwritten without --force). Useful variations:

cytario skill list --json   # what is detected, and the install state
cytario skill install --tool claude-code
cytario skill install --path ~/.my-agent/skills

For tools without a skills mechanism, paste the file's contents into your agent's system prompt or project instructions — the file is self-contained (cytario skill install --path <dir> writes it anywhere).

Install

uv tool install cytario-cli   # or: pip install cytario-cli

Python ≥ 3.10. The CLI is a public OIDC client — no secrets are shipped or stored beyond your own refresh grant.

Usage

cytario auth login --host https://app.cytario.com
cytario connections list
cytario connections setup --all
cytario rclone setup --all
cytario image describe s3://mybucket/prefix/slide.ome.tif
aws s3 ls --profile cytario-<org>-<slug>
# mount a connection locally (command printed by `cytario rclone setup`):
rclone mount cytario-<org>-<slug>:<bucket> ~/mnt/<org>-<slug> --vfs-cache-mode writes --daemon

Host resolution order: --host, then CYTARIO_HOST, then the last signed-in host. The host is the cytario web app (e.g. https://app.cytario.com) — not the identity host (https://auth.cytario.com); the CLI derives the identity endpoints from it automatically.

Security model

  • Your authorization is exactly your Cytario grant on each connection (read-only / annotate / read-write / admin); bucket sharing stays confined to the web app.
  • No long-lived AWS keys are written; the AWS CLI federates per operation from the token file, and the CLI refreshes tokens before expiry.
  • Revocation: revoking the CLI session in the identity service (or removing your group membership) ends the CLI's access within one token lifetime.

Development

uv sync
uv run ruff format --check && uv run ruff check
uv run pytest

Releases are cut by python-semantic-release on Conventional Commits and published to PyPI via trusted publishing.

License

MIT — see LICENSE.

Metadata

Release files for cytario-cli 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cytario-cli 2.0.0
File Size Uploaded Provenance Actions
cytario_cli-2.0.0.tar.gz 114.3 kB With provenance Details for cytario_cli-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cytario-cli 2.0.0
File Interpreter ABI Platform Actions
cytario_cli-2.0.0-py3-none-any.whl Python 3 none any Details for cytario_cli-2.0.0-py3-none-any.whl

Total release size: 153.7 kB

Release files / cytario_cli-2.0.0.tar.gz

Download URL cytario_cli-2.0.0.tar.gz
Size 114.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d4fa5168c1f2c010680444f1a41c87605884f30023dcb5d772569515de449241
BLAKE2b-256 checksum
How to use checksums
3a6bc6fd813ea8b3387043a463ac800b658e15acf4b1891f2e88e58c935f57b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / cytario_cli-2.0.0-py3-none-any.whl

Download URL cytario_cli-2.0.0-py3-none-any.whl
Size 39.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
662d9ccf7c7c74c0ba7c0d75e89f9860d55108508d4ef7fabe8ece10538a6eb1
BLAKE2b-256 checksum
How to use checksums
39261e10b47f4b029cde031ec9662bafdb9eaae25dfb972c19ca9d90eba36a1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for cytario-cli 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cytario_cli-2.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page