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
/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+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
  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 (228 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.2.tar.gz (84.3 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.2-cp313-cp313-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

verysmolcode-0.9.2-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.9.2-cp313-cp313-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

verysmolcode-0.9.2-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.9.2-cp312-cp312-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

verysmolcode-0.9.2-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.9.2-cp311-cp311-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

verysmolcode-0.9.2-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.2.tar.gz.

File metadata

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

File hashes

Hashes for verysmolcode-0.9.2.tar.gz
Algorithm Hash digest
SHA256 8242dd16e50c49bbbebe25960f030a134429d55a7606c875c7cc7a4f559b3fad
MD5 0750cf98970d19fae92c8abc1a0b7618
BLAKE2b-256 8f728b33a57ea01ea7a4b50b366d34311b7287a7f8977407e095e49ee29d58f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4903a04353791e0d73891dee6ab6791b897dc11f97d1fa37a23076bdcc9ac907
MD5 06780223d53e094a3a1c0a9bc3dd8ca8
BLAKE2b-256 ad036419ca892cc21410dc281a3405e215fba57cac88b90a98bd6a62e35c6452

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 6f23fe8704492da5912683539d3a768b6480f12f0ea6150a6ab30023cdc9d44c
MD5 650b2b612a9105f90febf4bd0ad716ba
BLAKE2b-256 10faabeb838cbaf60ae398d68dd069743895103a832e1449ffec33a0f3afb493

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1bbad7d18f946e893915a15155a3db54fcd6ab922b9394fb8c9b830874ec8262
MD5 bfa1c6c375b13495be569aa8e46eca32
BLAKE2b-256 ea077a31bdd8cb1299c941ead5a57bc0bbb9ad89664edefd350effafeb3cbb8d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 36ef97e48c739580b2de6b618d46a36cf6658d11bf01ec2ea423833865754e01
MD5 9c73546ede729591580df937390e96bb
BLAKE2b-256 72533d0a1cd09a48549862c20d688675c2a2297c40435a1be51877923702efd7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 067304847fba6778916a23ac69b66ac277865a5d56650414825aa173f497d42c
MD5 7e216e0558ead8bb088dfe2d1b51b883
BLAKE2b-256 6a52eba14af0ab3c16a0db3df6b834a1fe0da6d9647e850d7a809eb44123eb7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b6bdcfb02ba8c0325e86bf5acde05f2bf169b594167c28a8ab02a037d3cfb135
MD5 cb048b68c9988273bcb6d20a4ac56ff0
BLAKE2b-256 b132e45c0009c12589a42d13f2b336205b6c68fe1b91a1df9a82282b520e5d43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 790f8e549d777e1169d2274b2edad757aef10d807cccc48de3cba1bc35e0edce
MD5 aa30e3bee2e8d79801a84704bc3e5937
BLAKE2b-256 6eea20aeae6c1b4d0883c611b08c27bbb1e25f241f9ae7d589d5076e34ae9ce0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 809617a524219f8f0c22a6606dc1d1aead94787435a0c28c8c02bf74c510d80f
MD5 4bb15c4d7a276c22d795a6a9dac706a2
BLAKE2b-256 92db659790f1d829bcbb5408fcaf391a324400d8a1ebc1998d08ed08def7f4f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fcac98c3909df182740ba7da2100a865707c33bd52bdb3c3d0528d15531b9677
MD5 7da1bcd899fb640869880ce0621d9d92
BLAKE2b-256 d018a9a9d3c2eb53377128370d64ab4a1ba36f0be6e1d212fe2f82f6d8159bd3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7ebf2afcea90aa06838421e10667d940a508d437312577798a6e75524017b11f
MD5 5102ae94783225990a162062705e925c
BLAKE2b-256 992f194e7c89e5532212ea3698220fbc4810a901bc3dbab3ee90d40f053279d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 39967be6bdf1e2c943f80af4fb406bca0b3d3b31cf9d98c6d12ebe4bf17fb4c8
MD5 ef30cd683bfc0281cc83634291d43532
BLAKE2b-256 6ca8f1dc8437c715c233ad542cbb662e3e4403ee563c111732d729c5125267e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 011684c3de96e2f7fdb81bfb0bf4ceaffac32f050254bf3c5ebb0dd7e881eab4
MD5 f52ade858c80e8eee65df5ae4678ce29
BLAKE2b-256 70a504322a601c36282a1e8c6750d5ae434afbcbe066419864227fe613cf811e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 50069d3dae4075f6670aad9d6b5314b08e923886532fd5485f98f3cafed3c44f
MD5 c5a8134cf6c575aa8574a0f002412ded
BLAKE2b-256 2eefe1d0b19f89c2bd88c8505ba371d33c8bcbd06530246c60c65b79e7c83e04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 14f7d91ed64c52ece1313649bd96c8635c5f1a3e5bc4a35492384b8efc268af6
MD5 5823fbb4644348088fd3d32e156f8736
BLAKE2b-256 bdde6b5cbbe68681b33464d084f681e73a6a4d42fdc800d79652211f7f107951

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ff4bde31a6df56a4a235f95d8b3478d89119178737ba2d9dc3a9a5fba923c591
MD5 4bef340e1dc4e54a57ffb201828ecd5e
BLAKE2b-256 03692d5930ccf945940a7c47101dfe0a0ccf9e961b257cfec8d7b5066d558a58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1341070c9c57246b5d84dbd9531775293d1bd10cd76dc9518c3973ced21d5483
MD5 2e55f11e02f68520f5893f2cf8adf0a2
BLAKE2b-256 3c11f90b661452c10f602b3c1e829d69ba055edc2bdda9dfcb7de661afa9793d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 37d94cddc2f1ce607ece4b40afc99795374e7bb76834ed1c55701205e4ab2878
MD5 b21173e7a1aed769ea57a1ee92633a5f
BLAKE2b-256 5f897ffb66b8f2683df7e9aa84fd19e4f0658250ff4502b5214bca41c4601cb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.2-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ad1c9b51f716a45be29f46ff6710d1ace1c5b642c4ee31de8cdd0adda91dd4c9
MD5 1436a774279c842474138c30fdb076da
BLAKE2b-256 466c44d916770983c451f292a0d4f874506b290379578d704af39e1bac24855b

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