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.1.tar.gz (96.2 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.1-cp313-cp313-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

verysmolcode-0.10.1-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.1.tar.gz.

File metadata

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

File hashes

Hashes for verysmolcode-0.10.1.tar.gz
Algorithm Hash digest
SHA256 d3b999cad818689abe855386ccd36e53720be15a480ae07e53e55684185a92ac
MD5 4aca169c2952131fb00420c537c429e0
BLAKE2b-256 015dc6d1947fcc1c5ec17aff66523528e8aee75716bea6436e7ebe5a64b84f5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 962522e75423bbc9460b731320b0e95d7a2ccde1197242f9c83525b9ff55fc26
MD5 f9f0483ce8ff3ed2fb2b41f22e16c27a
BLAKE2b-256 acec3ee3edbb2276caffa1cfc0ad412041851ed5308fe96e160a385f76d401dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 b8099e9ba7dcf5f2ddec388fa57ea9096ee62134b869ac9e106f59ed5f988c37
MD5 128c7fa782a9948a38f5a9ef51bb20e3
BLAKE2b-256 fc7229aa446b2d2acef654c0bdd58808cc4cdb30d5f69efcc237858cd57aedc4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2e903799be8f5f83f40ee3ff634abd655698788a1726c41c598e6be23a815b87
MD5 040a323201b632fa178cae77c5e6e263
BLAKE2b-256 294cb90cf741be12dd53303d28a15a1e5a40e0c3e520d13d7368186ac67afc65

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 acf02c14e0f9316dfdf46510aad1cba140073aa9dd9df035307713e78f862294
MD5 1a8e5521baf07b7af4f5ac4e47fcc67e
BLAKE2b-256 16e734cb8860cc26f6e2456095c6ca53148673d7ff633e27e284366cf19f684c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 30bdf8b0039a577ba00e3017b9e3afabc2c3a4d442aa3ee43bc39b13f78debb0
MD5 adaa948ed4063052615e6b68893e4e05
BLAKE2b-256 caddfe859e952ef576cc7e8c6407d4b03c326deec0e3454373265b5e9ddbab18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ead58290e3c15de6cef8711063851f6bda125c6f92d03adb78730ff671a2ca1f
MD5 dd2864b2191096a48dbce35b32ba4d77
BLAKE2b-256 a6368ad580be1a6d4e0a84663d06c4d17a9756b9fde92b8b192576bd05427355

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ea8a1bbe0890e36157a8a613a27239894df225fa893de000b30bc3bc58f7b145
MD5 ea2fc3a2990da789103381f79aa8f41f
BLAKE2b-256 4967b508b1b5bc7869fab9e02a730c9687b48a77da67d12681d1e4f4bcc0593e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 be27cd2960f72c64bceed3cfaa9711071841b441a56f6bbdda47719bf7b11ac6
MD5 f51a97bf6c4dcd57ae302f0fad07e403
BLAKE2b-256 3d8062ffe1515db6305885c336125557a2a231737cb281e1ddaabc26db8baf6a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6f661aa9ad829f9ed8d1be7284cd533aecb5813428d5422d6cd0a3b2b5109292
MD5 b81783528884639134b92187008d2060
BLAKE2b-256 09acf04c52bd61c0609710ed4bf4b388e0b6ce859f66c5ad9acf89b3e073da0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ad83177ea0853d298355fb0a190e399fe831727f505a904b784fcef35144194e
MD5 fa9a486ce5fbed7cad27b99a9e98e602
BLAKE2b-256 8d537d0bab7fb5eeb7470c1e439d62e399be1328c35b5ed96064d9d289e57f1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dd7597637fc47ae191a2c01862646e965b366542a73de2c69d57b1c2b2653b47
MD5 20235b0e7a5071ea4415b5e74c9d30de
BLAKE2b-256 85e612a9e439cb82d5c7a9719beb7066fb6b559a48f369d08c758bd2d18dd7bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2bf6a487513f8fa9d1bfef5c6641d1a8bb627fae533eaa244aa71ebf09139b39
MD5 386b00a71b50af902af36f16820e2a5b
BLAKE2b-256 7e96a5af8eaaa5b0baa3aa6b3b50757c3da1e2c1acd19dba1d96a8cd2e783627

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c67d0408e5fe451a5bab974b7375159e307865330eb12a01b525a8fbe4cdd43f
MD5 8a27ffe8c778324797cc22401776c956
BLAKE2b-256 9e2a4faef487a6cbc553a4478072d6e23b579184e6a05121ef6e9338dcee23a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 63d1dbff6ac25df33cc58d4c0d6309b3ca72f2b60383bb4a961e21b7813110cb
MD5 dfee0c26cfe37f69ed79f03de4cb08ab
BLAKE2b-256 5ac5d5ee8df6fc877c8dcc2bc7e3aeeee934ee554177d1b8b97701350eaf7ce0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5f74abd536088f8ccdd5380cf3d071f1b371a901713ccbdd8c94ef6c2cb90db5
MD5 ecb96e60077be0ba1e20b01f988187d7
BLAKE2b-256 f7cddb83f4ae93a4d3df1bf05fa85292ef635cdf3d26fa33eb3c1260eb2b35cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dc2965211c9fdc13b1a2044e278ac3b951b6b99231b9fdec701312e3ca8c1c4d
MD5 98443bbc7226c06671edf8fde62fc539
BLAKE2b-256 db148824219360416a0f270a626c061e59b1fe9c4d3b92fa6680a1726c52b641

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 81ba1160325118fa40014787fe96b9fde031b494a1c8b54608458a617c7ac636
MD5 60ca6ac275631cc19a5478ea1ddbe4af
BLAKE2b-256 6665e455c8438ce80756876909a457f4a73d07c41a996bde4c4963966cee6860

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 cb5b4adf5ce2096ac7958865088424b7b306dec7225212123fbecc32aa2d1793
MD5 f92bc28e1ca9a3bf7ca0c89673963343
BLAKE2b-256 8dfd8df11505a31910c0479c6d4cb5f6da2841c4138b5e59a25bf44ce9483c0c

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