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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

File metadata

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

File hashes

Hashes for verysmolcode-0.10.7.tar.gz
Algorithm Hash digest
SHA256 16f8092b2faebb975d1a88e6560b49bab751852772782774a1de61d025708511
MD5 43dbf03ae333f4cd6cfcfef803c7f807
BLAKE2b-256 560d120a8712450f5526c2829e1cedaf4b67fab1813656d378d05898378ccce7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0fe06c8f08efbc4ccb4f030e783f2081b8d518ead8422f3589a3bf5eec89de24
MD5 fe3cf2f922a74f2c71106a1eef053a1b
BLAKE2b-256 e8ae0fdd75e97562df22cba390410975c3390c494b0d68b713ad9e02ad82e4a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 3e0cb9e5181712e470ebab791e04b9c515ae410d5441956ffb1223ac6870045e
MD5 26f08eb8156258a4fc8159c4e34f53b1
BLAKE2b-256 4b705d47dd762f925056e7b35b7bbd475832fd3019fe20a5eb007bbe589ee2c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c64f61d7e29d2169150dcdd7e69a7b17bc22798fd21597b70be8bcd48d0388d9
MD5 e2f89c69e3370870c928e742f4a5ee0c
BLAKE2b-256 e3d1a4b3ada4ce9a3b38497ce0179fc212a0e5619a26d55ad3b0c5d5eef93420

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 65c41254220a490a945a68d911d58832490efab0ccf901f45f3ea42cacc87c83
MD5 418213eb5fb7b803f829e4f98e1aa12d
BLAKE2b-256 cdb79bce8ae4ed5efe19826f4afb6a82b86f80e6a5e8f249a88373da864c0b24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 98ceb51cdc13308a73779caaa5e083f3ebccec85c0868468a15831f539ffffaf
MD5 175d3bd0edb7fe00b962ab32d54ec3b7
BLAKE2b-256 cbc11bb48447b674954d1398d6bf1938b6ef7d9ecf174d3b2fdc928f777ec129

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 913f7cdfca50e7608abc5b7aaa19d68d16815b5cab884e23b78373363df3d8e8
MD5 b356cece90bc96590a3fed29ea182c41
BLAKE2b-256 e9655710a8f74b6eeb1ed89876aec85e5a2e85c20de574502b39022a9202e6ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d47eeb9c72c3c1310bad493028049493241e818cb00c7b9224551fd33a6c2c7c
MD5 e783b05a10c5750c33dcf589ebad5423
BLAKE2b-256 2f2ec58cf697b6ab0716dc24fe525fdcd7fe1b6923654e4d0593afd6339bed42

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 efc28a9564edef398e16eee4059728db590a577ba35e80eae64bc33abbaa3c57
MD5 d7e97a19780c62ad38e08a2b68081031
BLAKE2b-256 d687a7ee1ced1138594dcd301e15cd907a3ea6edc7285b7076cb102c7ac587a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9ffe968c2c7f48ab0fdad47b8c34264fc8dbddec2fd96913c1337f1963c90e93
MD5 c612ff4eb8b0637a54b500874069531f
BLAKE2b-256 0207f9ca7223ec504f7c29d0787c191196fb6a2026ed559a062809baadab3663

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3fd2535029c9f174ab350cf1ff83edcf153b73d94bfecdfd7288d43ea8e654e1
MD5 9f755c3dd2afaac50d998cdab6768a04
BLAKE2b-256 07655081a49ebc010fd59d0f3529ceee0e6c5bcdbe36f7d9adf4f2de2e46e91a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 daa8c3fb68343f7a3b18d24e63b9c2801b2a5992d4ee8740d721d0d7192b30b6
MD5 d017495ef26c8db78a2dff965442a8a9
BLAKE2b-256 81bcbe5bb684b4638739f13207a3dc93c7c87c1d45829c73fc6e939ba11062dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bdb86de9e546fe185034f76e52ca24e750f97aa8b10376534f3f2473730e4c51
MD5 80818ea74e535b96d5d7ad9a540d824d
BLAKE2b-256 5c9d4cbdad2b6a1f05468a5550712b4de095e5492507fdf595ebc76f35ad0432

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fb6bc29fd7e38d6a5fe66c4d36472764334afd5a4947ad1d7b2d66c17d032fe3
MD5 3f561a6579fa9aa44f63723fe6a304d7
BLAKE2b-256 4fca74d0b180859b6c6e2d8afeefbf9406ce64b52ab042601f4937a3861e704e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 b972b3a1009ea8d78b52d96c997966fc6e810982d6e1c05eaaceb3f673009185
MD5 8b52eab49255f1044b8691cf964a5cac
BLAKE2b-256 89f93825387961233f622c13bcb468d57e3c731c40630b27830d8289b6e5aa45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ab7b5dd016a249ed10e7a01c0bec075080ed704a7f79ae6593b12ec5440cff48
MD5 75761b78ccdae2b0cdc65d2606d6b185
BLAKE2b-256 e194f3499a5095500b753e019e4de9021ccbc4566a1e0d055d4c546b84b07ddf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 93dcdb3ad96ae7ce25fa7e9bd5540b801d012d3192fcb9ec1ab466a3a0fae22d
MD5 c00ffaa409fbf53b8b9a043f5a74f931
BLAKE2b-256 85390f8f63180100d3836f678d6660d7139f5bf808e9dcb529942364929bb216

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b80fd34d27acd9ad58d3a27ece7356fccaa132227b352437f50236ba7ee456db
MD5 8ed6699dda97e29790ab139003501cbd
BLAKE2b-256 11a53c15d8fd02b095333c9a7bec6b6f47a22a51974b35427d869c7b3a52b430

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.7-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 38618c7e2f249ce0cd2187ff762be0c4e570d479642aaea93ceb13deb5b38d1b
MD5 70d05d16c1e7066808fdf0e6cdbe2328
BLAKE2b-256 9e9215e6e6e3da28fb3fcb94585a350df821aa42189e9319a654cff4bfe73628

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