Skip to main content

kubectx-like CLI for switching Codex auth profiles

Project description

agentctx

agentctx is a kubectx-like CLI for saving and switching local Codex auth profiles.

It manages copies of ~/.codex/auth.json under ~/.agentctx and atomically swaps the active auth file when you switch profiles. Token contents are never printed.

Install

pipx install agentctx

For local development:

poetry install
poetry run agentctx --help

Usage

agentctx                 # list profiles or open fzf selector when interactive
agentctx work            # switch to profile
agentctx -               # switch to previous profile
agentctx -c              # show current profile
agentctx work=.          # save current Codex auth as profile, or rename current profile
agentctx prod=work       # rename profile
agentctx -d old-profile  # delete profile
agentctx -u              # unset current marker
agentctx -V              # show version

Long aliases:

agentctx --current
agentctx --unset
agentctx --version

CRUD-style subcommands are intentionally not part of the public CLI.

Storage

~/.agentctx/
  profiles/
    <name>/
      auth.json
      metadata.json
  backups/
    auth-<timestamp>.json
  current
  previous
  lock

Active Codex auth remains:

~/.codex/auth.json

Security behavior

  • validates JSON before saving or switching;
  • rejects symlinks and non-regular auth files;
  • writes auth files atomically with temporary files in the target directory;
  • uses 0600 permissions for active, profile, and backup auth files where supported;
  • creates backups before switching profiles;
  • never prints token contents.

Development

poetry check
poetry run pytest
poetry build

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

agentctx-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

agentctx-0.1.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file agentctx-0.1.0.tar.gz.

File metadata

  • Download URL: agentctx-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.14.3 Darwin/24.1.0

File hashes

Hashes for agentctx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 051e2990a09416b684b45beaaa7796955270acc7e87f54c8e671bb93081186a8
MD5 da953353913722d6b40d329cbc4ccf16
BLAKE2b-256 ccc0839aa777c3077e918de38f3698605c52eb51d0fbc68563178d5927fb470a

See more details on using hashes here.

File details

Details for the file agentctx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agentctx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.14.3 Darwin/24.1.0

File hashes

Hashes for agentctx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 995b7d7e25802308e1dd1762c0a42f1cb2f67b0f897d00488344a4b403dd3949
MD5 94f8740f3dbcc333a9c4979589a0618a
BLAKE2b-256 1a333db855f0a2ee97877a654d78046f4e6a2f72c2f7d7d0310333460c83cb86

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