Project Status (as of 2025-04-16):
- All core features implemented, tested, and documented
- All tests pass (pytest, 159 tests)
- Code coverage: 81% (see plan.md for details)
- SessionHistory, config, and file operations are robust and fully covered by tests
- Documentation is up to date in plan.md and architecture_and_maintenance.md
- No outstanding bugs or failing tests
A Python Agentic Coding Assistant with CLI, supporting configuration management, model management, and secure shell/file operations.
This project adheres to a strict workflow discipline to ensure maintainability, reliability, and quality:
- Always keep documentation up to date with the latest changes and features.
- Always require and run tests for every change, no matter how small.
- Always commit and push changes after all tests have passed.
- CLI and interactive shell (Typer-based)
- Powerful configuration management (CLI, prompts, and config files)
- Model management (local and remote, flexible storage path selection)
- Secure shell and file operations with full audit trail
- User and session management with export and clear history
- Secure CLI/API key encryption and storage
- Third-party integrations (e.g., GitHub, Ollama, etc.) with token management
- YAML and JSON config support
- MCP server integration for advanced workflows
- Automated testing and high code coverage discipline
- Extensible plugin and integration architecture
-
Install dependencies:
pip install -r requirements.txt
-
Run the Coder-X CLI:
python app/main.py
-
Use the CLI:
python app/test_cli_new.py --help
Run all tests:
pytest
app/
— Main application codetests/
— Tests for all modulesplan.md
— Project plan and progressarchitecture_and_maintenance.md
— System architecture and maintenance docs
- Config is stored in JSON (default:
~/.coder_x_config.json
), validated and managed via a Pydantic V2 schema for safety and extensibility. - Model storage path defaults to
~/.coder_x_models
- All config options can be managed via robust CLI commands (
show
,set
,unset
,setup
), with all output as structured JSON for scripting and testability. - Comprehensive tests ensure config reliability and future extensibility.
- List, select, load, and unload models via CLI
- Dynamic loading/unloading of local LLMs using Ollama backend:
coder-x model load <model_name>
to download/pull a modelcoder-x model unload <model_name>
to remove a model
- Model storage volume can be listed and set at runtime:
coder-x model volumes
to list candidate storage locationscoder-x model set-volume <path>
to set Ollama model storage directory
- See
architecture_and_maintenance.md
for backend and config details
Variable | Default | Description |
---|---|---|
CODER_X_CONFIG |
~/.coder_x_config.json |
Path to the main JSON config file |
CODER_X_YAML_CONFIG |
~/.coder_x_config.yaml |
Path to YAML config file (if used) |
HOME |
System user home | Used for default config/model/history locations |
PYTHONPATH |
(set by tests) | Ensures correct module/package import |
CODER_X_CONFIG |
~/.coder_x_config.json |
Path to JSON config file |
CODER_X_HISTORY |
~/.coder_x_history.json |
Path to session history file |
CODER_X_KEY |
~/.coder_x_key.enc |
Encrypted CLI/API key file (see below). |
OLLAMA_MODELS_CMD |
ollama list |
Command to list Ollama models (if used) |
Coder-X now supports secure encryption of CLI/API keys using industry-standard cryptography:
- Encryption: Uses PBKDF2HMAC key derivation and Fernet (AES) authenticated encryption.
- Storage: Encrypted secrets are stored in a binary file (default:
~/.coder_x_key.enc
). - Passphrase: You must provide a passphrase (recommended: via environment variable or prompt) to encrypt/decrypt your secret.
How to Use:
- To save a new key: use the CLI or call
encrypt_secret()
fromapp/key_encryption.py
, then store the resulting salt and token. - To load a key: use
load_encrypted_secret()
anddecrypt_secret()
with your passphrase.
Security Notes:
- Your key is never stored in plain text.
- If you lose your passphrase, the encrypted key cannot be recovered—you must generate a new one.
- See
app/key_encryption.py
for code and usage examples.
Most environment variables are optional; defaults are used if unset.
For more, see plan.md
and architecture_and_maintenance.md
.