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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

verysmolcode-0.12.6-cp313-cp313-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

verysmolcode-0.12.6-cp312-cp312-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

verysmolcode-0.12.6-cp311-cp311-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

Details for the file verysmolcode-0.12.6.tar.gz.

File metadata

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

File hashes

Hashes for verysmolcode-0.12.6.tar.gz
Algorithm Hash digest
SHA256 f1f4612632e6dc595a1fb90803df2697bb2b4f0bce0666164f8ca6118466132c
MD5 93b3f57df379c0bb090f688dcc50ec05
BLAKE2b-256 a8652e7d7d769022f36b1385398771de29a75cb8c9db21439092e7416e6101a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 256b83880ec0be2cbbf338d3586bff567b3bf042438703b42214c8bcbc016c8a
MD5 5f2c8468a7da4238dfe70589055a76d1
BLAKE2b-256 2b5f9f2f91ad1479dca5adb703d076b9446e70c8c8f278ae60015b7a74f2e903

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 a042c979baedc4e4c9ad2577efaef5a3d5e5b2c470bcb8973dc7b7618f36cfbf
MD5 bc55e2f4a974cfe51369352b34b4b8e4
BLAKE2b-256 6a32ebe2303b7b02f12ba69f2f637a62e878403b95393ba53fa920bd88490b8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 55fbd3d3b100a79ead323bbf5b577fd2e9a58d446f6d575be75acb2a9325a6fe
MD5 3e84302e3274782010e5850d07c602e4
BLAKE2b-256 e8499d7d434decc6019dd3513c34642f8b95b1a9d9460dc8cece8c461eb8f42f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5b83e0da726e8fd7efae5952c74ccb9f2d171f8048d4b4ead83de52217abec5d
MD5 6ce9a108f9c677f6802af1e50ca21f4b
BLAKE2b-256 8c987e4a91cdcc730cbcc8e3f806cb019859fda864676f1f5721f3e95eca9f25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 87ebec9c502cfba234540019c382912365056356def722aef33ae9394f7344cc
MD5 449e8352cef57e0328426bf827fa92e3
BLAKE2b-256 8bf5f6e3c6c77040b7ae5763d75f71b4fefdd5c7007ff772adf0a1cb25313b9d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4ff1bf6b6c8986604320bb4de3d7cef56adc3b065e9203989e67653bd9bae902
MD5 4e43bf39aa14a834d3050a0324cfc1a3
BLAKE2b-256 d467759f8cc1a48a39dc6a7b037263060337b77bf2c8db39ab7b2e61fa3fc46e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8e9d7dafca74fc600739f8070c34f5d8593348f624f78d6979dd3ae87bcd5a4c
MD5 f54ba9ce4f15c2f67697c32210ebaeb8
BLAKE2b-256 d3a936522f7ed57a5a31c463135ee3eedac94dbc11b48fba5fec424ccb4c56a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 f02182f90274a2044f75e4df571c8840f09113eb991209f141a565218d75afa5
MD5 75bc29635c59759e7b14c766ea683b74
BLAKE2b-256 5c28fd656edf302f75effb5a9d14df2ad7fbbeeebda210c7358a695c6fe6cc6d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 516e1f3febfeff7d2f18c5d10abdc67cadadcd38ec5e4da83b2f6890376832fc
MD5 1ad5f19b778a06618b3f23c5a45a3ea2
BLAKE2b-256 cfea8c9b454bf1fd8cdad62d52cca2f6eb43f7722a6f0838ebeb37c062bd25a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e159fcfdde36e9789e9761bf2cfe08f313ead339f782856acb8cbdf8193127c6
MD5 09a106696c54fc3702743c634e27cb20
BLAKE2b-256 66ea9451b6927ea931c6c8fab080d75b4971f59314a48da9fd6de9af87daf5c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 075cb337839b485a43fe809938ccc259c6fb5f345e114b1e9351ede2da40be7e
MD5 3dd21e16b670085275e2f94e3f520abb
BLAKE2b-256 dc1b32d10581d94a98b87094a0e06d5edd0f66da52695ef041514c3106fc2d0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 639a483ac13f13e0d1c0d0961a3e8946d45f853f325fa4f1480c6a07567358ce
MD5 7d9a9a3d1dc6f110df0b183e7e3218f3
BLAKE2b-256 c45a1e10b237701f123ca51c81d06e53904548cf5394b50ee5ef0ec51d033d16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9bb5098537a4795e921dfae258015411ba7837d4e1b46baee2e43b9cb74e668b
MD5 2b543cf3f5735597c41828ecf8352545
BLAKE2b-256 85c0a71dd39d022fdb58e58ac55cd8de76a2bad85b35d2a55b24bf3eae7834a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 f8f50029b1dafd475a73662895023a03e70f7f9750e3f24cd0ddbc4ebd28d7a4
MD5 f22c11b7e9e051500085e54a0f495271
BLAKE2b-256 b02fd1b33242bd334d3e8ffcd54e42bcdd99f257af294a30819218f5faa7a08a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 33c155e4659d82d409e6f7d2376d3e1e931f1f353becc49a54b7524ca62bc5a1
MD5 1ce3583cc494ff4c24936a7d6ef39ca2
BLAKE2b-256 af6223bc6a1d11c951778084164bd33fa3e103e43cebbdba54b42a681505e0fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b07697d4162e1b4ba70d5f911c229dcf71e64ecbe38b0d702ac2e53ba4f2d0cc
MD5 bbc09803d49743a7b199e3874c300f74
BLAKE2b-256 323ff141774da4768f9d86eb6ebd3821516bde61cfd64b7a4e8b5953db906188

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6abc059ee70fd84be5ff4d21cc38108509247cd6e1ddafc951164397d2bfff07
MD5 6322954cf7dc95e7a8a1788807eac808
BLAKE2b-256 8be7207d25595faad8aec97c965f7e9467257d4ccfb7b5d93f36851dff5f384d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.12.6-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 45d5806db576aa3c90f4231363fcbb514e9dac7123a2488569e4f64eb18c450e
MD5 3f760a9e78d9fe9d8a717944e8016112
BLAKE2b-256 6b3d7981cac945c29bf4369ffa7aee37b0dc5f690cc4c4acbd1bc6793d71ceec

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