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
  • Loop Mode: /loop <prompt> runs a prompt repeatedly — immediately after each completion (Ralph-style) or on a timed interval (e.g. 5m, 30s). Great for iterative refinement and monitoring tasks
  • Telegram Integration: Connect a Telegram bot to receive agent messages on your phone, and send prompts back from Telegram
  • 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)
/loop Loop a prompt: /loop [5m] [--max N] <prompt>
/loop-cancel Cancel the active loop
/telegram Telegram bot setup: /telegram setup <token> <id>
/telegram-test Send a test Telegram message
/telegram-off Disable Telegram integration
/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
}

Loop Mode

Loop mode runs a prompt repeatedly — useful for iterative refinement (Ralph-style) or timed monitoring tasks:

# Run immediately after each completion (Ralph-style refinement)
/loop check for build errors and fix them

# Run every 5 minutes (timed polling)
/loop 5m run the test suite and report results

# Max 3 iterations then auto-stop
/loop --max 3 optimize the code further

# Combined: every 10 minutes, max 5 times
/loop 10m --max 5 check if CI is green

# Cancel the active loop
/loop off
# or
/loop-cancel

# Show loop status
/loop

The loop status is also broadcast to Telegram if configured.

Telegram Integration

Connect a Telegram bot to receive agent messages on your phone:

# 1. Chat with @BotFather on Telegram to get a bot token
# 2. Send a message to your bot, then get your chat_id:
#    https://api.telegram.org/bot<TOKEN>/getUpdates
# 3. Setup in vsc:
/telegram setup <bot_token> <chat_id>

# Send a test message
/telegram-test

# Disable
/telegram-off

