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
  • Tool Timing: Each tool call shows execution time — helps identify bottlenecks on slow hardware
  • 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+D Quit (empty input)
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 (474+ 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.11.3.tar.gz (110.6 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.11.3-cp313-cp313-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.13Windows x86-64

verysmolcode-0.11.3-cp313-cp313-manylinux_2_28_armv7l.whl (1.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

verysmolcode-0.11.3-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.11.3-cp313-cp313-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

verysmolcode-0.11.3-cp312-cp312-manylinux_2_28_armv7l.whl (1.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

verysmolcode-0.11.3-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.11.3-cp312-cp312-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

verysmolcode-0.11.3-cp311-cp311-manylinux_2_28_armv7l.whl (1.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

verysmolcode-0.11.3-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.11.3-cp311-cp311-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

verysmolcode-0.11.3-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.11.3.tar.gz.

File metadata

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

File hashes

Hashes for verysmolcode-0.11.3.tar.gz
Algorithm Hash digest
SHA256 4db510ab730df0d1803161144a87a221aae8785ff1aad3fbbb5b8d1900454764
MD5 331577bde8c37b67158decd566f54d43
BLAKE2b-256 700b2e475dc6fab6b2339812515d127e30ec703e346a6740ae7128b802c46401

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c710ed9097605c521338171578981303de7702775a3591cbe90e71b873b41734
MD5 25cd75f0ddf74894aa72a6abe2b486b1
BLAKE2b-256 30a53b341ba23a604e55b2e5d0157f2a45b8542e528075990b4f38ef1c1aad62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 103bdef219156a6b1b33948d5ccca8bff8cb8e30bbbebc883dc5633dd5287879
MD5 956f5a67c33c2a4e1cff8d133d4e4e9f
BLAKE2b-256 56974058722546796b5c9bb9c6230eb2c0fccd12f7c79f2476562e4855e2ec4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 47daebfeef4485d5fcec64df3b916407e96775b3114ee1ad46eaf1fabb501052
MD5 a9b057faa15bf852268e90d06b60dfba
BLAKE2b-256 5ba902eaf5de2b536cc5b8d5d950f2efab8dd962830b23403c8cb0e3e37246cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 05c12b24f02c1ff68628edf84525a5b1daf32674445faf7da68117178e6c7845
MD5 147785e81e72d9a9489eba2db5bd6561
BLAKE2b-256 660f9cc427af622bb20aa656a49d670251d75e29842db8c5cc74ead98f2344e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b6c41cd038b1dc56e4fe67a25e7c1a16731a86db4be313c930710a6d1bd8d8a6
MD5 78f587dd1a6661fa8187059409b912e0
BLAKE2b-256 0daf0d01427d759c2d80681dc5ddf6f82c24861fbc5550f3edd7e2a68f1c0b1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c42ea06f008bbfd89e696441d04f1f0bd39802ff32f7cc75c1f7931af514ff48
MD5 7c99d9ab5c15d9417c69a5569b896f48
BLAKE2b-256 6e7cf18fe7fabcf46472f9a7097a0f7e13ab5f932937e4f2d8aa7afb2faddfb1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d8afaec28321ec2328e67f6b16410485d2d5dbc96b22c2344b274df8ddae09bd
MD5 db28bb7780707ea12a91b038384fed20
BLAKE2b-256 d38afb85738eca7a872efc1a9d2bfb504834a19ce2cb4629f22a79f91963a1ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 66034a231ff59d9d11c16fcc78b703e29c40c1e9a3ef4951e5a3334c1c2b0a0b
MD5 0654bb103e505642e8c8c8cbc80bc9f4
BLAKE2b-256 c4bce3838dce5aea05e9f8599eeb62855653958d32389cf4c956f8985f03bbdc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4d5b2a8ee7fe9f1de3f569f3849a204a0b7e7b5153b4b135823b88f171fdf524
MD5 fc6381548f56bdf6079e0c460dbeeb3c
BLAKE2b-256 dd44e837a188af0d386dd37b67aa05b00d8191d6386b8648512381fd0de34b92

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bcfc7bbee459216df2274fef49b2ed4928e0d2d5ed679363c942c3927856a405
MD5 0f610c7c05ed3a63b660d4dfaf83923c
BLAKE2b-256 11e8e470e592cd2dbfc01126aceb06ea28de5c2bc1785bc5ce1238a155e92308

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e1777c83322bafc881361c20b25b74be0f9dd4ba9fd0c382b2fad70ee1481947
MD5 c7bcc7a80ccced66ae2edfb1c26e6364
BLAKE2b-256 400fdaedc0ecf23a4787a1528fed18deb87adb8302591d9e2b9a4db8604bc2b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 03b1bc6a527d9deae24878ec87f3963d077213136415e2a83b1ce51ad471295c
MD5 164c0c3c558ba06c924cc6e0e7a18e35
BLAKE2b-256 e66d090825379c0af3d8e9baf8576c6df2733015bf239db39cd03ebee2a565cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fb2429ad17dff5f3a10488a9deeca7ea17f6f8d8d91d118681ed1dbbe2032536
MD5 2dc755ff180942111c0639a93311200c
BLAKE2b-256 5357bd45628ebf7c31a0dbd9aa81031f775a01887e7b2ec6e5a15726434e9739

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 d9a72b24426bbd07bcdeced6e9ebe03d358cf5855d8cb5d734005d0929fdc451
MD5 2d5c15d853ddb4399e591183a1917aa1
BLAKE2b-256 467f0a586254065f8a13fbf0b8147d7ed57b4dca1ab50e3010c18021916fa7e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0aeda8e21487d3158418da1f7efc971787d9c9b674fa72fb4f115816543305b0
MD5 452c2858e7b0e62a2858d5342e5db949
BLAKE2b-256 bbb946197f77f09b995114f8c119d9fca315cb1ff7a9ab09959b89da8524521d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 887b707e64686f1c48225c0a2a02129891e77c0968df0e78f1d329fd23968764
MD5 9795e1adbb8b2e9fc785d502435594ec
BLAKE2b-256 74dd1ef27a77b12b4eee11546ecc0fc4911bf86f0bc4daa11503210203db30de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4935ec1456165cddf23743ee677f39d319de8fb50ee695a9f0fed51e614e92c4
MD5 ae573bfad2d44bf973a67a2a9744ee90
BLAKE2b-256 564412e82992e2babe42596af88ce9732a3042e7a99142c7f1540506d5451b5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.11.3-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8dedab71836719527749c7ce42f05bef0c81dbd57ac81ef6298abd50210638b9
MD5 ddcecfc35e25e67ec3e60f6e48b93037
BLAKE2b-256 03dfa26ef1bbd61e135306734637c52d92fabda494a8769d5b82f26abdca3695

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