AI coding assistant TUI — multi-provider, session-aware
Project description
flexcoder
AI coding assistant TUI — alternative to opencode / claude code / codex.
Install
pip install flexcoder
File structure
flexcoder/
├── pyproject.toml
├── config.toml.default template for ~/.flexcoder/config.toml
└── flexcoder/
├── main.py CLI entry point (print("initialisation...") line 1)
├── config.py TOML config loader/saver
├── providers.py provider registry + verified fetch endpoints
├── sessions.py session persistence → ~/.flexcoder/sessions/
├── ai.py AI backends (all 6 providers)
├── tools.py tool execution (create_file, shell, etc.)
├── system_prompt.py dynamic system prompt (OS, shell, tree, tools)
├── art.py ASCII art
├── flexcoder.tcss TUI stylesheet
└── screens/
├── chat.py main chat TUI
├── help.py Ctrl+H help overlay
├── selector.py Ctrl+P provider/model picker
├── provider_settings.py Ctrl+E API keys + Fetch Models
├── ai_settings.py Ctrl+T temperature / max tokens / …
└── session_browser.py Ctrl+S session browser
Usage
flexcoder # start with saved config
flexcoder ollama gemma3:3b # start with Ollama gemma3:3b
flexcoder continue # resume most recent session
flexcoder continue <session-id> # resume specific session
flexcoder providers # provider settings TUI (standalone)
flexcoder settings # AI settings TUI (standalone)
flexcoder sessions # session browser TUI (standalone)
First-time setup
flexcoder→ press Ctrl+E- Select provider, paste API key, click Save Key
- Click Fetch Models (queries the provider's live API)
- Click Done
- Press Ctrl+P → select model → Confirm
- Start chatting
Keyboard shortcuts
| Key | Action |
|---|---|
| Ctrl+A | Toggle auto-approve (AUTO/MANUAL) |
| Ctrl+O | Toggle output (OUT/QUIET) |
| Ctrl+H | Help |
| Ctrl+N | New session |
| Ctrl+S | Session browser |
| Ctrl+P | Provider / model selector |
| Ctrl+E | Provider settings (API keys) |
| Ctrl+T | AI generation settings |
| Ctrl+L | Clear chat |
| Esc | Interrupt / cancel |
| Ctrl+C | Quit |
Model fetch endpoints (verified March 2026)
| Provider | Endpoint |
|---|---|
| Ollama | GET http://localhost:11434/api/tags |
| Claude | GET https://api.anthropic.com/v1/models (x-api-key header) |
| ChatGPT | GET https://api.openai.com/v1/models (Bearer token) |
| Gemini | GET https://generativelanguage.googleapis.com/v1beta/models?key=… |
| Mistral | GET https://api.mistral.ai/v1/models (Bearer token) |
| OpenRouter | GET https://openrouter.ai/api/v1/models (Bearer token) |
AI tools available to the model
| Tool | Syntax |
|---|---|
| Create file | <create_file=[path]>content</create_file> |
| Move file | <move_file source=[old] destination=[new] /> |
| Read file | <read_file=[path] /> |
| Create directory | <create_directory=[path] /> |
| Search & replace | <search_replace=[file]><search>…</search><replace>…</replace></search_replace> |
| Shell command | <shell>command</shell> |
| Insert text | <insert=[file]><for>…</for><after>…</after><text>…</text></insert> |
Session storage
Sessions live in ~/.flexcoder/sessions/<session-id>.json.
Resume any session: flexcoder continue 20250306-143022-a1b2c3
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flexcoder-1.0.4.tar.gz.
File metadata
- Download URL: flexcoder-1.0.4.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc4ea26c2c5c7611aabf0841465f08366a31a012e15bfd5648e18c3b5fc1757c
|
|
| MD5 |
e0bad1cef5d56dce034c839b718e34f2
|
|
| BLAKE2b-256 |
874518b5eae6f007218697aed7c04ee3d06dd151ea9f80f35d4e4911a55f90ec
|
Provenance
The following attestation bundles were made for flexcoder-1.0.4.tar.gz:
Publisher:
pypi-publish.yml on bren-uijl/flexcoder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flexcoder-1.0.4.tar.gz -
Subject digest:
bc4ea26c2c5c7611aabf0841465f08366a31a012e15bfd5648e18c3b5fc1757c - Sigstore transparency entry: 1066019964
- Sigstore integration time:
-
Permalink:
bren-uijl/flexcoder@ff438f405668d9ded65b9b268708c27826fb1110 -
Branch / Tag:
refs/tags/v0.1.4final - Owner: https://github.com/bren-uijl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@ff438f405668d9ded65b9b268708c27826fb1110 -
Trigger Event:
push
-
Statement type:
File details
Details for the file flexcoder-1.0.4-py3-none-any.whl.
File metadata
- Download URL: flexcoder-1.0.4-py3-none-any.whl
- Upload date:
- Size: 31.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efdf05e55e45c2f32a285f2064ab52aea2b40a8345f8a2498f8fe655c6ceb3c1
|
|
| MD5 |
250b7060c7909a1343e7e93af7400221
|
|
| BLAKE2b-256 |
03821d0e3055fc2d0f2d8a1dda8c782278cb8712517ce23c81cd17c1f85f84c2
|
Provenance
The following attestation bundles were made for flexcoder-1.0.4-py3-none-any.whl:
Publisher:
pypi-publish.yml on bren-uijl/flexcoder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flexcoder-1.0.4-py3-none-any.whl -
Subject digest:
efdf05e55e45c2f32a285f2064ab52aea2b40a8345f8a2498f8fe655c6ceb3c1 - Sigstore transparency entry: 1066020000
- Sigstore integration time:
-
Permalink:
bren-uijl/flexcoder@ff438f405668d9ded65b9b268708c27826fb1110 -
Branch / Tag:
refs/tags/v0.1.4final - Owner: https://github.com/bren-uijl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@ff438f405668d9ded65b9b268708c27826fb1110 -
Trigger Event:
push
-
Statement type: