Skip to content

ratna3/theJoker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸƒ The Joker - Agentic Terminal

TypeScript Node.js LM Studio Tests Coverage License


GitHub Twitter Discord Email


An autonomous AI-powered terminal that understands natural language queries, scrapes the web intelligently, generates complete projects, and deploys applications.

Powered by LM Studio's qwen2.5-coder-14b-instruct-uncensored model


πŸ“– Table of Contents


✨ Features

Category Features
🧠 AI Agent Natural language understanding, autonomous task execution, self-correction
🌐 Web Scraping Puppeteer-based scraping with stealth mode and anti-detection
πŸ“ Project Generation Create complete projects from natural language descriptions
πŸš€ Deployment Docker, Kubernetes, and CI/CD pipeline automation
πŸ’Ύ Memory Persistent context across sessions with intelligent summarization
🎨 CLI Beautiful terminal UI with rich formatting and progress indicators
πŸ”„ Error Handling Retry logic, circuit breakers, and graceful degradation
πŸ§ͺ Testing 966 tests with 80%+ coverage across 22 test suites

πŸš€ Quick Start

# Clone the repository
git clone https://github.com/yourusername/theJoker.git
cd theJoker

# Install dependencies
npm install

# Copy environment configuration
cp .env.example .env

# Start LM Studio with qwen2.5-coder-14b-instruct-uncensored
# Make sure it's running at http://xxx.xxx.xx.x:xxxx

# Build and run
npm run build
npm start

πŸ“¦ Installation

Prerequisites

  • Node.js 18.x or higher
  • npm 9.x or higher
  • LM Studio with a compatible model loaded
  • Windows/Linux/macOS with Puppeteer support

Step-by-Step Installation

  1. Clone the repository

    git clone https://github.com/yourusername/theJoker.git
    cd theJoker
  2. Install dependencies

    npm install
  3. Configure environment

    cp .env.example .env
    # Edit .env with your LM Studio endpoint
  4. Build the project

    npm run build
  5. Start LM Studio

    • Open LM Studio
    • Load qwen2.5-coder-14b-instruct-uncensored (or similar model)
    • Start the local server at http://192.xxx.xx.x:xxxx
  6. Run The Joker

    npm start

βš™οΈ Configuration

Environment Variables

Create a .env file in the project root:

# LM Studio Configuration
LM_STUDIO_ENDPOINT=http://xxx.xxx.xx.x:xxxx
LM_STUDIO_MODEL=qwen2.5-coder-14b-instruct-uncensored

# LLM Settings
LLM_TEMPERATURE=0.7
LLM_MAX_TOKENS=4096
LLM_TIMEOUT=60000

# Puppeteer Configuration
PUPPETEER_HEADLESS=true
PUPPETEER_TIMEOUT=30000

# Application Settings
DEBUG_MODE=false
LOG_LEVEL=info
MAX_RETRIES=3
CACHE_TTL=300000

Configuration File

Additional settings can be configured in config/default.json:

{
  "llm": {
    "endpoint": "http://xxx.xxx.xx.x:xxxx",
    "model": "qwen2.5-coder-14b-instruct-uncensored",
    "temperature": 0.7,
    "maxTokens": 4096
  },
  "scraper": {
    "headless": true,
    "timeout": 30000,
    "userAgentRotation": true
  },
  "agent": {
    "maxIterations": 10,
    "memoryPersistence": true
  }
}

πŸ“ Usage

Interactive Mode

Start The Joker in interactive mode:

npm start

You'll see the welcome banner:

╔═══════════════════════════════════════════╗
β•‘                                           β•‘
β•‘   πŸƒ  THE JOKER - Agentic Terminal  πŸƒ     β•‘
β•‘                                           β•‘
β•‘   Powered by qwen2.5-coder-14b            β•‘
β•‘   Type your query or 'help' for commands  β•‘
β•‘                                           β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

πŸƒ Joker >

Example Queries

Find Information:

πŸƒ Joker > Find the top 5 programming languages in 2024

Search for Places:

πŸƒ Joker > Find best places to eat in Chicago

Scrape a Website:

πŸƒ Joker > Extract all links from https://example.com

Compare Items:

