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
  • 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+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 (434+ 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.10.3.tar.gz (97.1 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.10.3-cp313-cp313-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

verysmolcode-0.10.3-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.10.3.tar.gz.

File metadata

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

File hashes

Hashes for verysmolcode-0.10.3.tar.gz
Algorithm Hash digest
SHA256 958a3983b9520d789a469c25f1370568554cb88a1af7deea5d428c0904338c1f
MD5 aca04a43b46e79b4b9f1c1d338217c86
BLAKE2b-256 219b78c850bb864dce68fe7c16163ab6009537d27eea9ac6245c84f29879dbe5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0e26e851b69212c46f66d7f38c7784b8d52cf100c6e2f8b94dc917725ae41c95
MD5 253fc4c521c5c7f1c95e459cc3d89275
BLAKE2b-256 f3b9e4f530fb6081df2dbd303978fe07108be7e6ce2b1446a92d408bc5ae0eac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 defa2f7affa8f43fa82c9d80873eaf1b2d077f2935a6425c9dd83c1053b77a6c
MD5 47be56eb427b2eaed325720ff08d569d
BLAKE2b-256 0ad8ed197f2ff5ef1ca2b18c686db50b9d1507e564379e03e60967686ecb401b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 be86d5275801b64eac2f8f377bafeaf38a2503d6408017e280b3c27632594491
MD5 15f160f79269245cdaa85295d2c8c507
BLAKE2b-256 57c1e9a82d036ab42030cd550eb67f325530713b7373820e57a3d2af77e2168e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a7c40e1a7e8564d3f9ac92c8bd8dd40820cb523a8a56bad77274937f2a10f50f
MD5 6e29ff5f29cf16f38e3a9ed42cf66e8a
BLAKE2b-256 b73e2ed05637c5d1858458e70908bcf8234f5e8724d46d88b916bab6ddf96142

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6ae9ac01b095d2af2e4ce59f1321717cf772540e7ba33fc9bbceab440a7d8ae9
MD5 df6603fc6572694e162512b0ca2ff18f
BLAKE2b-256 854e1d5b4300d6de7590ecc2a993163744d2be31df3f27f8745fab65e9492900

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 588a986b54e5a908014a6efaaef5e6703f97ff7bbe113ad4611348a9cae2c036
MD5 a44d37ffd02c446ae451a2f49fac69f0
BLAKE2b-256 30d6879fe7e15e71d3255023c83de275eb8656af4c8d839697f34e916113f5e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2ca5d67d995be37c63f2538628c83750584e95a0b50615e5352f483682b82949
MD5 8dc553945576a31a212125a7db066ace
BLAKE2b-256 8317f31e29bb18aac66cd5604f16ed116575b89efd2e41bd07b90565074a63c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 b9d843db91da1c7039872d330cd9e5c77cf3c2c9708d6e4fab59b854908e2276
MD5 b48e8072931afcc0389440a5d4d0d26e
BLAKE2b-256 844c4d823ef69cfc1fb7dc88993f5d626ac8eea1f468f26e8dc9551c31025289

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cc4f147045a45f19c19b5b6ed2e47912d868df5c660b5f59e3d6264319298d2a
MD5 bd9a06bbea15121e8e3bcaa8d96a7be2
BLAKE2b-256 905a962bb27b731ed92c211e523294f8d3d8e564443e46fd08350e13fdc9d5db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6fbd211d4974acd1c080a6ef68bb51517db7c84d2b3417de2c4e44f544a19013
MD5 76ff35d23fb190bb82737fdc650c3efc
BLAKE2b-256 29ab34bfbe9c51cf464a8db5914b6902a01631c88b558ed1bb1a66df2b3df6fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a9d7c8ab1c8e7bb432f2192802b4f65579388be6dbc8557d641ef6642edd36ff
MD5 2fad7f35059fa2c3999e70b745821779
BLAKE2b-256 d173dee52dc2df6cee1c90ee44e91d7e0fd7fca7326768fe5ae4e8fb5fafffe4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 848ca173bfcaef910b1f7f2779b930b64d92709fce07d64754dc26813ca9856e
MD5 387f5bbb982b3e155aa57cedf7263737
BLAKE2b-256 5ff9388dc8d49136cb1c1b50df26c7c60ee0331613c1d167edff5aa7195096f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 be334d71f69741a64ec78d15750184a82f9e12fd59ccf4773de5e271290beb61
MD5 e3a18200d29fde39c9a52429f9c6c119
BLAKE2b-256 1f3ddc2da93589d16fa2a15ebac25ea24dc2127fb5d269c4fd8e0ebf482f8592

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 be3e8f66ea0fb921719e5ad54e1beec0320969a53733da7598f1e9c4acc05ec5
MD5 7bb9abe70249542bc73d60a77c75f1fa
BLAKE2b-256 ee483c21b178e8fb65b138180c9d6b9755471819d8220d2f8844f3b7d494b7eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 aa8a0929f4e443d585ba6ea908097d9f88e589a7ecec4e7055b66a3027c64d5b
MD5 d5da158ae70427cf8ec641674accbb1c
BLAKE2b-256 b8f0cbfdcc98c4998e3e9d1c3186048f06b1584a70f64617735a8ecd86a6f2c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c7d16cd4fae3468e8aa895bec2acffc16fe39e1c42ab8751c2136b7ada082b29
MD5 4862acab984983ccdd423b46e908c09f
BLAKE2b-256 0419179dc8dba1d78b618bf3ed34850b07395c30767a477355a27cec2c4ab836

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 53e43d7ef486527022f83423f2a1b10812f143b2fd923018bcd130d5aef4bf30
MD5 cff8d6e9016623375595a4eb38c1d3fa
BLAKE2b-256 7c34a37d9e1f8460c6d405b06c546d492e6c8d049392b3158196f8ae89a474af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.3-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 45b0f49da056b63943fb65c83993b6ddd222a56249fe809c8a7a763bcbdbede1
MD5 043966001cd7ce3268ea73712f03e8a9
BLAKE2b-256 85c9cfad573a836a02b6ac299ff5087829a1960d35fcffc7778f25105547c34b

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