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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

File metadata

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

File hashes

Hashes for verysmolcode-0.14.0.tar.gz
Algorithm Hash digest
SHA256 dca3dd51f657a92d15de66ee40802086e9e93abb4300e2615865a44086231e1e
MD5 7e6a9d0e92f7a650e8d06d72d23ab936
BLAKE2b-256 168831036f57ecde538e4daa039c1ceb6a89b7882be930aa3db9ae493d873321

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 187311958e32791135533743bd37fcf10f1a4d7ca77fab58dda902abe15c167b
MD5 0c705356589fda83e519f0e8156692a2
BLAKE2b-256 f50ab28ffd2334080457ef52ce6326284dec440a0a46c3cba0e0153bbae1562e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 788f2440a92708603aeaac98ce510ed1058c11af332923fe9c4c97f0276b5542
MD5 76253dce8c3eae2f52f75031d11711ba
BLAKE2b-256 f0d364bdd8bdeb9c52daca8936cc142d2ad6daa4b89509fc9c6413dcdb754f57

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4c4155a5732e650ab7dc58d4dbaadc50a3c21ebd711b2b439f5e931abec07bae
MD5 f3630a41db3b02db0e454f27db716be8
BLAKE2b-256 3a6d75f022776540a32bb94f3c7c98adc42df67232a1d0d66e4b7b85f31e781b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 20e52bb6d5f3b9a5aa4eeb2d47a1811e02f60dc11be4941c4053999ef0d0f9e9
MD5 1d7f8d95b9b9440cddc57dd1bc55ad90
BLAKE2b-256 a256f72fafb43a3667e37205b841f1d313b27e4c5f14563f9cb38eff11ccda20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 87ab56a7d8ebb74f197eaec41eaab79011614b20e5e044c63010411893f5e054
MD5 e2f880d3d0fa66fd9a910656a93e294e
BLAKE2b-256 3b846d4af9645969e76570e487a57709a4674a9059ad90eb0d9ef7fc2cc95aa4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b5109c80dc626180b41f5905c96c395f34dfd5f50834e94166ba67d2285d71f0
MD5 d92adb1605a15df4c867b4457390469a
BLAKE2b-256 fb37b2a4b28304b997a8fcb8f784bf69ae312d48a49136384b4e49891e32947b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5999f5d59d187ed61091b07c99dcf69802777aa322bc7558c7b0417b63dfe957
MD5 804a3741bd4f494a958342abaf74e833
BLAKE2b-256 09e3a5966ad21cd4d17199f65552fc3720ebfe6eaf49b19db64eca78dfb25d6f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 c007501df2635d40408fadd116e9ad174db34da24ed5c65622933cbfba158d23
MD5 d17e0815d079c41de1993f9626495f4e
BLAKE2b-256 9d3f74feb9e04197229bbcc5e46cad066efe0ca1ebf7179dce78a83d17c37f13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 368ee8da743c18b1670d0c2ec78ed259b83ffcea439308e37565dd4a3427d406
MD5 ec5d2af21db03a8f3dad2606b5cd05f9
BLAKE2b-256 013328d6ca363ec8c14a83caeb26d2de99fb775688331cd4d0ffac02855697c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0b03b9a89bc91b3153fa1d587016a59b5353c429c4a6e54719e8f1878dc1bae3
MD5 a1e655ef758759a973939c78ffe82a8e
BLAKE2b-256 75c731fb32dbdffa43b61e33690aa9391cc215329ec93ae0616a85af1bf0c4a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7cc3050a9681dd6ef3e85fd60af76f114c5d09c5da76683a39a00e5fc93b0941
MD5 16b45e74b6757f4ccbbe289a0fc27d42
BLAKE2b-256 690363b6fc360e11a865c62b2cb80bc2884a853b9a7af1dfe7cb1a08c22711a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 633eb3504d822716f14fc41126a7b0cc2049660e541bc4f03573e76660507a16
MD5 311753817d0668083e75ed4674cf516f
BLAKE2b-256 e1ba3bfd24275224a2a9116e947260582a870eb6814619a0550de3e048a738ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1c716cd17e751d469214c41bf59a5d55b97ae8a266dabad85695fafb73ed0bdc
MD5 7d552d08c5d0f9ea9f12e61b4a14b19e
BLAKE2b-256 e092cd144f62658b0422ca2ae5e14f8a883f1dc1ea8a99f10f24a4e922da50ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 21247e02c21ea862a3cf509c98faedd0153472c5fc189f44d0a451fa58b6519d
MD5 fdb72f78aecfd21b094197716803ae91
BLAKE2b-256 0b4c7ac351438ddf0b2148db003f850c04b73bd19540c78bcc78f392f367ab49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7c7f7bbfde9d57fa1d16e22af199b2603d34ab3c2f12f7bedc60584b4fbdf094
MD5 4e1086b0da9e6e04ad38cf518813c542
BLAKE2b-256 21f1077319c819304eb15111f0f66d5ccbb4c425b6e089b2d5263df72fdd0213

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1e84c8e0eb3ca323719dfe4ab2e84536cb8255b6eceed2dd0230974563b9fdaa
MD5 b59ebde00b03d9e4f2aad15cd3c20e94
BLAKE2b-256 e5812e55e09cf512df7fa05a486637571b502ffa80a6e9b24a426155d5b87734

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 27ccc1a61ac3768c8d73bf1dcb77b1cc0561b12dcbcd9b697f51caf473b9c369
MD5 357be3e47b34afbb1cc5cbaf2196142a
BLAKE2b-256 2e11d478e430ad16dcc19b1f9bf3f31cffede8f57f7d65f7059062ebd147c070

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.14.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6d9b1db5d93c246d197dc00ce4e0c7bdd6e2538ab6c6f2f584d98dcb25beb746
MD5 a5e6eed93c205b7203f7c26b90c5caec
BLAKE2b-256 031c51d88baeb29e3167838dadaa105b194d7bdf85da62996f36a6dd517ffb7a

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