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+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 (437+ 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.5.tar.gz (98.1 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.5-cp313-cp313-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

verysmolcode-0.10.5-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.5.tar.gz.

File metadata

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

File hashes

Hashes for verysmolcode-0.10.5.tar.gz
Algorithm Hash digest
SHA256 cd51cbb4e2c18166fd2a2c489551a216abec8b6893cdb4773d490aecf6f1163e
MD5 9f97d3964972c8cfbf4d17c6a42a4202
BLAKE2b-256 14d0ba79bb2fb712561364dc908ae6f8a2b6bb7f9324314dc912d2bf5bd5e933

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 157c0bd794e036f4b936410350ce40204ae8a8bd17b74630397f18d8026514fc
MD5 dec188d1e6a527fb0205ca65965ba4ce
BLAKE2b-256 05571e2d9c9722fcc0de3ffb7be47ee7da048c7b469e703392e69349daf00869

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 3e2fc1e85a524636efef9c457412c1391e95ad638a8a8bdfbb4ce970c300dd34
MD5 608edde50e01a720034891394acc8ee7
BLAKE2b-256 150f515ae602cea5465e4e0328c211e1d10ecf48959bbc34358c1113c64ff9c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e1528e014c7d54511987808cf6fccbf8f702ebfb9c4232aa5b3a6047ca8b7876
MD5 3c382a025c027752dc99347daab58b97
BLAKE2b-256 0666cd73846ce81963a2b2be9778c1c7b9cc025c42dd9087da1a05c7294833ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 03a089a25996555bad14dc465ef61fa23dea4829d84a3db893c4d7d544cebe88
MD5 f695dc68e556c5a88208666087b26774
BLAKE2b-256 6bf7c8a62cff0e559a7e8b19ac1db1481b35552c5d56686bdcbee924d91a43a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f69f95b2e79c1aa66eae28f19e847bf5d5909aeb6d1a7ac1b323e5e3d3931556
MD5 e62d0fb14d83f76bf0db2ebd4f9d2341
BLAKE2b-256 4cd4bfc7f52b9134c52232df16516094e9696916e5b2a800e5f662e94a6fe1ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 69e678c8b6154f42aef9f8d43e7550b1c7daf8f01a483904220164e7ecb9f0ba
MD5 23d08a3569c2ebefd141a54241e175c3
BLAKE2b-256 528d6e78e91416097fbfff64f50ea63d90e1fb1c0ae6965cad479149be058da9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7f72652cb2237f99282a99119961a383bbb2a76a28082e0828b38d8880ee19cb
MD5 f885ae8fe182bd7223200d8e65607000
BLAKE2b-256 fafa4d7f7e03587f6e70346731693c6aa06aad7c2bf1e0659f16337f21f12074

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 1861cd15c0253c9dd148d363b0600eb665a6db32f6ec567f8725060144fc9d9e
MD5 3c87a4c7e10ffce746d6532de3362e93
BLAKE2b-256 cb1cdfb609377e1d05d490fb1d19f0dd53bfe2ae400c603d1b0ef52f6d234893

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4d085c3322c3d1ea2a7f6909b6f973665bf0e5c1ea57a2dc744361b342f11725
MD5 46df0ead4cdbdfbff902611ac02eaf37
BLAKE2b-256 50cb11bac42ccf5cb3b5003cbf13f6fe97cf1f301d51a86118c3dbb07d76d97f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8e2c0079cf608282f285fcf6a9b643d27dcb018369c895a760e4de6ac38df374
MD5 3b1d3dd76770352742651785d1b7ef5b
BLAKE2b-256 b96f1ee183daadcb80c87bc4f000c99bc73a3eccc92b3e92a49132e678f932f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e2b77dd4d633a30bfddab8335f09ec80aaf1292f80b0a9556c10866ec06b3f24
MD5 8456fb22419b68547890c77ef50ca064
BLAKE2b-256 bee2cd2a2c19dad315c4f1d9a087f12bf11d80f8183f0bf4c4c4d4370afbce21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c75f256a33db97beaf42387b738ba08014eb38c30faf52ab5cc15c8086964394
MD5 0a01a3eb457e31139aa4e6dcfe5382fd
BLAKE2b-256 273cdf9860a84d115df70088995c893d9e9484f0945970b0085d7d1175a5b9a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9a3f84f9a89faeadb8339d25732a53290d70a5caab5e2ad958ea161b25e12751
MD5 f177899eeed1cfb43924c900f0f5a9fc
BLAKE2b-256 8ef027275400e3f55b1dbedee2421c14c4e95a05cb685e1d075ea0c56c29983e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 945a19e82b83e13d74cb3893ac9e26e49a8491ec904b3aaa8125ad73e7b7d786
MD5 cc9a00539cf980a63ed9d9f17b21f6cc
BLAKE2b-256 51183800a67000edd2f30ff97f4803f2bcc7add570bff8d25972737c5a3b4b48

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c66cdb1ebad2d371ad889ce9f23a40671a66f1cb1184f5af138bb5edb4b5159c
MD5 adfd85dd6a4e669e717995d5b488b212
BLAKE2b-256 c7257f9f7cf374bac43b8ac1631231df48dabc88dc76d4c7996a085b2a4d4cb5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7813774b19d207bbab8695800557be98eccdc947c4dad944db24dc6cc2b37682
MD5 d1968edb6ed1ea2028c89779e54764ac
BLAKE2b-256 d91d1e812eb98c48f38b2451596b9adc777f0a6378a3e3d8c253775685f72dbf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 099e31ccc8b67a26132c560c606c90ec1b97d520245243ada4256118fbe66c28
MD5 03b4d48ddebc18003466562881bb0f26
BLAKE2b-256 6cef1b20441eebdd48f94749779f61f786c11afb6c8ac738f349593c0b0d13c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.5-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6cd4d90c930efe47c4b4aa55903ba98e553ddc093514e6cb6038d42765f0efc3
MD5 b9607de4b316a6ca4c213515e0fea2a6
BLAKE2b-256 d494a3ae4b908710236025fbde72936c33dfc0e26d06dac4904f5c7ff8ca3681

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