Skip to main content

Context Platform CLI

Project description

Context Platform CLI

Typer-powered command-line interface for managing Context Platform projects and items.

Installation

From the repo root (uv workspace):

uv sync --all-extras --all-groups

ctxme will then be available via uv run ctxme ... (or activate .venv and call directly).

Configuration

The CLI stores settings under the platform-specific config directory (see platformdirs). Override the path in scripts/tests with the CTXME_CONFIG_DIR environment variable.

Key commands:

  • ctxme config --api <url> – set the backend API base URL (switches to live mode)
  • ctxme config --mode mock|live – toggle between the built-in mock client and HTTP client
  • ctxme set-project <project> – set the default project key
  • ctxme auth login – device flow sign-in (opens browser, stores API key in keychain)
  • ctxme auth status – show stored API key prefix + backend metadata
  • ctxme auth set-key <key> – manually persist API keys using the OS keychain
  • ctxme auth logout – remove stored API key

API keys are never written to disk; only stored through keyring.

Commands

  • ctxme ls – list items for the default (set-project) or --project project
  • ctxme get <item> – download an item to the current directory (use --stdout to print)
  • ctxme put <item> --data "<text>" – create or update an item (--title, --tag optional)
  • ctxme remove <item> – delete an item (use --force to skip confirmation)
  • ctxme projects list / ctxme projects ls – list available projects
  • ctxme projects current – show the current default project (local only)
  • ctxme set-project <project> – set the default project key
  • ctxme status – show local config + auth status (no API call)

All commands emit Rich-formatted tables/panels with user-friendly messaging. When ctxme get saves to a directory, it sanitizes item keys into safe filenames (no path separators or ..).

Tests

uv run pytest cli/tests

Tests cover configuration round-trips, keyring helpers (via an in-memory backend), and representative Typer command flows.

Shell Completion

Enable tab completion for commands, subcommands, and flags.

Installation

Bash:

ctxme --install-completion bash

Zsh:

ctxme --install-completion zsh

Fish:

ctxme --install-completion fish

PowerShell:

ctxme --install-completion powershell

Usage

ctxme <TAB>        # Shows: auth, config, get, ls, put, ...
ctxme auth <TAB>   # Shows: login, logout, status, set-key
ctxme get --<TAB>  # Shows: --project, --dest, --stdout, --force, ...

Troubleshooting

  • Restart shell after installation
  • Ensure completion script is sourced in shell config
  • Check ctxme --show-completion <shell> for manual setup

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ctxme-0.1.1.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ctxme-0.1.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file ctxme-0.1.1.tar.gz.

File metadata

  • Download URL: ctxme-0.1.1.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for ctxme-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cf48e36c7392d02f15aaf5a195778640e0fc5d1c838ee42c48bff2e0cd9fc00a
MD5 4a64921ec3d07f285de07c065a981366
BLAKE2b-256 cc57b5785638e8f7d8c984ee9833f5c4f4057d5c9cd4932b273e7c149b38bc1c

See more details on using hashes here.

File details

Details for the file ctxme-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ctxme-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for ctxme-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f83eb8ce0360601dc4c84c06ad754e5c563a09d9cfb073a1933d07f6f4fe42d
MD5 505d7d080f8926d9b55f0e58c0e5fca0
BLAKE2b-256 f945b8b1ece59f9c17741af9b32da9d2e1b5dfe3a8728965c8f0fd9b9f8e3490

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page