GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - xrip/tinycode: Single-file AI coding assistant (~350 LOC). Claude API with tool calling. TypeScript + Bun. Zero dependencies.

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude
.claude
 
 
.gitignore
.gitignore
 
 
CLAUDE.md
CLAUDE.md
 
 
README.md
README.md
 
 
bun.lock
bun.lock
 
 
index.ts
index.ts
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

tinycode

A minimal, single-file AI coding assistant built with TypeScript and Bun. Uses Claude AI with tool-calling capabilities for intelligent code manipulation.

๐Ÿš€ Self-writing code from day one! Start with just ~100 lines of basic tool framework, and nanocode writes the rest of itself. A true AI pair programmer that bootstraps its own development.

โœจ Features

  • ๐Ÿ› ๏ธ 10 Built-in Tools: File operations, code search, shell execution, and more
  • ๐Ÿง  Context-Aware: Knows your OS, timezone, and working directory
  • โšก Zero Dependencies: Single TypeScript file (~345 lines)
  • ๐Ÿ”„ Live Output: Real-time streaming for long-running commands
  • ๐ŸŽจ Beautiful CLI: Colored output with markdown rendering
  • ๐Ÿ“Š Token Tracking: Displays API token usage after each interaction
  • ๐Ÿ”ง Cross-Platform: Works on Windows, macOS, and Linux

๐Ÿš€ Quick Start

# Install Bun (if not already installed)
curl -fsSL https://bun.sh/install | bash

# Set your API key
export ANTHROPIC_API_KEY=your_key_here
# Or on Windows:
# set ANTHROPIC_API_KEY=your_key_here

# Run nanocode
bun run index.ts
# Or make it executable:
chmod +x index.ts && ./index.ts

๐ŸŽฎ Commands

Command Description
/q or exit Quit the assistant
/c Clear conversation history

๐Ÿ”ง Available Tools

  1. read - Read files with line numbers (supports offset/limit)
  2. write - Write content to files
  3. edit - Find and replace in files (supports single or all occurrences)
  4. glob - Find files by pattern (sorted by modification time)
  5. grep - Search files with regex (limited to 50 results)
  6. exec - Execute commands with live output and custom timeout (1ms - 300s)
  7. list - List directory contents (supports recursive listing)
  8. delete - Delete files/directories (supports recursive deletion)
  9. move - Move or rename files
  10. copy - Copy files/directories (supports recursive copy)

๐Ÿ“ Example Usage

|> What files are in this directory?
โบ glob({"pattern":"*"})
  |> README.md ... +5 files

|> Read the first 10 lines of index.ts
โบ read({"path":"index.ts","limit":10})
  |> 1| #!/usr/bin/env bun ... +9 lines

|> Find all TODO comments
โบ grep({"pattern":"TODO"})
  |> index.ts:42:// TODO: Add error handling ... +2 lines

|> Run tests with live output
โบ exec({"command":"npm test","timeout":60000})
  [stdout] Running tests...
  [stdout] โœ“ Test 1 passed
  [stderr] Warning: deprecated API
  [exit: 0]

๐Ÿ“Š Tokens: 1250 in, 340 out, 1590 total

โš™๏ธ Configuration

Environment variables:

API_URL=http://127.0.0.1:8045/v1/messages  # API endpoint
MODEL=claude-opus-4-5                       # Claude model
GREP_LIMIT=50                               # Max grep results
MAX_FILE_SIZE=10485760                      # Max file size (10MB)
ANTHROPIC_API_KEY=sk-ant-...                # Your API key

๐ŸŽฏ Use Cases

  • Code Generation: "Create a React component with TypeScript"
  • Refactoring: "Refactor this function to use async/await"
  • Bug Fixing: "Fix the type errors in this file"
  • Code Review: "Review this code and suggest improvements"
  • Documentation: "Add JSDoc comments to all functions"
  • Testing: "Generate unit tests for this module"

๐Ÿงช Advanced Features

Context-Aware Responses

The AI knows your system environment:

System Prompt includes:
- OS: win32 x64 (or darwin arm64, linux x64, etc.)
- Current time: 2026-01-11T11:26:56.779Z
- Working directory: /path/to/project

Live Command Execution

Use exec for commands with real-time output:

|> Run build with live output
โบ exec({"command":"npm run build","timeout":120000})
  [stdout] Building...
  [stdout] โœ“ Compiled successfully
  [exit: 0]

Smart File Filtering

Automatically ignores common directories:

  • .git, node_modules, dist, build
  • .next, coverage, .cache

๐Ÿ“š Documentation

  • CLAUDE.md - Architecture and design notes for AI

๐Ÿค Contributing

This is a minimal, educational project. Key principles:

  • Single file - Keep everything in index.ts
  • Zero dependencies - Only use Bun APIs
  • Simple & clear - Readable code over clever abstractions

๐Ÿ“„ License

MIT License - Feel free to use, modify, and distribute.

๐Ÿ™ Acknowledgments

Built with:

  • Bun - Fast JavaScript runtime
  • Claude AI - Anthropic's AI assistant
  • TypeScript - Type-safe JavaScript

Version: Enhanced - January 2026
Lines of Code: ~345
Dependencies: 0
Awesomeness: โˆž

About

Single-file AI coding assistant (~350 LOC). Claude API with tool calling. TypeScript + Bun. Zero dependencies.

Topics

aiclaudeclaude-codecode-toolsminimalnanotinyvibe-coding

Resources

Readme
Activity

Stars

26 stars

Watchers

0 watching

Forks

1 fork
Report repository

Contributors

Languages

You are visitor 01402503 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.