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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

File metadata

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

File hashes

Hashes for verysmolcode-0.13.0.tar.gz
Algorithm Hash digest
SHA256 c144f42dbee63c04f2a1515d7e751194cf755db5045d2f4b0c066804cd3af9fb
MD5 e261346330e473c4a2d82f47b7a9896b
BLAKE2b-256 b75c0e99d5e318e558f52c84c97ede3b7c9ec8e2b2ae6249d1d86dd7abd60e29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ff27449d9dcde78202e9038f01d209f19652e961c853bb979ca42fd5e16c145b
MD5 6a403c8f246c32836d76db56dbf670cf
BLAKE2b-256 47da4e9832fcbf2ccf871c585e860e23315b670a00fca8b265e5efc72647c3b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 f2e6189a6fe5df9be7a98f938abe8bfdb596096caf02994701f542f7538a94b8
MD5 3bdf15dec7aad5d69d2465bf8ff04b57
BLAKE2b-256 920d0bb273156e8b2bd87fc9dd278f92a0cda7cde72b525d759778708ce950f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2ba574cb544c439c3d491a57a8c6d8276c827f22200f891eec2101448530eba7
MD5 cad745073744c28bde27d2e382f4c18e
BLAKE2b-256 309135c411506ef8f565456cd6558cd650bb559f8a315bd8ab0852b54c9f8f8d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bab9ac9a5749d314d4127232da7b86c69b3e617e16ea2be5f990e324a54354e8
MD5 07bfd12b5be04a94bbb44b3c145239ad
BLAKE2b-256 893cc4e816aa3e0bce659b4453992a8632d9e634eb24b594ba0195d6b7f87381

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e409aafe226542d051e4436d9621623e818728ae4fa36e78af07b262baf3ab47
MD5 b8cd03ae59845f598cd902e446a343d3
BLAKE2b-256 508b74085603556c9553959d23a75730eecca9c3808ac337fa8ed58064a7e573

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b56c902a463ba898215a23717dcd0a833408e03eb809e4a0aef948a375b7fe55
MD5 06bf5948278ee65a6523f8a3b352c6bf
BLAKE2b-256 fba5ef318609aa3a5d157c5ed80a02ce44de2d946e4ccf20040296e350910dc5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 09f7aba1d149c464618f7c8c8bb48d47d07a5f6504005149fa57220b5b9e5432
MD5 8f8054341c30b83d9b389f2a2b3bcf79
BLAKE2b-256 26de04e677ba3ad24724ea176b0bef9d87ca9d42fa0adbdf4d8544a4facd5ec9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 8258e20c4a5fc729663c0f0e16d709e0e6d7f65ea79da6d42b0142f6f1905013
MD5 d8214e136afdf1d65682ab1d9f27fe99
BLAKE2b-256 bab0637d626c3996969f113bd4801019e42fcbc4a8d81176c5b0863e1e0f38ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 480fa55b04a08938de1149a39854af6ef997b95f1ef78f12e0241a312c7da454
MD5 92d4b41502f4d776356c2ae159c9617c
BLAKE2b-256 759d748708b4b92a743b4b54ec143c6a2a3dc6e125f7b511d5c7577763cf2769

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 981dc1cb3ac8d9d2e17c6be5ea19290a76ddf724bb2789a2f9d971d00a700be3
MD5 4f545b579b77dec8dcadc76e7a8d830e
BLAKE2b-256 54046727740ad98fcf817427082a32bf6041fd6973959ac3b5394736b2ff0093

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7c6a65347be0c89b554182f7950a38278fc07198a5e5f258cf7c5d1683af38e1
MD5 fca4f4c74e5a982f347d1ecdb160ff36
BLAKE2b-256 b5d0ccf4c6753a377177399f9371c3b3adcced266a0eb040688830b2dadfc6e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d7ba83648dc989bd84304e562be25712423e2cd267955c1fac91dcd3ca82fbd4
MD5 c1a31d5e0bf9b606145f58bc56f360df
BLAKE2b-256 203e9e51356252797ba2c4d4f001ce7e43a92e5a5158ceb2f951b03fdfe45174

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f05a20cd7be68004ea1d53d4d8fa8b23221598a85e280d9d0fa9cfa83d4e6ce6
MD5 9727dd2f865f7946ebaa7798ab8484b9
BLAKE2b-256 9d19c6e036f3261928dcafa0d5086a455db9ee624e3c5626bb61a673fd994587

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 6b4bac523ffb8a7667d145f510c5e74bd8dd35f92f3ea0410af17564b7d330ea
MD5 6250002d76ef001b64510bca8f362015
BLAKE2b-256 336948ee0af24c9f368ebb8a2f28d37893f50a392a062125ebc40a9bbc18569e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 58f94c60be2756b981500e873854345689f26d57d6d86b7a86135601404ab65a
MD5 7c2501b4ec03fa98fe01298dc1f1a45c
BLAKE2b-256 45fd1f03446811bacc3b956e46c67d1fc29f03de45f7638bef861e2bd275db37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 937a1d9042573e65e814426257e38d04d92716ac1199f1d386045d7552dff95d
MD5 fd558a09026fac0b8c7952ccbe326038
BLAKE2b-256 0c4e24a746fd05af2dac64e824aafd793d7d0a539728db9b4de6a5b0261b345b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 deddc0193716527d01d01dc0630a0cea2c55bfadeaef68d01bf5ac8662c5d074
MD5 110e142294f2b858df53e2ff153b0386
BLAKE2b-256 30ffd444e5a9ac372fb450e3c812677cc2e1dc2d16e6a0dc53cc245b41b4f4ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.13.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 79d6f3ba4cddc7043cfaffe1e5b4de3cda9fdd5ab9ae99b0e853038bb220a4a0
MD5 97ddd10516a72c1231102bc0f72df505
BLAKE2b-256 8d49de7eed90ccb36c6b7d8713d0c678da2f77cf8bf65ec37a34ab9a3642a74e

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