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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

verysmolcode-0.10.6-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.6.tar.gz.

File metadata

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

File hashes

Hashes for verysmolcode-0.10.6.tar.gz
Algorithm Hash digest
SHA256 2c229ffc34ae1c97fb2986bfd6ed77fee177d54a21f01944b3564e9bcabdf8a6
MD5 50e642ab48631eadb313657008f3932f
BLAKE2b-256 ec4df1107f8d8427f37aff2ef9a5211389e56ab98ae90fbccdaab6fd1ad6bb34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 306ecfd35d883f296fd8fe44e3c169cca7cc92a75e55d1675f32f970f1a218a6
MD5 c4611730a18141ad5687616c2f0af9f3
BLAKE2b-256 f827fabea393781dab52e7e76dc78a7f980e3db4a34f5a36da93ff397842a235

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 b99e2157189acb7744aacd3a8d3026936c7b1db8e4a56b88e3e4851da8ea3cd1
MD5 d8f7f68f89c15bd4a0a38da85be650fa
BLAKE2b-256 107c71fb7a2762e1eeb379f9079b97fd268c958227e4bde1d441b1d3c37f7aaf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bb71ed2a0b62029727b76e784f549355b4edf35b19596d2cc3fdf0ae3cb2494e
MD5 7e36926db30bad32dd11c78ec280acf8
BLAKE2b-256 2a23f7fcb02ab04f89dfe5a66da58c0626c1e6067e03ab761e964abe222d8727

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b9a173bbc3af6a065f8b5313df7365036f6834c7a7101527349666f3d26fad18
MD5 e40ae95599d4095ef428b271034aa4d3
BLAKE2b-256 55a43e36f1694956c96b31e93e6d4ef250c1516c502607869bfa21501e1a25c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a805f844b6d060461730fa8d67d275928ab3260940fe2e4f86d8b5844ab57796
MD5 ae2782acc383c83a62b755aba3062cc2
BLAKE2b-256 9c5214952720503a501b38dfeb04462c94ce9612f84a7331fa9a771f56dff8bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6e25e7618160f20ddc77636b936999f72bf84810c9bb4d4a56e8e47901a3d927
MD5 6ba18b6a592fd7827740f5fb128e50bc
BLAKE2b-256 cc860456334e7ecf5cd8bf052e12836fae66b8ab1959644e260ed7a89a6cee05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8de0075ce9dfbb9cd76401f54efa97d9a83f7b72a962735671a25ce808d418fe
MD5 28699e24409f0e015d3a4976184bdd68
BLAKE2b-256 eb7a0680c91cf438977612fff88ad85559858151b14e4394ff9a16b4680a7e5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 e389bee75660a83ef40716c3113fc2b92c924900dff71f9bf94df5cadb64053d
MD5 5aeebe84706fd30a9d224b033cba943d
BLAKE2b-256 b72680516baa78fbbfdd4ad88a29f88e8c6009e5e2329f8ce1a2eeaa6e61223b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 f1a2cf8553e03048888bbb3097b334b8f7adeee9dc9afb043e09e397704e2f37
MD5 ebe759f0cc34d2842cbd0b4177195887
BLAKE2b-256 2b0722595511faeeefd87253d6e8d5242a98ec2ea1fe5f1321316e2550c4a06f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ba466aaa6d8a7f7391756dc25dbb2eceeb7ebdd6c8b8b6cf6d1f18361e85c60d
MD5 96d7d26b2bb0c7c0ad279bf7ca8b2d6f
BLAKE2b-256 5b0bb0f4d9b49a7b8a3983b38026c3377110ef159fee281b8eb8f0e08d18d5eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9f29080c4efac35b4d8e05e36c3b093999ffdc189c919373d38cc0dd37a5868a
MD5 4d0a2df2d94548ec4a5fc41c4441f74d
BLAKE2b-256 35d9d4ba0f0691a0a065bee5790c83e1b715b68e46d6c3c23639431422502418

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4f6347c3dc0d2a1ce77e188cc385c57cd729b9cc9ec3f09e83ecded530b728d0
MD5 46a59ef19ba54f3686e3159fd75ab72e
BLAKE2b-256 49aa534224b41e9db85d480fbc0b57f9528d919fa217490c2eee63c36ece64ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b99365598ec4c007e20d6c73e51ab2443c7392cb1179ea7b3f20a76dceec7fc8
MD5 0aced6fdec87c8607938ae1735968bff
BLAKE2b-256 ec0f1049098724a346d6460bc3a74f56d1d5ef8e06fd00a2eacac357b7e5e7c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 12ed7d226a1d5db149f1240015a1e4b8d08f732cabf1828d7f37c497ee0d1b62
MD5 18b22f9fea6b83e65a2c5172c52a0890
BLAKE2b-256 117a63da3a3ab1c0ccd49580fcae8324dd1e7e0d47f235f872313cd946d67318

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2f69a52c5b72b1f0fe144cdf55474f6b4cdd2e05ed61b2ee1bfcd911731d70e0
MD5 8c748e7f6e0bd6812d7375ec257ad235
BLAKE2b-256 7e07b15bbe738d719ff6a99103cca1f18328636cf6aefb7fe825a9e071d54c4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4edd03737b2dc1a1f97c8acae62d28df6d84c41f3163b8fdf569164be48c6079
MD5 de7c38ac7290fd6073919311a1daee7b
BLAKE2b-256 1866a058d1174719cb15a055e9eb133c9e2a52c4f3d4081886ecf2c0b82c3af7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2bcbdc37df0fe9478b83265abe85e004d319910132ee5a0452eb6a9e52b83f8f
MD5 21e2b54d14087dbb387f8f30f8371284
BLAKE2b-256 692c4247fc9104603f1130c190ed66cbed8e3a5b6367f1e7fd109d70aa4023a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.10.6-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 379363c5c76d99839a55664eb918d86afc459d4fed9268d2376b2bb9cb85afce
MD5 969da011ed063712effd0a2f69631eeb
BLAKE2b-256 4b3f951f8282094fb153857fb9f76fdc4a62667a1a0bc789fcafa97999b609b7

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