Once configured, the agent's responses, tool calls, and warnings are forwarded to Telegram. You can also send messages from Telegram and they'll reach the agent.

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.15.0.tar.gz (145.6 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.15.0-cp313-cp313-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

verysmolcode-0.15.0-cp313-cp313-manylinux_2_28_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

verysmolcode-0.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

verysmolcode-0.15.0-cp313-cp313-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

verysmolcode-0.15.0-cp312-cp312-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

verysmolcode-0.15.0-cp312-cp312-manylinux_2_28_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

verysmolcode-0.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verysmolcode-0.15.0-cp312-cp312-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

verysmolcode-0.15.0-cp311-cp311-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

verysmolcode-0.15.0-cp311-cp311-manylinux_2_28_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

verysmolcode-0.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verysmolcode-0.15.0-cp311-cp311-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

File metadata

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

File hashes

Hashes for verysmolcode-0.15.0.tar.gz
Algorithm Hash digest
SHA256 9c1863ab80107a48bbdf81cac7df54e300ab7e0b9565d6d34892f34bb1e97329
MD5 a7ff13a10c1a69d9b22b27a7fd8a7c1c
BLAKE2b-256 ba23e646fdc246fdf7317a0ba315adf752cf5d8f4d2611e75be7e1f040bc7251

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 56e6ba9864feb01f9b924f2dddca1d5b17103b11560deae47fc447b886acc3e5
MD5 a090742636542afc18088c87b783075b
BLAKE2b-256 3f485ca36dada2406d98dbb3d4b36e0a6b8ac65c974f1c063c21bb7f48adb51d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 4af0d51f24401931e54f7ebc7afe4c5c4268a25619835242337c088c55a4380d
MD5 0c3f9b827da86f6e6b5f61cfc26d2ecd
BLAKE2b-256 cbbfac91166e243bcafec21db701d22c9647bd9c537b2a90828734b548904efb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 dda804e430436bdf97e424f9d56841723d5717ecce08d3f88c479d7508751d4e
MD5 6f3e037b0db3e4b038a18f223cb94459
BLAKE2b-256 06aec6f9a1bbfc2b77b9d955481d4636405de0a1590b2cd282e4830da67765c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 73b094c93cb5f937d714334918c6b91cbf86d0bb339d44af0a61db22284f1ce5
MD5 f3d4833c07b87025259b836f7e1bcfa0
BLAKE2b-256 c294c86faf1720a67e08f4bc51fe3d52e2c58c0dc4d4d09b114b50f714365eb5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4b31bc9062a859cda7e5e94ad395fdef7e345a4a3f4f0af86f90ce17c8af3d9d
MD5 15c9419d216266bb9358740e36434fbe
BLAKE2b-256 e3b282ee1ee819bf2ba2846e2ebfe6a63c4d57aac80d5faa8f983923110d66b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4ebf31e4a81384f686c68e83c180eb501a70539e014fe12376ecdd6b46819691
MD5 cb2a6e6ca1135d5df2ead21a3467a452
BLAKE2b-256 d318b80d0d05ff60144be15e556f7e7711cfdb65f5406acf446270f210666b51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3ff34e592e599914a1b55ee0486dbcb4422449f999db4772e4a459800ef70d0b
MD5 8230779f2fffca8a7c95cc12e0614604
BLAKE2b-256 1f3169ceebe4fa4559c97bcec5a5d10451a64e4e0ca8d74c1730f8d3a2f69aec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 259b103436d96175c0e5c7583c03c5ac662581640bd62c899726f86496c41b5b
MD5 a90154970ac29e0df02b3e867eb08bcb
BLAKE2b-256 eef76f31a721c8cf0fd853181b3e0091ee826ef94d479cfa80b9d39267142d72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4dd1953483802eaad979d8f6957c883477e6d5e21021113800c6ba5759d0683e
MD5 1bd56a9ff0a7eb6e902af538553be57b
BLAKE2b-256 8c94ca7d7affbcb888eb85364a9582011443fbe9048b15c20843e4c93116bf69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fb95a49212761a275655e33170e86a9d86a3afc6aa0f2dd3edeffe1d6152e31b
MD5 a58125e8bc883ae0c811a8506e9f6b7b
BLAKE2b-256 1a0c4fde3c57ebe1a47474308f055d73afb95618a79b9bdfc7dbe64ca59d1c64

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1bf0f23f17567a7b4c1b7c80b37ab0f4e8fe7c6b395b257fc96aebdb08ffc0f8
MD5 707ae0a7f037094ca3d7976fa7aae12f
BLAKE2b-256 4ce1fceb385ed0bd88cd9a607e4ce17ee45e2e07f95f019f2bd7ec9c4545179a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8e6c6799605ed0a207baf765198121335f870b59d9a1657804a1aff572f00633
MD5 4dcae46918fdff94e86d6a054d06aab5
BLAKE2b-256 ffc6fd3b51989615d51336a6a606cb0411d744858fbd76d9251a260cc99cdddb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9d408f6aa19a675392056cc1e92bb11454d10406f3749dd67ee38747e258ffb2
MD5 8ec20b00e9d0899020dc3479d43bfb94
BLAKE2b-256 724c6ca0a37847c43b1434ff3156855d90fb439abeac39070172987c18b92032

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 131f84638ddcf57faa36477696d586e36632a85590714dabcfeb382d49a25ed7
MD5 453f4fb19a2628280cf862c5494b22a4
BLAKE2b-256 6b912199778bd859eba37e44ef6ed3390c21526050d94c50ab91262205c64c53

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 07eb87416aa7e543c3778301ccc82c7907908c43699073c9061554caafd46185
MD5 39d8173c31df6def1cd215f188fb3914
BLAKE2b-256 41959b48e60f288c53167a81c9108d41bb26a13bd38f3cbb1e42f1e909b2a55f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3de3134d9f9390a3f0105b149d583868a8db476b8b3d92ce201dcbd016db4c25
MD5 0a3b701da85627155e878b3a1f89da49
BLAKE2b-256 0d471b0370dc5788a8afb328e4afb14b6326efe169908102be3f2a7311edd3de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0af41faee7b4cff5ab66b38b7e4a5750b32cf6824777b3fb5f9cdcd6c86a088f
MD5 fd26de3cbf5966078a74d46eddf4fd38
BLAKE2b-256 ab35e4417a298dfb981ccd74fb5e4a052ccd641369893a73dd6c252c4321594a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.15.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4db69003c3c6ca4e57a5fbf25198161bf491ee4ca03dafe258339a7d7eba8050
MD5 26cdf5dea7b1a5365766752b09bf0edc
BLAKE2b-256 b67433826ea19770cc30fdb1765e10bed85a4db7b17506c059970287ff0f54be

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