Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,22 @@
<a href="https://github.com/josharsh/100LinesOfAICode/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/josharsh/100LinesOfAICode?style=for-the-badge&logo=opensourceinitiative&logoColor=white&color=green" alt="License">
</a>
<a href="https://github.com/josharsh/100LinesOfAICode/pulls">
<img src="https://img.shields.io/github/issues-pr/josharsh/100LinesOfAICode?style=for-the-badge&logo=gitpullrequest&logoColor=white&color=purple" alt="PRs">
</a>
<a href="https://github.com/josharsh/100LinesOfAICode/graphs/contributors">
<img src="https://img.shields.io/github/contributors/josharsh/100LinesOfAICode?style=for-the-badge&logo=users&logoColor=white&color=orange" alt="Contributors">
</a>
</p>

<p align="center">
<img src="https://img.shields.io/badge/python-3.8+-3776AB?style=for-the-badge&logo=python&logoColor=white" alt="Python">
<img src="https://img.shields.io/badge/AI_Tools-8-FF6B6B?style=for-the-badge&logo=anthropic&logoColor=white" alt="AI Tools">
<img src="https://img.shields.io/badge/Lines-1908-4ECDC4?style=for-the-badge&logo=codesandbox&logoColor=white" alt="Lines">
<img src="https://img.shields.io/badge/AI_Tools-17-FF6B6B?style=for-the-badge&logo=anthropic&logoColor=white" alt="AI Tools">
<img src="https://img.shields.io/badge/Lines-~1900-4ECDC4?style=for-the-badge&logo=codesandbox&logoColor=white" alt="Lines">
<img src="https://img.shields.io/badge/Hacktoberfest-2024-orange?style=for-the-badge&logo=hackernoon&logoColor=white" alt="Hacktoberfest">
<a href="https://discord.gg">
<img src="https://img.shields.io/badge/Discord-Join-blue?style=for-the-badge&logo=discord&logoColor=white" alt="Discord">
</a>
</p>


Expand Down
19 changes: 19 additions & 0 deletions commit-ai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,25 @@ python commit.py # Generate message
python commit.py --commit # Auto-commit
```

## Usage Demo

```bash
$ git add .
$ python commit.py

📝 Analyzing your changes...

✨ Generated Commit Message:
feat(api): add user authentication endpoint

- Implement JWT token generation
- Add password hashing with bcrypt
- Create login and register routes

🔗 Copy or auto-commit? [c/a]: c
✓ Message copied to clipboard!
```

## Output

```
Expand Down
34 changes: 34 additions & 0 deletions explain-to-pm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,40 @@ export ANTHROPIC_API_KEY=your_key
python translator.py
```

## Usage Demo

```bash
$ python translator.py

🔄 AI translating tech to business...

What did you build?
> Added caching layer with Redis

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🤓 TECHNICAL:
"Added Redis caching layer with TTL and invalidation"

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
👔 FOR YOUR PM:
"Faster page loads - from 2s to 200ms"

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💼 FOR EXECUTIVES:
"40% performance improvement, reduced server costs
by $3K/month through efficient caching"

━━━━━━━━━━━━━━━━━━━━━━━━━━━
👶 ELI5:
"Added a shortcut so the computer remembers
things instead of asking over and over"

━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 FOR DEMO:
"See how fast the dashboard loads now?"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```

## Output

```
Expand Down
21 changes: 21 additions & 0 deletions name-it/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,27 @@ python namer.py # Interactive
python namer.py "list of active users" # Direct
```

## Usage Demo

```bash
$ python namer.py "list of active users"

🔍 AI analyzing your variable purpose...

📝 Top Suggestions:
1. activeUserIds - camelCase, most common
2. active_users - snake_case, Python style
3. userList - simple, context-dependent

🎯 In Different Contexts:
• Class: self.active_user_ids
• Function: def get_active_users(active_user_ids):
• Database: active_user_ids
• JSON: "activeUserIds"

⚡ Tip: Python uses snake_case for variables
```

## Output

```
Expand Down
30 changes: 30 additions & 0 deletions pr-writer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,36 @@ git add . && git commit -m "your changes"
python writer.py
```

## Usage Demo

```bash
$ git add . && git commit -m "added auth"
$ python writer.py