πŸƒ Joker > Compare React vs Vue for web development

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           THE JOKER TERMINAL                                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                β”‚
β”‚  β”‚  User Input │───▢│ Intent Parser│───▢│   Agent Planner     β”‚                β”‚
β”‚  β”‚   (CLI)     β”‚    β”‚   (LLM)      β”‚    β”‚   (LLM + Tools)     β”‚                β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β”‚
β”‚                                                     β”‚                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚  β”‚                          TOOL EXECUTOR                                      β”‚β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚β”‚
β”‚  β”‚  β”‚  WEB SCRAPING TOOLS                                                  β”‚   β”‚β”‚
β”‚  β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”‚   β”‚β”‚
β”‚  β”‚  β”‚  β”‚   Web    β”‚  β”‚Puppeteer β”‚  β”‚   Data   β”‚  β”‚   Link   β”‚            β”‚   β”‚β”‚
β”‚  β”‚  β”‚  β”‚  Search  β”‚  β”‚ Scraper  β”‚  β”‚Processor β”‚  β”‚Extractor β”‚            β”‚   β”‚β”‚
β”‚  β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β”‚   β”‚β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β”‚                                                     β”‚                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚  β”‚                       OUTPUT FORMATTER                                      β”‚β”‚
β”‚  β”‚     Structured Results + Code + Links + Files + Terminal Display           β”‚β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Directory Structure

theJoker/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts                 # Entry point
β”‚   β”œβ”€β”€ cli/
β”‚   β”‚   β”œβ”€β”€ terminal.ts          # Terminal interface
β”‚   β”‚   β”œβ”€β”€ commands.ts          # Command handlers
β”‚   β”‚   β”œβ”€β”€ display.ts           # Output formatting
β”‚   β”‚   β”œβ”€β”€ progress.ts          # Progress tracking
β”‚   β”‚   └── formatter.ts         # Result formatting
β”‚   β”œβ”€β”€ agents/
β”‚   β”‚   β”œβ”€β”€ agent.ts             # Main agent loop
β”‚   β”‚   β”œβ”€β”€ planner.ts           # Action planning
β”‚   β”‚   β”œβ”€β”€ executor.ts          # Tool execution
β”‚   β”‚   └── memory.ts            # Session memory
β”‚   β”œβ”€β”€ llm/
β”‚   β”‚   β”œβ”€β”€ client.ts            # LM Studio API client
β”‚   β”‚   β”œβ”€β”€ prompts.ts           # Prompt templates
β”‚   β”‚   β”œβ”€β”€ parser.ts            # Response parsing
β”‚   β”‚   └── summarizer.ts        # LLM summarization
β”‚   β”œβ”€β”€ scraper/
β”‚   β”‚   β”œβ”€β”€ browser.ts           # Puppeteer setup
β”‚   β”‚   β”œβ”€β”€ navigator.ts         # Page navigation
β”‚   β”‚   β”œβ”€β”€ extractor.ts         # Data extraction
β”‚   β”‚   └── stealth.ts           # Anti-detection
β”‚   β”œβ”€β”€ tools/
β”‚   β”‚   β”œβ”€β”€ registry.ts          # Tool registry
β”‚   β”‚   β”œβ”€β”€ search.ts            # Web search tool
β”‚   β”‚   β”œβ”€β”€ scrape.ts            # Scraping tool
β”‚   β”‚   └── process.ts           # Data processing
β”‚   β”œβ”€β”€ errors/
β”‚   β”‚   β”œβ”€β”€ handler.ts           # Error handling
β”‚   β”‚   β”œβ”€β”€ retry.ts             # Retry logic
β”‚   β”‚   └── circuit-breaker.ts   # Circuit breaker
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ logger.ts            # Logging
β”‚   β”‚   β”œβ”€β”€ config.ts            # Configuration
β”‚   β”‚   β”œβ”€β”€ cache.ts             # Caching utilities
β”‚   β”‚   β”œβ”€β”€ cleaner.ts           # Data cleaning
β”‚   β”‚   β”œβ”€β”€ links.ts             # Link validation
β”‚   β”‚   └── validators.ts        # Input validation
β”‚   └── types/
β”‚       β”œβ”€β”€ index.ts             # TypeScript types
β”‚       └── errors.ts            # Error types
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ unit/                    # Unit tests
β”‚   └── integration/             # Integration tests
β”œβ”€β”€ config/
β”‚   └── prompts/                 # Prompt templates
β”œβ”€β”€ logs/                        # Log files
β”œβ”€β”€ .env.example                 # Environment template
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

πŸ’» Built-in Commands

