cosmo
Sign in to Cosmo once. The Cosmo SDKs — Python, TypeScript, Swift — pick up the credential from disk, so an app you run locally needs no key in its source, its environment, or its config.
cosmo login # opens your browser; pick a workspace
cosmo whoami # who you are and where
cosmo logout # revoke the stored key and remove it from this machine
cosmo version
There is no session and nothing running in the background. cosmo login
mints a workspace API key, writes it to ~/.cosmo/credentials, and exits.
Every later read is a file read. The key expires, and you sign in again.
cosmo logout is a revocation, not just a file delete: it retires the key
server-side (against the backend the profile names), then removes the
profile — other profiles, and anything another tool wrote, are preserved.
If the server can't be reached the credentials are left in place, so a live
key is never forgotten locally while it still works.
The credentials file
~/.cosmo/credentials, mode 0600:
version = 1
[default]
slug = "acme"
api_key = "cosmo_..."
api_key_id = "8d1f1f16-0f5e-4a1a-9a1b-2c3d4e5f6a7b"
base_url = "https://platform.askcosmo.ai"
expires_at = "2026-11-01T20:11:39Z"
Each table is a profile. default is used unless COSMO_PROFILE or
--profile says otherwise — the environment variable matters because the SDKs
read this file from inside your own process, where a CLI flag cannot reach
them.
This file is a contract, not an implementation detail — several SDKs read it,
so the shape is pinned by tests in tests/test_credentials.py.
versionis file-level. A reader checks it once and then knows how to interpret every profile. A file from a newer CLI is refused rather than guessed at.- Profiles are named credential sets.
defaultis used unless a caller asks for another. A writer preserves profiles it does not recognise, so one SDK cannot drop another's data. base_urlis an origin with no path. SDKs append their own API paths; a stored/apisuffix would double up.
If another tool already owns a profile name and keys it differently, the
file is copied to credentials.bak (.bak.1, .bak.2, …) before that
profile is replaced, so nothing is overwritten without a copy.
Override the location with COSMO_CREDENTIALS_FILE — useful for tests and for
keeping work and personal credentials apart.
Install
pipx install cosmo-cli
Or into any Python 3.11+ environment: pip install cosmo-cli.
Development
python -m venv .venv && .venv/bin/pip install -e ".[dev]"
.venv/bin/pytest
.venv/bin/pyright
Runtime dependencies are click and tomli-w — both pure Python, neither
with transitive dependencies of its own. A Homebrew formula needs a resource
block per transitive dependency, so each addition is recurring packaging work,
and a compiled one drags a build toolchain into the formula. For scale: typer
- rich would be 8 blocks, and pydantic ships a Rust extension.
Reading TOML is stdlib (tomllib); only writing it is not.
Release files for cosmo-cli 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cosmo_cli-0.1.1.tar.gz | 25.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cosmo_cli-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 54.3 kB
Release files / cosmo_cli-0.1.1.tar.gz
| Download URL | cosmo_cli-0.1.1.tar.gz |
|---|---|
| Size | 25.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
259fd343bf31f52dfbc98b5640b0cea1680e170f06483132909bad0926bc33de
|
|
BLAKE2b-256 checksum How to use checksums |
c6078e4204fff8c41eb5ae70aad3d67099aa367d4fc5bb1f5118cdb08a10eb45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 6, 2026.
Transparency logRelease files / cosmo_cli-0.1.1-py3-none-any.whl
| Download URL | cosmo_cli-0.1.1-py3-none-any.whl |
|---|---|
| Size | 28.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3fc73dbb298fb729440821efecb6654e6ede72c0895b0c63f9487cc72e105ede
|
|
BLAKE2b-256 checksum How to use checksums |
ab6e60479d4d0229d49f0dc78b76b66e23f2a1513b71e98d2d2d855bacecc92f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 6, 2026.
Transparency log