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 read-only analysis using Pro models before making changes
  • Full Tool Suite: File read/write/edit, grep search, find files, git operations, shell commands, web fetch, image reading (18 tools)
  • MCP Support: Connect to MCP servers (context7, playwright, etc.) via /mcp-add — tools are live in the agent loop
  • Critic Verification: After tool use, a lightweight model verifies the work was done correctly
  • Token-Aware: /tokens dashboard, /fast//smart model selection, rate limit warnings, conversation compaction, and thinking budget control
  • 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
/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
PgUp/PgDn Scroll output
Tab Auto-complete
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
  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
    registry.rs     - Tool registration and dispatch (18 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 (226 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.9.0.tar.gz (78.5 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.9.0-cp313-cp313-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

verysmolcode-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

verysmolcode-0.9.0-cp313-cp313-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

verysmolcode-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verysmolcode-0.9.0-cp312-cp312-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

verysmolcode-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verysmolcode-0.9.0-cp311-cp311-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

verysmolcode-0.9.0-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.9.0.tar.gz.

File metadata

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

File hashes

Hashes for verysmolcode-0.9.0.tar.gz
Algorithm Hash digest
SHA256 e36ee9acf816a4e3db62da8aefd4bcb34b7ac646c9169146a63c6452af011376
MD5 eff4999d9d54cbcc5d1f1f4083c0aa9d
BLAKE2b-256 151ff817b0af33960bc61f8a131fa423265c39e574e8a279d3df8de990467d97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c31a50e3069bb3937b0b69f7840f3fd4caa375400df0202d9db1f0741be096b1
MD5 227ab8a4740711cd9b9a517d91295b60
BLAKE2b-256 aa23d49bfede602604f30fd62dd12f21f6c93042ecc3c1e1c8255854d99f5ee2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 8bd157f8b43810bc2e19278ba1fb41720266705339ba4deaf8318ab148bf32b1
MD5 dbc99e10d8752d32c0773f4af039bab9
BLAKE2b-256 179d3a00db1728f23f8b51b5f2e3ac604612d66e65721a7a824dd780df1e78bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 79b7d483ff6e609f85d1166a2efc55f0e51e4fb19b9d68b605fc24cfe052ca61
MD5 a319dc5ae8b9e5beba89380884839abe
BLAKE2b-256 733dc6e24b14d3f621761e809e4d10c540af6bcd6d3d4ef9a8074aa3cecb00cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8e1afea4e9c1ca9de0ef8c4205daa475bd2563a29b039e4ee2b35c65f26813eb
MD5 ee1b4579d4fb48a22ee886802113124d
BLAKE2b-256 3c333a45e7222b62e7f334ded050c1a39b505721f965c1237fc163414cc85b12

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 649f5768f9308dd0f8ae1abbb8a701722d7d63f07411a9e9f10f1627aecab9d8
MD5 4605e1cf0b7e73e5d20a63f81eff8066
BLAKE2b-256 69e5028943f2efba3fd832e7a4ac0e85500dd21b5ba8a98882fa57e2b4184de3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ad79d499dacb8eb59e061dcfcef77451e1ff1bd4be3ef814795f65ff08efb856
MD5 c8c0086f57d89f08fe27001d350a5ddc
BLAKE2b-256 004ce7e29bf30725d794597ecda7b22eebb3989c031dcc4806a1f61b8dc59444

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3ead877945b7ec6f36d708a00ae6a04ee9ea229e3d356dc1320deb578f942938
MD5 94332d085efaf8b5629c025fd67083a0
BLAKE2b-256 fda9d3da6d6ec10b5e2ac9070da61c3aa5dfaaeb1209e76a4d184fdc7b5b06c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 1dcfdd7e692b12bfcd6393a8075f83d38f0bce99ac363d272d464bf16033a362
MD5 b9b9b956132398b10cf066f396bd8503
BLAKE2b-256 4a17176b9c01717bbef356d293af50ec44d603939d87d93b600532332d8d6a32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3ede0cd54f47d71f5af2639c6fcec917e78bbb10d5c5a38053e5f5de14c1c6eb
MD5 1415d3511008de1fbe5fc9de07a78c50
BLAKE2b-256 0d137815872354b11ba3c2fe07fa79ab0f9f6e3151bc55c6f9e3307707a6ad36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c89a87ce90318ea472b99cb6547925fc2baccd0c6f159b25950eef7a2ec04788
MD5 5cdd6d146725f2e42b26a0027bc07221
BLAKE2b-256 2cf149c9809aba0517b6e467b3b36169ab6fbad9ebbf987bf7a161936d0ddb45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f73ba684cbc3c77a393d53f6285b8879b57859d83a991215dfbf020be55fffc9
MD5 67efd17412e40f74e3a8e959e7378d84
BLAKE2b-256 6ddc386c6c6e1cb5e3a3775d83fd3a4c750fb921469254331b2b09eb2c2990ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 abcbb31d61fe80e32d16de2d801cb24ad0e322f6dc41e89e5cd449990cfb9196
MD5 cd5868be4753edb36a4350e37f491984
BLAKE2b-256 b48fa6b7ad8af93be00183e87e15c6e7bff39defa97433ba4b5d3857078ca2c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d20c8c2597ce298a63314ba0e4684abe87928fc6d18ee4b85c57ccb2c74df007
MD5 d339dfbad7c2fbb10516698eaee3f28f
BLAKE2b-256 01890e04267fe0dfc7a0b1aa4879a5b677a7ff74754dd4748d31734c4e9b2002

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 07345b7342f8cb23f0486aeacddedd3d44f2cc9347dadd54e32ed36a87104df1
MD5 a4e2d0dd3575496d02fb1656271f00bd
BLAKE2b-256 1e2a56927f3158d354b566bd2ed0fea272430209bae8718c0179b2c8c8828487

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0aed2d9332cdccdaf310e806c9206ca78751fee889c209d9fea08675ada68874
MD5 85ae715792add73eb57ff87db6566042
BLAKE2b-256 41f86fc70f1805cc546a93576a41541aae6d265f39d1faf4c96566409da63d63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4c6ea6716bd39489263104ab7d52d64bf916ad24b7acf4a35955c2aa28a88ac6
MD5 954af0b75f19fc94ccecb4d694735803
BLAKE2b-256 cdec8207645c5734165916b3a1bfd817a64dccf50c547b5e2c39fd94df0bd0ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4eaef8fac5bb8d3608bca8f1d512757cae0c748806dfd3ef61dbfd7aaf5b8d0b
MD5 bbcb0df4a25e11134c11353136dde9dc
BLAKE2b-256 a231c318d1571a308271a5d41eea56835906a9055dfabb4564db1eaed5e02811

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c63bbaaa65a6e9ee882cec644e4bf776b81be328ef928e571a8ad85831a89392
MD5 d3c596c25ebbc916b78e7ed67ed3d9aa
BLAKE2b-256 aa2d7a509ccef7dd7e22f43f5669a45caf7cbd1bf73e67844222915d0795c0d7

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