Command Alias Description
help h, ? Show available commands
clear cls, c Clear terminal
exit quit, q Exit The Joker
history hist Show command history
status stat Check LM Studio connection
banner Show welcome banner
version ver, v Show version info
agent Run a query through the agent
memory mem Show agent memory stats
agent-status Show agent state
reset-agent Reset agent state

πŸ”§ Available Tools

web_search

Search the web for information.

Parameters:
  - query: string (required) - Search query
  - numResults: number (default: 10) - Number of results
  - engine: string (default: 'google') - Search engine

scrape_page

Scrape content from a web page.

Parameters:
  - url: string (required) - URL to scrape
  - selectors: object (optional) - CSS selectors for extraction
  - waitFor: string (optional) - Wait for element
  - scroll: boolean (default: true) - Scroll to load content

extract_links

Extract all links from a page.

Parameters:
  - url: string (required) - URL to extract from
  - filter: string (optional) - Domain filter

process_data

Process and structure scraped data.

Parameters:
  - data: any (required) - Data to process
  - operation: string (required) - Operation type
  - options: object (optional) - Processing options

πŸ‘¨β€πŸ’» Development

Development Mode

# Run in development mode with hot reload
npm run dev

# Build in watch mode
npm run build:watch

Scripts

Script Description
npm start Run the compiled application
npm run dev Run with ts-node
npm run build Compile TypeScript
npm run build:watch Compile with watch mode
npm test Run all tests
npm run test:watch Run tests in watch mode
npm run test:coverage Run tests with coverage
npm run lint Run ESLint
npm run lint:fix Fix ESLint issues
npm run format Format with Prettier
npm run clean Remove dist and logs

πŸ§ͺ Testing

Running Tests

# Run all tests
npm test

# Run tests with coverage
npm run test:coverage

# Run specific test file
npm test -- --testPathPatterns="parser"

# Run tests in watch mode
npm run test:watch

Test Coverage

The project maintains comprehensive test coverage:

Test Suite Tests Status
Agent System 120+ βœ… Passing
LLM Integration 80+ βœ… Passing
Web Scraper 90+ βœ… Passing
Tools 100+ βœ… Passing
CLI 80+ βœ… Passing
Error Handling 70+ βœ… Passing
Project Management 100+ βœ… Passing
Utilities 150+ βœ… Passing
Total 966 βœ… All Passing

🀝 Contributing

We welcome contributions! Please read our Contributing Guide first.

Quick Contributing Steps

  1. Read the CONTRIBUTING.md for guidelines
  2. Check open issues
  3. Comment on an issue to get assigned
  4. Make your changes following our coding standards
  5. Submit a Pull Request

⚠️ Important: This project uses the TJCL License. By contributing, you agree to the license terms.


πŸ”’ Security

Found a security vulnerability? Please read our Security Policy and report responsibly.

DO NOT create public issues for security vulnerabilities.

πŸ“§ Report to: ratnakirtiscr@gmail.com


πŸ“– Documentation

For comprehensive documentation, see:


πŸ“„ License

This project is licensed under The Joker Contribution License (TJCL) v1.0.

Permission Status
View source code βœ… Allowed
Contribute (Pull Requests) βœ… Allowed
Personal non-commercial use βœ… Allowed
Clone/Fork repository ❌ Not Allowed
Redistribute ❌ Not Allowed
Commercial use ❌ Not Allowed

See the LICENSE file for details.


πŸ™ Acknowledgments

Open Source Libraries

This project is built with these amazing open source libraries:

Library Purpose License
Puppeteer Browser automation Apache-2.0
puppeteer-extra Plugin system MIT
puppeteer-extra-plugin-stealth Stealth mode MIT
Axios HTTP client MIT
Cheerio HTML parsing MIT
Chalk Terminal styling MIT
Winston Logging MIT
Jest Testing MIT
TypeScript Type safety Apache-2.0

Special Thanks

  • LM Studio for local LLM inference
  • The open source community for their amazing tools and libraries

πŸ‘€ Author

Ratna Kirti

GitHub Twitter Discord Email


Made with ❀️ by Ratna Kirti

πŸƒ The Joker - Agentic Terminal v1.0.0

About

An autonomous AI-powered terminal that understands natural language queries, scrapes the web intelligently, processes data, and returns structured results with proper links. Powered by LM Studio's censored & uncensored model.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages