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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

File metadata

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

File hashes

Hashes for verysmolcode-0.12.0.tar.gz
Algorithm Hash digest
SHA256 057ffb052f745e5f1fa974892e69d3bd293dc0acdb583ba98a021450ce317af8
MD5 2d22084511bbce87ade373048424698a
BLAKE2b-256 0dba2b5f119f115324c2a88d213969384731c06e8517c630184bd99a04e72eb1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f6c6ddb1bec7c1ea68bce08b7225c7a553012379ea9e0ad3785b8b5dad314eec
MD5 1d5193bb5bcfc7272f88a36b7436c684
BLAKE2b-256 05f37989785288a374ef799d1109a0980c2a1522d8bda40f2caabee4dfcff5b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 980bf016d056d99b2331f0c13323abd65f6c49f62c4695009f12b308363a0be4
MD5 ecb547da92bc1b008cc7339ae1f9cdfa
BLAKE2b-256 7bd312600ce2429dd3469d435849b1ca854573c3d5e3b051e032fd33f2844d26

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4df14d74652f6fb19938e7010602f682f03c267692c98fb319ce445a027e3627
MD5 79285ec1723e42068f63fab41876cb4b
BLAKE2b-256 e7a090597ffb3ee639f332dcab43e251c4503ad6a544b078227b50905965b009

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1700dbcc7930172d4267fbecbc3c705226a29a7974f2d898d53f8b76b78a4bb6
MD5 2193d76f70cd3b380850b6f7dca22f0b
BLAKE2b-256 b085f8ec65f985aad750409d75d5c37bae9d51d81bec25ff12cf3fd601782ec4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 20ba95052058ab972182be4bd352a99ee630922d4dc5025ace68b7a034394feb
MD5 e918c5315c3509c8abf900acfe95a4f5
BLAKE2b-256 7969fa9abe485809ea658e02bb52174708fd1a4b649aa2264c140856fdc22469

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1b43154697e1ee50ed98d9d6404ecceeea90fe2fa38f2063e829cc9e2fe2c2be
MD5 713c3d5e0d4115ee8b8b0d9522597137
BLAKE2b-256 92a695b9ed0697041101e2f3cd527531e12ad0f538a56ea70aa6563bebe33356

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3ef18a4bb5c9868ec697ffdf631c68254cf3601550a3a9817524a11e4e366c23
MD5 896957be0c86dc1795c5cc262693bc76
BLAKE2b-256 2aa3abe5e8afe884c69a8c2e9c1a75c593152112d60d42f63813ad360c281a86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 e3abc635d77048924d6341ffa1872c45aee9186d8fcb76970a9e276f427dc765
MD5 af6149a039aafb42bf5154d7563e3900
BLAKE2b-256 ba171b6e441b159e47bd6c7be1fc95e3e22f94556fda053c472cc21b7a0157b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7be559043a5a2df9c30409ce52949a1854b4774daecf5cf54df548936422ead2
MD5 c186d36cd6e21ff270e80d39bb60bf9c
BLAKE2b-256 a470fd797b867aca4b47bc7acf86da5f386a779f68be283e4da1a86a80355290

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aee35fdb51273ad55fe06a0ea380c917bf55897345ba8d0c14b459cc9c1cd513
MD5 4171d1763a37041f5ef5afe69e90715b
BLAKE2b-256 cfff7f455eb119526a5c92c1ef253fbe614c45bb2d772b031c4a6e9776bc64f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8c57a743cda12deb1ce3b0ff11bb045e0b165127f0e7eb94feff281fe123e1ce
MD5 448a690826c5b046645d1d22f0efc78b
BLAKE2b-256 5c3156d7c6ab87ffca91107400972fb159d520a3334eb1ab58a3c473215c2923

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 548a307fdcb705ae18e65fdf2e15a0239d50e1a2d79286259ff9d5a731bcb7b5
MD5 ff033c1496c75a446b505c7ac12da91f
BLAKE2b-256 f81322514df9ee0dd930ef32b8f6444ff33a0f0d815176b11083ef10e01b4ae8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b8a66257005098b1350f41678924f325feec0a60418df36e8e215fef4b0aba8c
MD5 37f1be3a5fa42059f1e9faa6744e0e29
BLAKE2b-256 43fe9bedae4735eef3b641767dbb9f50ee6da67ec7f439f2b9731e2abbbeed0f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 924a45b00212b32acf72b52c8815576237173d532bcade7edeaf6f47c084c546
MD5 03828239f9fb7f0db39fee79aac40b65
BLAKE2b-256 6c1f09113fe6d0fc17a333694d7533945a2a00f5963fae79ced2e4143e5578e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5f645f5b64936f52ba0b2f0c943b60c933eab5b43ca9e5fcbebc99934d8018b3
MD5 07413f19fd9ce1c4f24bb04e10324aae
BLAKE2b-256 6501e9bec6874f55dddbed40b3d364058549df1edb209be6b222cb0bcf31c276

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7e5caba4aaa48c57cfaefaf9c0bcd48dd39096ce49a3b77afbf7db78483f1e04
MD5 a09a5b3b0bf7eecb94aa52926a2d0808
BLAKE2b-256 323e3e12c1acebe00dfeb8aeb587b31f1afd156b0d423ae17e26e98b59bac0cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a513d4fd6949a8db46027d842b895dd2024dcce1df36367d1c0ef0a097f87f90
MD5 eb3137f4de4060c92074e23e1da0e494
BLAKE2b-256 2b92153a5a1021c62c481aacd6e5d50fddc3699b8b2a9d464fe799e0e99cf586

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 03d6b88a255e70a23af817c931696dce8b3080b819b0c58e607cdf9a65ed3ad2
MD5 f096153c83c8899931fdedae5f4616e5
BLAKE2b-256 c2859189e3223fe76ea927a2507c18952ee9d6107d41578dd26ca0643e56505f

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