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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

File metadata

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

File hashes

Hashes for verysmolcode-0.12.4.tar.gz
Algorithm Hash digest
SHA256 96dc412b45e955903571fbcf7cce21384f71ba295039d8390c67efe5c1891759
MD5 2baafb757303a81da0b58d51f50ecd76
BLAKE2b-256 95e011284f9e7616e99fea9fa6669886fc77068f64731e1149180e68f886bf2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9b849ce188e50ab710cb60931f04c39fa225a6a4d444d754534f8dcf7c200065
MD5 e6ff2f833346a4b8426da92a3950a3c8
BLAKE2b-256 decb4909b8edefdd30f0488f89ff9f603348e062f02e589398b132f8ab78ce4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 6169c3ab4615bc5cad0e7ed4fcb69c2be3ea65f9564a902f2af04676d05dedb0
MD5 c2a2d26f959e369b984c7c97ba7feb77
BLAKE2b-256 c213af86533539255d53cb78efedb92e128de30ba2b87bc37e204a3fd9a88907

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 74f865ad9a91a12f0b25541a79bfb9b40afcb34a39c4f1e1ad77a671f47ab4f3
MD5 96d52062e17e92ae3748d6185375c1b8
BLAKE2b-256 97a2b9014b9b18451028e2db9d9994d2463cc7b5d1f57d2e34de9a8b7e27b7f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 064add79e9964505a5a2bf13979453198be05b399bc1333267b4b217c8621f55
MD5 a94c52038929e0628f1478b8a71418e9
BLAKE2b-256 49c7815a307221b92855f219f7e11cd8d68378057e4b553ae8cb0e3dc82b7134

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 12741d06da4123988434e30e75e73bbb0788b7a0a88b48221af67a850312c903
MD5 44a1a22d15bd00a672b31aeb863bf0d2
BLAKE2b-256 490eff6e438f7f15c9966aa90784f14cbdfee6ed5c03e00159e63e15eb6008b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f6d6179eb69cbdc57b5a14fdfcf9df6c83dd67324b8023ef1eb94f54ac770a7a
MD5 179a2e407caee53e7efb7623a1dbabe5
BLAKE2b-256 0e67db0fe63da03a3bf4ee85bdf6a20a7ca63209474517f34f76b969d04c41b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9285076746ddbbe8789863d21bcb905ff40ebf6cfee38cc1d584991c254e0561
MD5 4cef0e21dd2f1bf3d76cd9fda3b74c6d
BLAKE2b-256 217e34ff7bc9ae116197993adc952dd2b4440dd61de73843cfcd923263339f4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 e5f0f30bb224027991de4c8399c1bd067363739501c09ec06d7217c11564a6c0
MD5 1125028b06c429cbfec9516ad6e295b0
BLAKE2b-256 1268bbc61f52beda0e9499162769a8f9453690cf2d549fee95c765d9e64f5ac7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4e3c338459b93dd68627cf16901f5eac3a534a6108a926e21c8a7856b6aa8379
MD5 6de1a1caa0522d7d608f0ba61f715a8b
BLAKE2b-256 42934b7ccd24a384c45d3e552fdddb6720f20b78ebae640e223ed969f0fd28c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ea84f40b2ad8844e6aed380f3acdef4c6003031b19cd204b1555c0ea59862b14
MD5 8eb2bbfa569d430875f309763a1840ed
BLAKE2b-256 ba98dec12943dd32a76989b0fc87860dcd0e950d49bcbfa4b8ec24ae6664f34f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a3ab0ca4ca9db5017f8e354643431b9d94ce2e104ded8a3636b0b85db576fcfc
MD5 60b5dfe0289f2390ee4a5358117b87a3
BLAKE2b-256 278ba69f226d45845b0cf045338d74bd4ca0a8be904e4f04588a148bb08fa072

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 586cd07a1c28029bc1e4a82fe4285a2092de000d4f3264709a71929d9e24363c
MD5 8d6aad4d618a15bd3d964493355e91f3
BLAKE2b-256 d068a652d9f555a0e2950298b6421fb4c3e6ae47b7714dc596348f4db87a32ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4ef3560b0f03b8c8765fb0c59ee0ca6a723b46e051153943388c60037d2c4136
MD5 9571267fc35d3333b954da0bbb492b62
BLAKE2b-256 c22813ca4691325735cf98a3329d39ecdf5e54cc834bd07abff4d615f165a13a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 e9900d3f146e4d1cb5bd800838a8e628ce32a8e2d8e0290531a7cad4678b1075
MD5 155c6de63f7289981be98651eb7b09d1
BLAKE2b-256 0ef1f0e8fb064be298cda5b2d7b2113599b6999aadc94fc6700198ece73fa46a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4c4f81926b049224ef56241379b7c4e6878780c4bc46c52f0807384fbd3e4d08
MD5 b9ff1319d60ce1a31cfe0ef6b1356675
BLAKE2b-256 d89f0fc47fca662dbe161863bd20eab78d96a93eb8fdcf001567797a627af4a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4badc9718d9821d5ed1f6ae0a9f5a835aeea504e589c7e110733d820f97efeca
MD5 abebf6b5db829b6d97066a1809b4f6bc
BLAKE2b-256 2dd18304078835fd3a76f61a1607b57044b347cc5775c91c2358b66ad0eebd52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 11237c8e22e8f693486f0bb030a5bf5cd259bc2c71dc0aa3a4551616d959cd84
MD5 0c279fc60ea30514e5d927c9009a91cc
BLAKE2b-256 0e64c39cb038ea4380fc670e2fd0146633096c60b639e5c8ce1193b6418e7ae7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.4-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a68eb2ac451effd5324a799690dee1f95b07fba2f459aa526855e1d1d9d0673e
MD5 8b4c0ebe2918494886611200f06f9e52
BLAKE2b-256 ff0f0d721bb3deca126e6248a70edce7e20fe8982d4d782227b46fbe9d432b85

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