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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

verysmolcode-0.9.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

verysmolcode-0.9.1-cp313-cp313-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

verysmolcode-0.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verysmolcode-0.9.1-cp312-cp312-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

verysmolcode-0.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verysmolcode-0.9.1-cp311-cp311-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

verysmolcode-0.9.1-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.1.tar.gz.

File metadata

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

File hashes

Hashes for verysmolcode-0.9.1.tar.gz
Algorithm Hash digest
SHA256 e0c529bea9d7bd901ef79f7489ed57a0384f8d91e1a3893b8a89467f00a42af6
MD5 f6e39ca19f527dc0402a19b794279ce7
BLAKE2b-256 ea0bdcd68ac2a94191d31aa2f68e82af2e45c1efdb34f183c32ee19d874ba2c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 82abe65e324c82f0e0bec41c7a19981432dc460bae387854dd74e7fd308ca375
MD5 b6e9162e5c9aaf57e4fbbadbd178a17f
BLAKE2b-256 89c557c1d4a599fa8679f8e2fd61994492504c997a70927d15e435a7e45cfbd0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 f47e08502ab33b3ca86014bfd808173085054ece328c33f87bb8c83c4d825a08
MD5 783a8297285b5e7663288ccc04644239
BLAKE2b-256 009df9b6dee3b6e63f76aefa510ccb1427f5f644122c2fc1aba24c6c72dbcf1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0c0bf157c59b6604be7aff31bff3408f142b0dc8bd354b3c90ae317bfbc46a89
MD5 4ee307859e58c4972ee715521a2a92f0
BLAKE2b-256 e2a0f5528df8142a3e41f11cea412acd42c4fc6fd2936f665f3b8ecc517d6c4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ab0da3574a08e76cd78d650428ff547b67a15b98ecac286ee3c39e3b4aeee19c
MD5 4aabb19b7b4bd73c81fa93799f388ba3
BLAKE2b-256 7b18f5517fd644c664e5237c1c648a3c9f44843ca4ddbdae5e221e7fe9fba0fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 481c904b32c1242bab3a0053da691f9c10f883b487ae0e300e00a40ca516a83f
MD5 156a823b1276403400be851d8fc384fd
BLAKE2b-256 addc14018702051c559b5593aefd3b939d07e1be8294cc956080417274679a49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 449582dd65628a2123806ac4d42571591bd1acaf8742ab71743fc713c3a74464
MD5 96930e08e7c7fc63abfd30268c1e5ad8
BLAKE2b-256 ccefaf8e21beba15538e6a572ebb63da0bbf6fbaf36088c4cb6268d0b1e38710

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bf673cfd9cd94c38e1dd9a48778c0559bd1992a36fc593a18b68c2c3441837ff
MD5 3f71deb3740053fca63c73d6e39fbd3c
BLAKE2b-256 55e219ae545c9e81e80547d91d6b794bcfe36f09f947b7a022627aad94ffd0e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 87088abaa06a93bf4db0989f345ab84c8d2c2f0474cfa5c46c981f6d4a2c27f9
MD5 d12a0aeec7d312bc035d480bcbca1c4a
BLAKE2b-256 aafc1a10dce3f0691b3403b0832064ad32e8c45d7749369f18ae3b81f4b19262

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e433334a9963d150014b3cdd0b15952995a1337fb85f549c8c9ed32fa875db7d
MD5 c235a7dcf442ef18bed02b87413b8967
BLAKE2b-256 6e1fa39f60a71051841171501bf5a7fd62d0bf081035b84d69ad6270ca068a95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 56fd63b9b62f53fef12536d1d727c0f752d9b8b1bc1f64a6502e22d7e9890896
MD5 9af6990f14d4e9413f535b3adc361c95
BLAKE2b-256 3192cb0eb3b4b936dcb35707a8a50f799213ca860085534712cdd989ce2341ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 495b40aef0718ca84f3b918e44af3c59521f1f249789fab872049ced87c44d6f
MD5 be06d894f0f1338bf8b3b7b101c90e29
BLAKE2b-256 fe206b981fbe81d4c90bb591984e1b8a37e0ee658cd088cc886b5d7e3d0e6935

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a7616ba3fc58c6d4bf1eea24559193c0d2599f41135810e6992eb3bcace829e2
MD5 f52564864d387aabb5c14283a319410a
BLAKE2b-256 40ca9f1b481e9cea0cb4f126521fc9aca22fba7a523dc5b1379f219da9fbe909

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7b451b613a04ad045d44fb8d84839fa1d39d3a48cf0a3fca05d2d6717b37b1ca
MD5 66a6d227858c20a24dd20ce62fab8cba
BLAKE2b-256 d9aa867338945e4dec3d11a4305c18cff28f9962986d158e11bed2181149733c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 6b4e78cfbff35e5f93f85aa59eefb290f8c2a04013cc7b72bc664649fb0371f1
MD5 4dd5fffb5700f51b0d8a830fd9fe2e1e
BLAKE2b-256 f437822a1d5498d58dd18995ab9d9f3a7bbf18ec6986cba122479f992b00388c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5bbdff01e09cad5577ead319f9599054bdda1a3af10ead450972d339d4385f87
MD5 7379e49641091a8b40fe6adf8ef34196
BLAKE2b-256 ff4c2a9bb6c33544112d129ce7874313e37e47125b0b430386b4f90fe7bcc83c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 540a05c7671c7b23677762173a2443963e2f00ec4597b1ed56d49efeb259279c
MD5 63564520c4b07de64f978d3680a37d36
BLAKE2b-256 56dcf5c5ca99ba02c2f45d6922a7f1859e3dd812a958e0ff1a44b6faf75e7fb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7b42d3ff4f40f4d689344d0252109625a382871c598ca4ed50d41873ed0ab8a9
MD5 0c508d11d0dcd60bbcf16bc4d69754b5
BLAKE2b-256 5c03a0368450655494e6bbe5b2b52db3844ca7550b79cf8d1687dfae93d7db2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.9.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9aca863f64f5faebd8a1f1c18f1b6ac7947c026e61ecabaa2c7ca20d0bdc8650
MD5 202beff8e294d8efe0153dc7c3ec72d4
BLAKE2b-256 7caca67f9260ba7f7761faa58f4e2302e388ecdba41dee01e57603cdff8bb1bc

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