codex-keysmith  by Jia-Ethan

Safely manage Codex CLI local instruction files

Created 2 weeks ago

New!

457 stars

Top 65.3% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

This repository provides codex-keysmith, a Python CLI utility designed to safely install local Markdown instruction files for the Codex CLI. It targets users experimenting with custom instructions, offering an automated and secure workflow that prevents accidental data loss and unauthorized modifications. The tool simplifies the process of updating the model_instructions_file configuration and managing associated files.

How It Works

codex-keysmith operates as a single Python script that interacts with the Codex CLI's configuration directory (defaulting to ~/.codex). When executed, it copies a specified local Markdown instruction file into the configuration directory, names it according to user input, and updates the config.toml file to point model_instructions_file to this new file. Crucially, it defaults to a preview-only mode (--dry-run) and requires explicit confirmation (--yes) before making any writes. It also implements automatic backups for both the config.toml and any pre-existing instruction files it overwrites, ensuring a robust rollback capability.

Quick Start & Requirements

  • Primary install/run command: python3 codex-instruct.py
  • Prerequisites: Python 3.x. Requires the Codex CLI to be installed.
  • Links:
    • Repository: https://github.com/Jia-Ethan/codex-keysmith
    • Community: LINUX DO Community (details not provided)

Highlighted Details

  • Safety First: Operates in preview mode by default; requires --yes for writes.
  • Automated Backups: Creates .bak_timestamp backups for config.toml and overwritten instruction files.
  • Secure File Handling: Validates --name arguments to prevent path traversal or writing outside the designated .codex directory.
  • Customization: Supports user-provided instruction files (--file) and custom output names (--name). Includes a default gpt5.5-unrestricted.md example.

Maintenance & Community

The project welcomes feedback from the "LINUX DO Community". No specific details on active maintainers, sponsorships, or formal community channels (like Discord/Slack) are provided in the README.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: The MIT license is permissive, generally allowing for commercial use and integration into closed-source projects without significant restrictions.

Limitations & Caveats

The tool is currently distributed as a standalone Python script, not a pip-installable package. It lacks dedicated restore or uninstall commands, necessitating manual rollback using generated backups. The configuration management is limited to the global model_instructions_file setting, without support for profile isolation. TOML modifications are basic, targeting only top-level keys.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
457 stars in the last 14 days

Explore Similar Projects

Feedback? Help us improve.