📝 Analyzing your changes...

## 🎯 What This Does
Implements JWT-based authentication with token refresh

## 🤔 Why We Need It
Users were logged out randomly (40+ tickets/week)

## ⚙️ How It Works
1. User logs in → server generates JWT
2. Token stored in httpOnly cookie
3. Middleware validates each request

## ✅ Testing
- [x] Unit tests (12 new tests)
- [x] Integration tests
- [x] Manual staging testing

## 🚀 Deployment Notes
Requires REDIS_URL environment variable

✨ Copied to clipboard! Ready to paste into GitHub/GitLab!
```

## Output

```
Expand Down
31 changes: 31 additions & 0 deletions roast-commits/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,37 @@ export ANTHROPIC_API_KEY=your_key
python roaster.py
```

## Usage Demo

```bash
$ python roast-commits.py

📊 Analyzing your commit history...

🏆 HALL OF SHAME

1. "wip"
👉 Work In Progress? More like Work In Procrastination!

2. "stuff"
👉 Very specific. Outstanding work.

3. "tmp"
👉 Temporary name for a permanent mistake.

━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 YOUR GRADE: C-
You're better than 35% of developers!
━━━━━━━━━━━━━━━━━━━━━━━━━━━

💡 Tips for Better Commits:
✅ Use conventional commits: feat(), fix(), docs()
✅ Be specific about WHAT changed
✅ Explain WHY if it's complex

😂 Remember: Future you will thank present you!
```

## Output

```
Expand Down
58 changes: 58 additions & 0 deletions terminal-ai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,27 @@ python terminal.py
python terminal.py find all large files
```

## Usage Demo

```bash
$ python terminal.py find all files larger than 100MB

🤖 Analyzing your request...

💻 Command: find . -type f -size +100M -exec ls -lh {} \; | sort -k5 -h
📖 Explanation: Finds files over 100MB, lists them with human-readable sizes, sorted by size
⚠️ Risks: None

❓ Execute? [y/N]: y

📤 Output:
1.2G ./backups/old_backup.tar.gz
450M ./videos/project_demo.mp4
120M ./datasets/training_data.csv

✅ Complete! Found 3 large files.
```

## Example Session

```
Expand Down Expand Up @@ -43,4 +64,41 @@ python terminal.py list top 10 CPU-consuming processes
python terminal.py compress all images in this folder
```

## Troubleshooting

### 🔑 Missing API Key
```
⚠️ ANTHROPIC_API_KEY not found!

Set it with:
export ANTHROPIC_API_KEY="your-key"

Get your key: https://console.anthropic.com/
```

### 🌐 Network Errors
The tool automatically retries failed API calls **3 times** with exponential backoff. If errors persist:
- Check your internet connection
- Verify firewall/proxy settings
- Try again later (possible API outage)

### ⏰ Command Timeout
Shell commands are limited to **30 seconds**. If your command times out:
- Try a more specific/narrow request
- Run the suggested command directly in your terminal
- Use `safe off` mode for more flexibility

### 🚫 Command Blocked
```
⛔ Dangerous command blocked by safe mode
```
This is intentional! Safe mode protects you from destructive commands. Use `--unsafe` flag if you really need to run it.

### ❓ Empty Input
```
💭 What do you want to do?
⚠️ Please describe what you'd like to do!
```
Simply describe what you want to accomplish in natural language.

**88 lines. Safe by default.**
24 changes: 24 additions & 0 deletions week-recap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,30 @@ python recap.py # Last 7 days
python recap.py 14 # Last 2 weeks
```

## Usage Demo

```bash
$ python recap.py

📊 Analyzing your git history...

🎯 Your Week: Mar 10-14, 2025

Highlights:
• Added user authentication (PR #456)
• Fixed memory leak in data processor
• Refactored API endpoints for performance
• Code reviewed 8 PRs

💬 Copy-Paste Ready:
"This week I added user authentication, fixed a memory leak,
refactored API endpoints, and reviewed 8 PRs."

📈 Productivity: 47 commits across 12 files

✅ Ready for your standup!
```

## Output

```
Expand Down