Codient analyzes, refactors, debugs, and generates code from your CLI. Multi-model, multi-file, with safe backups and rollback — no IDE required.
No context switching. Codient stays in your workflow and lets the AI do the heavy lifting.
Choose between Claude, ChatGPT, or DeepSeek on a per-command basis. Switch models without reconfiguring anything.
Send multiple source files in a single command. Codient builds a context-aware prompt from your entire codebase slice.
Every file is automatically backed up to ~/.codient/backups/ before
any change is applied. You can always roll back.
Restore any file to any previous version by timestamp. Never lose working code because of an AI suggestion.
When not using --overwrite,
Codient generates a color-coded side-by-side diff report and opens it in your browser.
Driven by Selenium for persistent, login-based AI sessions. Supports HTTP and SOCKS5 proxies for restricted environments.
Pass read-only reference files with --context. The AI sees them for
understanding but won't modify them.
Log the full prompt and raw AI response to HTML files in ~/.codient/debug/ for full
transparency.
Requires Python 3.8+, Google Chrome, and a matching ChromeDriver.
Pull the project and move into the directory.
git clone https://github.com/hamidsamak/codient.git cd codient
Keep everything isolated with a venv, then install from requirements.txt.
python3 -m venv venv
venv/bin/pip install -r requirements.txt
codient to your PATHRun this once from inside the cloned folder to create a global launcher script.
# Create the launcher cat > ~/.local/bin/codient << EOF #!/bin/bash exec "$(pwd)/venv/bin/python" "$(pwd)/codient" "\$@" EOF chmod +x ~/.local/bin/codient # Make sure ~/.local/bin is in PATH echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc source ~/.bashrc
Open a browser session for each model you want to use. You only need to do this once — the session is saved for future use.
# Log in to each model you want to use codient --browser --model claude codient --browser --model chatgpt codient --browser --model deepseek
A Chrome window opens for each model — log in as you normally would, then close it. The session cookie is persisted automatically.
All commands follow the pattern: codient [flags] "prompt" file1.py file2.py
Ask Codient to find and fix a bug. Without --overwrite, you get a diff report.
codient "Fix the off-by-one error" main.py
Apply changes directly to disk. Your original is backed up first.
codient --overwrite "Refactor to use dataclasses" models.py
Pass multiple files for cross-file context.
codient "Find inconsistencies" api.py db.py utils.py
Reference files for context, separated by --. They're read but never
modified.
codient "Improve architecture" --context config.py utils.py -- main.py
Default is Claude. Switch with --model.
codient --model chatgpt "Optimize this query" db.py codient --model deepseek "Add type hints" app.py
Save the full prompt + raw AI response for inspection.
codient --debug "Explain this logic" complex.py # Output saved to ~/.codient/debug/
List all backups for a file.
codient --history main.py
Restore the last backup, or a specific version by timestamp.
codient --rollback main.py codient --rollback main.py --timestamp 20250101123000
Full reference for every option.
| Flag | Description |
|---|---|
| --overwrite | Apply AI changes directly to files (with automatic backup) |
| --context FILES | Add read-only reference files (not modified by AI) |
| --debug | Save full prompt + response HTML to ~/.codient/debug/ |
| --proxy URL | Route through an HTTP or SOCKS5 proxy |
| --model NAME | Select AI model: claude
(default), chatgpt, deepseek |
| --browser | Open a persistent login session for the selected model |
| --history FILE | Show all backup versions for a file |
| --rollback FILE | Restore the previous version of a file |
| --timestamp TS | Restore a specific version (format: YYYYMMDDHHMMSS) |
The Codient VSCode extension connects directly to the Codient CLI, bringing all features into your workspace UI.
Package the extension with vsce and install it locally.
# Install vsce (one time only) npm install -g @vscode/vsce # Build the .vsix package vsce package # Install in VSCode code --install-extension codient-*.vsix
Then open the Command Palette with Ctrl+Shift+P (or ⌘+Shift+P on Mac) and search for Codient.
Analyze the open file — fix bugs, review code, add comments, or optimize performance.
Analyze multiple files together for cross-file refactoring, architecture review, or system-wide debugging.
Launch a persistent Chrome AI session for login-based workflows or long conversations.
Codient connects your terminal to AI web interfaces through browser automation, then parses and applies the responses safely.
No API keys required. Codient uses your existing logged-in browser sessions, so it works wherever you can log into Claude, ChatGPT, or DeepSeek.