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.4.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.4-cp313-cp313-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

File metadata

  • Download URL: verysmolcode-0.10.4.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.4.tar.gz
Algorithm Hash digest
SHA256 2f228b35e35cc981379ed61f495dcc9ff4a01b6877f0cf4450a44c476f82f8ed
MD5 6dcf603d6f24e2d7b79be17978003653
BLAKE2b-256 657577ebb014d4e6234ed770e2eea698608334b607995679a8be1549e90a5501

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2887f9053face8ae73a7fca19121ac067ebc3301f80d51d58db1320f15b9db71
MD5 445cbbb1c60615e712dbd8322a5ca3d8
BLAKE2b-256 30fe14e48c68934e6a517565d723d6909363a51a8b979c8b50c59f817bd7958b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 6c8cd32c9a4983de41a3466d1cf168a083186a37c4739bf9bacf56d9d3066e8b
MD5 0ad5635ebe9e1a78725ca29c6e9aa184
BLAKE2b-256 70d55e460dfe61a967f766f386f5a1e87c941f29bca4735d92feb0579c01466e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 af7604c7a22a6127d96f22dcd1166b8a5500cf661027a444cf8bce69fab862a4
MD5 4fc9af57e059fa725b19121803c5113a
BLAKE2b-256 0b1964f9214986d1263af58d158c8aae38b1a2f4484e49368310b7848de3e6c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d3038b7349a380363c188a46d8bc73a3740de4a01801faabe4fb9b1dcf402d24
MD5 5e2ac12be67b3a7d7fa84ffa30d7f157
BLAKE2b-256 978c2085bce486924a492fb27c78b98960f20e424c1c555f45ec6f7fcc83c34b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 97e7006b86c3c9370a55d80700961bb298c084d7791029976ab5c9d34a23ad13
MD5 d65219dec2c3c9e08fccb5ff17871bc6
BLAKE2b-256 e3ea30cbf71403a6c2c1615043a37b64836948df7d9425ea042c8d05ce9c40ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 89938c70acc5e0be91e9d8ec7df305b0802fbb39c4d47af2aed32bce50b7732a
MD5 282975cc93673d92bb19547f04945d78
BLAKE2b-256 762debf0f10fdfa008f499c97fb1d824c2043ae8b3cf25ad442c4a375f376e38

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 62543c4d71ed366a01ba78235f6f69647965cc67f832f64484d883d01d45c199
MD5 b7e144ee9738057d9762b879ae798152
BLAKE2b-256 b80555935233c1e8a4c550f2e82ccae55c3b185a41a4be4f7708834490e71e36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 f7ddee3c61fb3dc8873a8cdfac7ae56c7b35239f5748cc1013784b26877e3dcd
MD5 4b38d1623a593600438d41c04c3ae130
BLAKE2b-256 7e7b893c791cd64355c30333177cf90b6bb3930bfa5bfb6677a4c0307b78c6b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e3d9bfb9876dfd574a1ee2735a9f8abe381ad33b3ec4ea68449e28dc723a56df
MD5 07ffab39dd22cf545d138506ef4921de
BLAKE2b-256 f6d096f143e545eeb21446a5215fc18ccd5ece04368d6ff49b50d55646425401

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 37b329402931cc3f95273b01ccc00a1a352b2d8924a966d57c1625b7b6959a71
MD5 8c8585f4e539d756e732ef802e6b2a1d
BLAKE2b-256 672a738d3b07cac644eb5bac677fb2b5ca5517b9220fa875a844e3ac7cb43c28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d26891990781e741b4c34018e445765af2822c80a0f3ed9249729e1beadf5872
MD5 5403dcd66b0f292aab535afd0cbe75d9
BLAKE2b-256 5b80052fc6dc31a93d20b644ee6dab50e23f1cf358fcf32a072057ce8660a6d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 95fcefdea5f5af15b5eebe30f84cda08d7951369f16c59f6de5249af6bfa2c3e
MD5 250c5c5fe6532f93a541e1f708f361c4
BLAKE2b-256 dd9209a4154d54114e8996b7e4f2900d6275c65f47392e217e2921b2e0e81aed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d17f0479be7b53f9caf8de004d29d9544a850ed16021ef64ba9556a601dc9de6
MD5 a99c5a1d799621a3e4c680b51ac6cb4e
BLAKE2b-256 96e9dbc9c3dc943a0c1edc61a68713ab27a1a5eccadc2711a3dde1141ffb388d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 aca8cbb4bbd448aab0d301f1a4260218880096996b108519beec710328435b9e
MD5 d1f6bcedf2df6709ff2d84ee1466d96d
BLAKE2b-256 653c6b56856b8770a886340c87e632bb23b70b545770a5af76d37b7a0e761d2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8fb691b66ecdfe16cfb316c4b1a0f877e573296c6bad88531b74b975d8481da0
MD5 52d8b7f162fd96688269bae6d02cd17e
BLAKE2b-256 9400fa2079e35aa92f3c000147f083c6dff458d0a6bb6eeff86b43dfa0efc3b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8824367a2950fb441e98e545dc5ca0c628d6bb74d6692cbd403a06656a9f0c5c
MD5 6c90077519f481eb7afc090c5b400106
BLAKE2b-256 2dd4117b0e7d7e50607fe8d61e223e48d137825934eff1093ddd2b48040c0ece

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f5cc18a755c650061c19c6f877897407128ccf75de10b65e3df7be6074941d6c
MD5 af8f7bbedd32c05bbbf0a0660b4013d3
BLAKE2b-256 ceb4dc1b4223d75f6609c029e467ab657d10f4ffc030a9e91ef3fd9696a0b5bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.4-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 54e7275e7d30a519d38e8c8d6daef5d67d3ff8281c0fe6323efa7f719af3cebe
MD5 58ea0b9eafbd20d93c2ff4dff830a6a3
BLAKE2b-256 fb86fe14f1129c21121417b96df766b560ef3718d9efd4d3a80e50ee07cc3895

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