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.2.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.2-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ctxme-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 09ab281092b8e86c9579aaf14285e73c13f33dee6dda8c2b5802121b0a5e908b
MD5 b81f9b01096c04a863bebddbffe76256
BLAKE2b-256 a8481133d428f81eb816d50f62383c1926601f391ae2dea8cdcceb3e92e0bd4f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ctxme-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d0a6857a49aeeb7f059ac78e2d29e942c5fa4ad54592ecc33cefe27407bdb2f8
MD5 743f4ea73f925bd90503f2c543a4c9f3
BLAKE2b-256 48d503397e5a0dc6836cc7ea2c2eaafef331fbbaee8d0f84c8a185da9ad013f9

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