Skip to main content

A lightweight TUI coding assistant using Gemini API free tier

Project description

VerySmolCode

A lightweight TUI coding assistant powered by Gemini API free tier, designed for resource-constrained devices like Raspberry Pi 3.

Features

  • CLI Prompt Mode: vsc -p "prompt" for single-shot usage (like claude -p), supports piped input
  • Command Autocomplete: Type / to see all available commands with descriptions, navigate with arrow keys
  • Smart Model Routing: 6 models across Gemini 3.x and 2.5 — automatically selects the best available model based on task complexity, with graceful fallback when rate-limited or overloaded
  • Planning Mode: /plan for thorough analysis — reads code, creates architecture plans, and builds a todo list to guide implementation
  • Task Tracking: Built-in todo list (like Claude Code) — the agent creates and tracks tasks during complex work, visible with /todo
  • Full Tool Suite: File read/write/edit, grep search, find files, git operations, shell commands, web fetch, image reading (19 tools)
  • MCP Support: Connect to MCP servers (context7, playwright, etc.) via /mcp-add — tools are live in the agent loop
  • Code Reviewer: After tool use, reviews actual git diff with a structured checklist (correctness, bugs, completeness, style)
  • Chain-of-Thought: All 6 models use thinking tokens for better reasoning, with tier-scaled budgets (Pro 2048, Flash 1024, Lite 512)
  • Token-Aware: /tokens dashboard, /fast//smart model selection, rate limit warnings, conversation compaction, and thinking budget control
  • Safe by Default: Blocks destructive operations, validates paths, and prevents dangerous commands
  • Lightweight: ~5MB binary, minimal memory footprint, runs on Raspberry Pi 3

Installation

With pip (Python)

Pre-built wheels available for Linux (x86_64, aarch64, armv7), macOS (Intel + Apple Silicon), and Windows (x86_64):

pip install verysmolcode

From Source (Rust)

# Install Rust if needed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Clone and build
git clone https://github.com/marcelotournier/verysmolcode.git
cd verysmolcode
cargo install --path .

From Source (Python wheel)

pip install maturin
git clone https://github.com/marcelotournier/verysmolcode.git
cd verysmolcode
maturin develop --features python

Usage

# Set your Gemini API key (get one free at https://aistudio.google.com/apikey)
export GEMINI_API_KEY=your_key_here

# Run interactive TUI
vsc

# Run a single prompt (like claude -p)
vsc -p "explain this codebase"

# Pipe input as prompt
cat error.log | vsc -p "what's wrong here?"

# Show version
vsc -v

Commands

Command Description
/help Show available commands and keybindings
/fast Use Flash models for next message (saves budget)
/smart Use Pro models for next message (best quality)
/plan Toggle planning mode (read-only, Pro model)
/undo Undo the last batch of file changes
/save Save conversation to file: /save [filename]
/tokens Show detailed token usage and rate limits
/status Show rate limits and token usage
/model Show available models and rate limits
/config Show current configuration
/config set Edit config: /config set temperature 0.5
/compact Manually compact conversation to save tokens
/mcp List configured MCP servers
/mcp-add Add MCP server: /mcp-add name command [args]
/mcp-rm Remove MCP server: /mcp-rm name
/todo Show current task list (alias: /t)
/retry Retry the last message (alias: /r)
/version Show version information
/clear Clear conversation and screen
/quit Exit VerySmolCode

Keybindings

Key Action
Ctrl+C Cancel/Quit
Ctrl+L Clear screen
Up/Down Input history / Navigate command popup
PgUp/PgDn Scroll output
Tab Select from command popup
Esc Dismiss command popup
Ctrl+A/E Home/End of line
Ctrl+U/K Clear line before/after cursor
Ctrl+W Delete word backward

Model Tiers (Free Tier)

Model RPM RPD Best For
Gemini 3.1 Pro 5 25 Complex tasks
Gemini 3 Flash 10 250 General coding
Gemini 3.1 Flash-Lite 15 1000 Simple tasks
Gemini 2.5 Pro 5 25 Fallback complex
Gemini 2.5 Flash 10 250 Fallback general
Gemini 2.5 Flash-Lite 15 1000 Fallback simple

VerySmolCode automatically manages rate limits across all 6 models independently. When one model is exhausted, it falls back to the next available one. Gemini 3 models are preferred; 2.5 models serve as fallbacks, effectively doubling your daily quota per tier.

Configuration

Config file is stored at ~/.config/verysmolcode/config.json. You can edit it directly or use /config set in the TUI:

/config set temperature 0.5     # Lower = more focused, higher = more creative
/config set max_tokens 2048     # Limit response length to save tokens
/config set compact_threshold 16000  # Compact conversation earlier
/config set safety off          # Disable safety checks (not recommended)

Default values:

{
  "max_tokens_per_response": 4096,
  "max_conversation_tokens": 32000,
  "temperature": 0.7,
  "auto_compact_threshold": 24000,
  "safety_enabled": true
}

Architecture

src/
  main.rs           - Entry point
  config.rs         - Configuration management
  utils.rs          - Shared utilities (safe UTF-8 truncation)
  api/
    client.rs       - Gemini REST API client with fallback
    models.rs       - 6 model definitions, rate limiting, routing
    types.rs        - Request/response type definitions
  agent/
    loop_runner.rs  - Main agent loop with planning mode and critic
  tools/
    file_ops.rs     - File read/write/edit/list + image reading
    grep.rs         - Search and find files
    git.rs          - Git operations and shell commands
    web.rs          - Web page fetching
    todo.rs         - Task tracking (agent todo list)
    registry.rs     - Tool registration and dispatch (19 tools)
  mcp/
    client.rs       - MCP client (stdio JSON-RPC 2.0)
    config.rs       - MCP server configuration
    types.rs        - MCP protocol types
  tui/
    app.rs          - Application state and event handling
    ui.rs           - Terminal UI rendering
    input.rs        - Keyboard input handling
    commands.rs     - Slash command processing

Testing

# Unit tests (434+ tests)
cargo test

# Integration test (requires tmux + GEMINI_API_KEY)
./tests/integration_test.sh

License

MIT

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

verysmolcode-0.10.2.tar.gz (96.0 kB view details)

Uploaded Source

Built Distributions

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

verysmolcode-0.10.2-cp313-cp313-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.13Windows x86-64

verysmolcode-0.10.2-cp313-cp313-manylinux_2_28_armv7l.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

verysmolcode-0.10.2-cp313-cp313-manylinux_2_28_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

verysmolcode-0.10.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

verysmolcode-0.10.2-cp313-cp313-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

verysmolcode-0.10.2-cp313-cp313-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

verysmolcode-0.10.2-cp312-cp312-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.12Windows x86-64

verysmolcode-0.10.2-cp312-cp312-manylinux_2_28_armv7l.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

verysmolcode-0.10.2-cp312-cp312-manylinux_2_28_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

verysmolcode-0.10.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verysmolcode-0.10.2-cp312-cp312-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

verysmolcode-0.10.2-cp312-cp312-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

verysmolcode-0.10.2-cp311-cp311-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.11Windows x86-64

verysmolcode-0.10.2-cp311-cp311-manylinux_2_28_armv7l.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

verysmolcode-0.10.2-cp311-cp311-manylinux_2_28_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

verysmolcode-0.10.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verysmolcode-0.10.2-cp311-cp311-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

verysmolcode-0.10.2-cp311-cp311-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

Details for the file verysmolcode-0.10.2.tar.gz.

File metadata

  • Download URL: verysmolcode-0.10.2.tar.gz
  • Upload date:
  • Size: 96.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.6

File hashes

Hashes for verysmolcode-0.10.2.tar.gz
Algorithm Hash digest
SHA256 08d9cf5527d63d32f2ceaa6ef52783213997c1fe7923c7326650ce34f76b4d19
MD5 03fcae6505475f1628b30909ce5d44ec
BLAKE2b-256 98063591567a5543781b6ed860f9bef63b06e2afdb9c9bb9a42173fa7f6ee150

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 403e7dee532e31690a18cd2f4e04758bcea12b6e5040f95d352e0a5cbc4178a1
MD5 07e89c8c597577b314a89c13bc199d1c
BLAKE2b-256 156e43d4094ff907c940869df9e780d0317eeaa17127503a7d4e66ee4378205e

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp313-cp313-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 de100e716bb31fcdd30f808ebbd3fb7078512d35c11439135ac1ac6c21749671
MD5 b1df0c8d3c746e60ff5f7765b656609f
BLAKE2b-256 8e07c74efe3be1dc89a2775a044c2896a22fbe1b43d8d1696e6e33846aeb341d

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 172de39642b1eb9290e029b611c9f86509385c6007d67df32a80f1f0600194b0
MD5 f4259534789874db6142ddf79762f042
BLAKE2b-256 2ead2762cc5f445095d9299241631e14d3d0630ecc2d3d93fc652c617aa25027

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1fddf47dc00d974e706f4348630d880b56b2228ddd929da0a394ffea96544598
MD5 d9342de56a2a44292da57669e559a3e3
BLAKE2b-256 efc8345f5868ead21eee63075ad034cd09d520565277a1006c95b4525829923f

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3a5da834807ffc95f0791c834c6c4e50dfdb25af9ebbd36cc39462cfad55bde0
MD5 3d2fbc67ce568c2aba684b80bdc30dca
BLAKE2b-256 d3877727459aef75bcec1b405a1fbcff7b317937a0977fd150e3558b5a5907be

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4f3ea47ca0f434289a9d2f3c59fe2d2d4b6c02e31be117a4a184c1fb90e34e3f
MD5 b7eacb87e47062790deb469062c26ab1
BLAKE2b-256 3568cfe66f75ede02ef75f68aa76ad6dac81d420d0376a9f6d71ecdfe54a8e2b

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 47cf2a784eddf9f37b7729de7532f36fce7bd9122cb2913ff8f6a9dc5a1ce22b
MD5 3c9f466f4c1e0cd51e294682046083f6
BLAKE2b-256 2f5f92fe2eb1bf86f142a9760b013383d765bc5ddce77160a82cb4e5a946684c

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp312-cp312-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 b249929b81ad2357931b7b1da2b3e1a4e0d1f6d18f9f0096398680eee479de5b
MD5 e5213bf7e6ad81eedbb32a61b4d45dd2
BLAKE2b-256 54062fb6ff137b5281c8f2596e4d505d9ec445131bec022c554a19c38d12f3f3

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 73a1e0d56d4835a9ad48c661343409cb0ec3257534da992418000c8c9634725f
MD5 2a2bb67ea9580d2128183246b01e1960
BLAKE2b-256 2cb574a85935d45c684c191b74d7dabc296f7372147a32d0810a5ac1b2f92b5f

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1072793996a1606d60cffd39a32f8208dfb48088000840f8a1e39e2930083338
MD5 5b3f97cf3d9b58b418bc4b216139d264
BLAKE2b-256 655a8442527d9a0a321b17a9a4fd982bfcfde5c4ab55065f0ea51e6f59f876c9

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ebc011548c1ab2bb97cd32152992cac54d79f66b955f2fb60809f17bab51a4a0
MD5 4dbefea645978e6b99e0053144ceafe8
BLAKE2b-256 22c250a6d7bb0185412cfadab5cd7e27831241fa2de3319ecd012b96271fcb24

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 478bdbe917156a00d3741f32df2542c06f34f6b1ebb7649151e08108a280c852
MD5 c1a3d9420ba3321597f9d1ae6a172aec
BLAKE2b-256 52d8087a72ce57d984534cbc85b231bae0ad4aff31d636519e4070043d927d45

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4cbafdf40b39d3006e2d6150c18032430f51f11514b30d6714fc2b3281a61a26
MD5 36bd71262899e8a633901cedbddbb2c6
BLAKE2b-256 5601bb7714eade006818edcf4a713e96573c82cdca7f0e4b3d474f67954700f7

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp311-cp311-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 235d4a3c94b2919405d232a45691815d0538fba62c4bb24248c4b2f8176e0cf6
MD5 3667f23d9c0c23cfdfc8f15374bbb1ec
BLAKE2b-256 d9c0687a684be4cd585ee5b6a5578fe3295013320169d1d53d2579cd1566b854

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 878983adfbcac210ed4f899bd3d7e1c56f2734cd08b4cc17cb91886ead503ee9
MD5 be4fc3db09fcda4eeb124547f6600207
BLAKE2b-256 1d626b3abe9c216f1c37f54f9704a3b63ce58fee30a9198f9ccf0127b3ebc0e0

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ef80b940ffa2275bd5d6b5b3445037613465dee3725fa8a8a4a2e6b8a3556a3
MD5 27c30c4c6f5fa6a6edda55e85cfeecd9
BLAKE2b-256 3ddf113c5323f34127c30c2bd71c2663c7cf268cbcdc26765ee04e227c570184

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 be0472484e6a2daf33b1273b464332ee2ce22d44a91aff55bd31cdfd2a827925
MD5 2456a195c803de46e48d4333d41089ee
BLAKE2b-256 66f3598f088a3bd9518bd7879f38130c6d9b5642f987b88a39fd4735c5c10669

See more details on using hashes here.

File details

Details for the file verysmolcode-0.10.2-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.10.2-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4e8231004c8926f25529aae24be82d2ede2288196b4b90c833f85c65448140cc
MD5 d18c22b3d3e5fa55d3d660b9828a7906
BLAKE2b-256 a5cdce2f0acc890a303578a8f2f70ab691c4cbd7202d2462516168743e71eac0

See more details on using hashes here.

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