Skip to main content

Rust authswap CLI with WebDAV sync and Codex app-server restart

Project description

authswap

authswap is a Rust command-line tool for switching local Codex auth profiles and optionally syncing those profiles through WebDAV.

The project is packaged for PyPI with maturin, but day-to-day development does not require building a wheel. Use Cargo directly while debugging.

Features

  • Interactive account picker for local Codex profiles.
  • Account add, switch, refresh, and delete actions inside the interactive UI.
  • WebDAV sync from the interactive UI.
  • Sanitized config.toml sync that excludes machine-local project sections.
  • PyPI wheel packaging for users who do not have Rust installed.

Commands

authswap

authswap reads and writes the standard Codex auth layout:

~/.codex/auth.json
~/.codex/config.toml
~/.codex/accounts/*.auth.json
~/.codex/accounts/registry.json

Install From PyPI

pip install authswap
authswap

Published wheels include the compiled authswap binary, so end users do not need Rust, Node.js, or npm when a compatible wheel is available.

Local Development

Build and run directly with Cargo:

cargo run --

Build the debug binary once, then run it directly:

cargo build
./target/debug/authswap

Install the local Rust binary without building a wheel:

cargo install --path .
authswap

Isolated Debugging

Use a temporary HOME and CODEX_HOME while testing so real Codex credentials are not modified:

mkdir -p /tmp/authswap-debug/.codex/accounts
HOME=/tmp/authswap-debug \
CODEX_HOME=/tmp/authswap-debug/.codex \
cargo run --

WebDAV Sync

Configure WebDAV sync with AUTHSWAP_* environment variables:

export AUTHSWAP_WEBDAV_URL="https://dav.example.com/authswap/"
export AUTHSWAP_WEBDAV_USERNAME="your-user"
export AUTHSWAP_WEBDAV_PASSWORD="your-password"

Bearer token authentication is also supported:

export AUTHSWAP_WEBDAV_URL="https://dav.example.com/authswap/"
export AUTHSWAP_WEBDAV_TOKEN="your-token"

Open WebDAV sync from the account picker by pressing w. If WebDAV is not configured, authswap opens a settings dialog for the URL, username, and password, then tests the connection before returning to the sync dialog. The sync dialog shows a green status dot when WebDAV is reachable and a red status dot otherwise.

The settings file is stored at ~/.codex/authswap.json with private file permissions. AUTHSWAP_* environment variables override saved WebDAV settings.

These files contain active credentials. Sync only to a trusted WebDAV server.

Usage Limits

The interactive account picker shows cached 5-hour and weekly limit usage from ~/.codex/accounts/registry.json. Press r on the selected account to request fresh usage from Codex and update the local cache.

Limit columns show the remaining percentage and the remaining time until reset, for example 28% 1h 20m.

Press s in the account picker to configure whether authswap restarts codex app-server after switching accounts. The setting is off by default and is saved in ~/.codex/authswap.json.

Build Wheels

Wheel builds are for packaging and release:

pip install maturin
maturin build --release

The Python package uses maturin with bindings = "bin" to ship the Rust CLI as a binary application.

Publish to PyPI

GitHub Actions builds release artifacts with maturin for Linux, macOS, and Windows, then publishes them to PyPI when a version tag is pushed. The wheel matrix includes x86/x86_64 and ARM targets:

  • Linux: x86_64, i686, aarch64, armv7
  • macOS: aarch64
  • Windows: x86_64, i686, aarch64
git tag v1.0.0
git push origin v1.0.0

Before the first release, configure PyPI trusted publishing for this repository:

  • PyPI project: authswap
  • Owner: shevekwang
  • Repository: authswap
  • Workflow: rust-pypi-wheels.yml
  • Environment: pypi

Manual workflow runs build and upload artifacts in GitHub Actions, but they do not publish to PyPI unless the run is for a tag.

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

authswap-1.0.0.tar.gz (51.8 kB view details)

Uploaded Source

Built Distributions

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

authswap-1.0.0-py3-none-win_arm64.whl (2.1 MB view details)

Uploaded Python 3Windows ARM64

authswap-1.0.0-py3-none-win_amd64.whl (2.2 MB view details)

Uploaded Python 3Windows x86-64

authswap-1.0.0-py3-none-win32.whl (1.9 MB view details)

Uploaded Python 3Windows x86

authswap-1.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

authswap-1.0.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (2.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

authswap-1.0.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

authswap-1.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

authswap-1.0.0-py3-none-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file authswap-1.0.0.tar.gz.

File metadata

  • Download URL: authswap-1.0.0.tar.gz
  • Upload date:
  • Size: 51.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for authswap-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fbffeed2b3c0559dc4b90a16c930760057bce5dcebe6fe6477f3383658bc9111
MD5 b0a9dbbe0c2b92609a7c03926d9b368c
BLAKE2b-256 df17540fff7da1d98ad09bfed5c174c803a3f3781e7ec6d9a78e7d492869f7ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for authswap-1.0.0.tar.gz:

Publisher: rust-pypi-wheels.yml on shevekwang/authswap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file authswap-1.0.0-py3-none-win_arm64.whl.

File metadata

  • Download URL: authswap-1.0.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for authswap-1.0.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 a785f952cd1f2239885713991bb4d1521403fb3e30e419e9e25aba0bccd71d31
MD5 514ea66ace22270e7d682c8cb30a43ac
BLAKE2b-256 e0d553982955c17c9547583705c7f7116997db62342278ad15ef2970351aa4ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for authswap-1.0.0-py3-none-win_arm64.whl:

Publisher: rust-pypi-wheels.yml on shevekwang/authswap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file authswap-1.0.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: authswap-1.0.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for authswap-1.0.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 82a9e8819061f0c9d863718b204acd15a74ad4a03d113001bebce262478479da
MD5 04a9705230175009929f09c2bc0dcc87
BLAKE2b-256 5b1282a0257af06ec4aecadadbdaeeffc8089ab70f94f55ec0b2e229594a6180

See more details on using hashes here.

Provenance

The following attestation bundles were made for authswap-1.0.0-py3-none-win_amd64.whl:

Publisher: rust-pypi-wheels.yml on shevekwang/authswap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file authswap-1.0.0-py3-none-win32.whl.

File metadata

  • Download URL: authswap-1.0.0-py3-none-win32.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for authswap-1.0.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 39153a02e7579856d6056e5d709e45779f28eb4da53d2bdb9bab11f14709d19a
MD5 78d47656a9d466ca7da7fbad1e9bcceb
BLAKE2b-256 05c9226db46cf5ec5fc1b9660da846af82cab8982dfe68a48fd58c18235ccc5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for authswap-1.0.0-py3-none-win32.whl:

Publisher: rust-pypi-wheels.yml on shevekwang/authswap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file authswap-1.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for authswap-1.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 20133220c297172891621e9e39a8fbe2973f39601ac7da5c1b56ee108c00007e
MD5 451565297043e6a1f39066b7363b6d0c
BLAKE2b-256 19e6df7b5fa48316dd423d54343cb807a2d16531bda4598f9820c80ca6430930

See more details on using hashes here.

Provenance

The following attestation bundles were made for authswap-1.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: rust-pypi-wheels.yml on shevekwang/authswap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file authswap-1.0.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for authswap-1.0.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 7ee6acbcaba86e595e3caec0d4912b4cd5bd792a4b80cc1545f096fc7f5a5e0c
MD5 ef61d4f1f117337ac7dad63afeb6fe49
BLAKE2b-256 fcdd32102f851f13aef858f0a954e5cd380ccd0d9142039379158e76323b04fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for authswap-1.0.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: rust-pypi-wheels.yml on shevekwang/authswap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file authswap-1.0.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for authswap-1.0.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 cf58643e00512df91223ae4b0c2049d42373acc9378a6078dbae948bbbb3545e
MD5 0caf18e35ead53b2a4cfbc3e7fbbb245
BLAKE2b-256 cfd12141ddf8c7821cd6e1d0db09d334dc4c82605bca830f3b02fa539a0a9c77

See more details on using hashes here.

Provenance

The following attestation bundles were made for authswap-1.0.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl:

Publisher: rust-pypi-wheels.yml on shevekwang/authswap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file authswap-1.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for authswap-1.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5b75ec4b8bb7c32a0495c2b1399a6d1d9f8f41af71d510fe96df12fd94f43c71
MD5 e5fab90f5d1627226a40f456105c0dd5
BLAKE2b-256 26a710fbadef6c60bf1b66d8599a957f30d00d3004e0e0d02a8058c158e77e69

See more details on using hashes here.

Provenance

The following attestation bundles were made for authswap-1.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: rust-pypi-wheels.yml on shevekwang/authswap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file authswap-1.0.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for authswap-1.0.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1670c28da3a6aed8bf38da30c28a6196f1c48a485e0d7384ceafaf9c9df5e99e
MD5 78052fe7512f171f81bb47749e7d98b3
BLAKE2b-256 ca9c8631c321982a28250e2fde2666c991254a6ac7abe0e993921045d28823df

See more details on using hashes here.

Provenance

The following attestation bundles were made for authswap-1.0.0-py3-none-macosx_11_0_arm64.whl:

Publisher: rust-pypi-wheels.yml on shevekwang/authswap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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