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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

verysmolcode-0.12.5-cp313-cp313-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

verysmolcode-0.12.5-cp312-cp312-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

verysmolcode-0.12.5-cp311-cp311-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for verysmolcode-0.12.5.tar.gz
Algorithm Hash digest
SHA256 732988b2e12248b0efce696146853d69aa81d6bf6bc49dce2bdb9773e1c0dcc8
MD5 4558c48fbf1d47844e603cf490764784
BLAKE2b-256 3dcd281b2a122031bb41e8ca14d53b30fec0ab90e3913a5b3177af8db1b52213

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 016151949d671d177188073f374e392866cab6dea2a9977f150a2fdb3cac2018
MD5 42bc6bfcf892bd1c4133d47d89db0558
BLAKE2b-256 8ca6406111fd5ad88a2a5ad2d5e3510760620ba7e0f45b87f393894799a711b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 d1a10bf67eb82a870d28b5ec3e7f331c8a278752c7c603ae4fdaf35fa68e6bd1
MD5 c6acc09bb41940ad5ae34af650535088
BLAKE2b-256 c38c559eb64f4854d1c067583ca6cff66ab2e179f971d108dae9398f290379de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 22c6daba167328de3325d82936d80e0174333ad4ebbc0d42234968edd8ca2ee7
MD5 32df0732b115fbf506e7cf58fe6402b3
BLAKE2b-256 e79d47055cdfddaeac9358d4ba9c7e4591ea63484bb3a7188d0c34a69e51eaa1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d3a543156132e9d91fef09e357aa4d128f6a336bf2aa11a28b2ab01d1cd30acb
MD5 f3febde8bb450c6d51bf7f2b354376e5
BLAKE2b-256 1bbe5481b960b87f69d66ac6539a04a2473f0963c109c750b38bb10760321797

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 195fe0e5b3208e25ce3f9b53d185c8d619acfa7383dda4a2ec44e1aba73c3dc5
MD5 4bae34182d06d46327cc984c8a5ebb7b
BLAKE2b-256 66f54878a796fc65181c06f9695b64bcd5654b0e4de5296eaa772dd6a5546323

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9ea4ce8e4c388392eea3ea04cf0101f0a1a721d9c58aee961f1067e932ab8a76
MD5 d13505af83fab78f3b1ceafb265157ef
BLAKE2b-256 892bb40e008b2685127663965c1e12cc39a76c9e1bf720e1109d2bd74b8bf154

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2060742f4757e16d0a83ac1a629269e61c73940cd3251f048a396816e7c653e9
MD5 381a2161da74a2f5bbb10ce7bce3c8d4
BLAKE2b-256 4a0cd1cb1c72597e239289b520beb227bcd5b26b02a79fe440127579610a37a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 b9127bcef65b61b088733b10ee600fd96a9d7a6fa49563e456a3c743921de4c4
MD5 784bf5d6b88e698ba8836dcb81052f59
BLAKE2b-256 67768df0f12d8b8f11afed73499f7303bae9821b46f31c3cbb13ed066c51aaf8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1a47e33f83201236765ff561dc05448be6ea4f0b2878f65cb4053996e87f96a0
MD5 cf6b65c99075f3ea65d12461defe23e8
BLAKE2b-256 24715948d030ea92d9c092e473c96fe0cb529ae2760163683296a622b0697039

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8e15ee29eee6f28961ce3ba570c41562af4c4b38423e9c47dd4ffe6e2bdae8ca
MD5 1d9511d38ed9f24d293ea8e77ac6a09a
BLAKE2b-256 3e53cdc391e321946bcc3fd0998cab283016e04c7810b2619e3e775df52fe618

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 556f1637111214f9fe5ae45bb0bc0df2b4004430bb87847a79e95bb4f9839df0
MD5 3abdf1752041a50649ff28150ee0a631
BLAKE2b-256 2f81d8d49f55b41131f24ae478116b6a793c5cc81b8d5e88a42e73421301e843

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 621e3cf1ae72cdd5bd6055c1cd666a5a22a997fa8b75f1204982589e752f6def
MD5 659caf1b4c1b76c04156a912704faf4b
BLAKE2b-256 60c0769b182ad09f5907e23d79b2569dc64240830265f443de28ec4f652c6750

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e236c7ac9f7c9715110e2d3c82562b45d3e5e68b02b822f10660a12302d9852d
MD5 5b858148e642e77a720fbc077ed48699
BLAKE2b-256 7312d2a5ca3c4bed3d5c6b755648ef22388fe110f3a1e73599b79c6bcaa79eef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 b6450fb65e79fe014090275407abb57d9bd14e1b220d9e5a5105b4de173aaa91
MD5 79fe3a4c2c3e200794c82156788a54db
BLAKE2b-256 354caac37615b2b4afeddb4b9ac5c7479b8f11513102a80c3440ab78fdfe4b9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c27a99857d67f3a692c4c0f39f6f72bf0c9c4d588528209ae67efe170a7e8d3a
MD5 c2277bb92b0e12b5ae7389a79089420b
BLAKE2b-256 10894ede1ea2a9b69232b54c5410a458578322dd3c499e3272c981a234acf3b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 76508d8810b286aef48ca3a2b5ff388699aaaeee7ed8a8bc0a4ed9cb8fe9d37f
MD5 493ae01df76759eeb550d28c33df8bb3
BLAKE2b-256 823e0d08c25e8cae049074b6cd76e444853fe0843d541bb2058a35c44209fe61

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f970e0b533ae1a701b4a1d947f313695f7b1d1148b9a7559ff667e7213109ff4
MD5 2653e49eb63be0ae86e5ab1b5aeb88bc
BLAKE2b-256 96aaff9813ced387d1c394aecccfc1c218449a80142987820333123badf0290f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.5-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 092648eb61af4429573ba21a18328d2cae4184e1e42dcd3ffd418bc05009c0d4
MD5 63f0c63e09671bcf4fb1a032740c99af
BLAKE2b-256 657fa2b0849938944eaaa36ade3034e7f7ee0e17d0ab83895c6cd4c1243d3602

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