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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

verysmolcode-0.9.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.9.3.tar.gz.

File metadata

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

File hashes

Hashes for verysmolcode-0.9.3.tar.gz
Algorithm Hash digest
SHA256 f115fd171dfde8288f7ceb6495bfd0d3be4d446058bbc0a505b593bb2ce96b85
MD5 02a8cb77d8f938ea8bb0b9dbaa4956bc
BLAKE2b-256 883650f3ef9c0c0d8f39b8c225d1658e9838dccf1f59fe06ccdf0611deb6e204

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1bbe715b6855a695167ed6cea150bc59c304f9f6e4f00f7047b3af6b16892236
MD5 514ddfaf8df97ddea5e382636c88e3d3
BLAKE2b-256 0d885ca798086d76f2662cd72c9b35db25e26fa4a958685b0ec5eca209054470

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 77db668c695974311dd9026593bc7153921e5c9650b56a1ef61acc95adaa84e8
MD5 e5f6227f145796e8cd09e0913204c9fd
BLAKE2b-256 a5380c7071d42f71b4d244c46b329e594b0a436ee368799eec03bc18ff3b4702

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 54dbf623fb7fb6c429c9d4cf8bc938c894b0c2be3d01c0d5e69c379bea5ec726
MD5 f373d1479e9bccd0f5069400bc035822
BLAKE2b-256 fd5add1b33e77855d822e8050b60d833df9cb3aa731877bdf0d41611fb875342

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ca5191da8f6944f6f371bafb016a372f15b8d2898d5e05de737906c6423f6b5
MD5 c29d1646b7e5802ca52d67693862b4bf
BLAKE2b-256 9cafde053c5c314a7e7a1d9dfaaa5fb100450cd3cd30ea14677b681957c67e06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4dbf025546b7ca69d0e067191e32ee1e1f5f60703b82ff70bdfb2efb3b1ac4ab
MD5 6e86734aae26afa4f208ab7be751c9f7
BLAKE2b-256 388b8231d57b84b1b498d54af711ef3e805a019595052d2bde24c37c6d5b14d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6bcb727128f251511c5265259d40b2ebe54e92bbfb3667c95c60dc19e8db6759
MD5 65115417576eb06e82374e22a95060c7
BLAKE2b-256 3ca55aa309b024c040dd0a4cefa45214afab77cf6fdfb1e25f83c8b20c52a781

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f9c7bbec1e8462e45efb8f5835fef5395ad0c7c396a2ab9a085fe74770f13bb2
MD5 0e1305552b19873c5adbd69901c10e60
BLAKE2b-256 67e7002974c8aea2a25821a2d4d6cb63faf0b1b05b641e052f5b9afd7751237a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 f09393bfe1ad06d979d3b9d0c31ea1939af4b3eb256b8cb836ba638de42295b1
MD5 87cc4b5de593bcc7fc6413eebe3339c4
BLAKE2b-256 b0a558697d2f55af9f73cb78ddd995af5bec3ece994820d5a0305bb9b5f460b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 acf5284f2258c38a129926d86eabd39391f511af994ae7a16b53999ed1164648
MD5 e78ca30b589efb67d834a591f2ae6a06
BLAKE2b-256 b4fdf71b7df89f3325f3c086ba5cb4d16b7ca2d8d99cfdf448172bacb08c6dce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e345aed1f37f99fe5b5d866ed7803b8db3cbcb0649c38f497e3f92fc0da83239
MD5 42edda1332e4a49a1f3d23aaf3651c8b
BLAKE2b-256 d1a76cd94cd7ffc10c501021b7271071cb3d3ecd035ec818694dfcf8c6cdadc3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c04581b4cf75553408b8091eb897bf5d1e0c1f9c853d0323fe0f299fa0ff0bca
MD5 0c4160be450b0edf9f338ba6d20b5371
BLAKE2b-256 0fd7af9dde79d002a1e0723de537ff6a6a5cbe5ea99575cfd9bed21bd9fb2c3a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b28a2dbc74279455a91e7aa01bf29f1c0f530332ece2793e56211525be84c9e9
MD5 7609d509f260383b885df83617efbeab
BLAKE2b-256 b1612357ae6ffbed8c94cd08cf67db602d8583c9a92521fcbee372f18e33ce44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 898fef3abbc0c09e6e1d466d6b0987c880017000979acb5e6bf96c34e5e9996c
MD5 c3d5dc6472328e9f409c049f78d0aed6
BLAKE2b-256 d6f27b0f31e1e8deb11b28d2694e93b2efa9095be393c231b2199f7a5f71fe05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 6ea89048d53cd6e8f42065e0ad1aa871a9bbe27785e60f18e5d0bf6d41c02fc5
MD5 31b3e886a005521d22bf113bf26ab7a7
BLAKE2b-256 4b79130dc9057102686c6dcdaf4a9a1d841c490ffd52b4850ed75045423fea36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 05a34efefcaed01688d0330a541cca625772168ea91347726d987dbdaedb73c7
MD5 e9e9fc3f152f4b2fa5b13a18341774b8
BLAKE2b-256 226c90b08b0f2763e1a029883ce079a525007869dab2f5b43212715f82aa13b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 18c540942d1d3e788750089383bff7fc475018988d9d7aada8c44364e1fa1a6e
MD5 61004bc733be39fdb93b9d573dd2503d
BLAKE2b-256 80efda4a5d76f63cdadd3bc057ffd2acca7c1635102e5aa47d4f1f5c68d5161e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 818cb5a79deb417a826a4440e3b959955a8248ffee8d0cffc2bac9fd128cc0e3
MD5 bf36e196b477fa60cb5535f8372a0e17
BLAKE2b-256 a64276e93735ba4f64b81f95c84e23fb1c94760e8c1401258d67a55bac04eeeb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.3-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d7d44e7da8ebf327da0fc64e930e2e61faa503c9cb7ba75c2b35d7476497b106
MD5 7873d9c6d3999fe091191890fa4ea43b
BLAKE2b-256 f4b098f4f2febc4cffe56f040fda7df144b6e3f388ce57c2c15646ab473553e7

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