Skip to content

Commit 8022176

Browse files
authored
Merge branch 'main' into dev
2 parents 14b5208 + d2cbd72 commit 8022176

4 files changed

Lines changed: 127 additions & 1 deletion

File tree

.github/workflows/test-dev.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Test Dev Branch
2+
on:
3+
push:
4+
branches: [dev]
5+
pull_request:
6+
branches: [dev]
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: '3.11'
16+
- name: Install deps
17+
run: pip install pytest tiktoken
18+
- name: Run tests
19+
run: pytest tests/ -v

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"tests"
44
],
55
"python.testing.unittestEnabled": false,
6-
"python.testing.pytestEnabled": true
6+
"python.testing.pytestEnabled": true,
7+
"pieces.cloudCapabilities": "Blended"
78
}

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,26 @@ November 2025
6565
AI Token Crusher – Because nobody should pay for whitespace.
6666

6767

68+
# AI Token Crusher
69+
70+
**Cut up to 75% of tokens for Grok • GPT • Claude • Llama • Gemini**
71+
100% offline • Open source • AI-safe token minifier
72+
73+
![AI Token Crusher](assets/screenshot1.png)
74+
75+
### Features
76+
- 20+ aggressive yet safe optimizations
77+
- Real-time savings counter
78+
- Full control with checkboxes
79+
- Copy to clipboard • One-click save
80+
- 100% offline • No telemetry
81+
82+
### Download
83+
[Latest Windows .exe →](https://github.com/totalbrain/TokenOptimizer/releases/latest)
84+
85+
### Roadmap
86+
[View all planned features](https://github.com/users/totalbrain/projects/1)
87+
88+
**Free forever • MIT License • Made for AI developers**
89+
90+
⭐ Star if you saved tokens today!

setup-dev-branch.ps1

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# setup-dev-branch.ps1 - AI Token Crusher Dev Branch Setup
2+
3+
$Token = "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"
4+
$Owner = "totalbrain"
5+
$Repo = "TokenOptimizer"
6+
7+
$Headers = @{
8+
Authorization = "Bearer $Token"
9+
Accept = "application/vnd.github+json"
10+
}
11+
12+
Write-Host "Creating dev branch setup..." -ForegroundColor Cyan
13+
14+
# 1. Create dev branch from main
15+
git checkout main
16+
git pull origin main
17+
git checkout -b dev
18+
git push origin dev
19+
20+
# 2. Set dev as default branch
21+
Invoke-RestMethod -Method Patch -Uri "https://api.github.com/repos/$Owner/$Repo" -Headers $Headers -Body (@{
22+
default_branch = "dev"
23+
} | ConvertTo-Json)
24+
25+
# 3. Protect main branch (require PR, 1 approval)
26+
$protect = @{
27+
required_pull_request_reviews = @{
28+
required_approving_review_count = 1
29+
}
30+
enforce_admins = $true
31+
}
32+
Invoke-RestMethod -Method Put -Uri "https://api.github.com/repos/$Owner/$Repo/branches/main/protection" -Headers $Headers -Body ($protect | ConvertTo-Json -Depth 10)
33+
34+
# 4. Update README with workflow
35+
$readme_content = @"
36+
## Workflow
37+
- Fork the repo
38+
- Create feature/issue-# branch from dev
39+
- Work on the issue
40+
- PR to dev
41+
- After tests/approve, merge to dev
42+
- For release: PR dev to main
43+
"@
44+
$readme_base64 = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($readme_content))
45+
$existing_readme = Invoke-RestMethod "https://api.github.com/repos/$Owner/$Repo/contents/README.md" -Headers $Headers
46+
Invoke-RestMethod -Method Put -Uri "https://api.github.com/repos/$Owner/$Repo/contents/README.md" -Headers $Headers -Body (@{
47+
message = "Update README with workflow"
48+
content = $readme_base64
49+
sha = $existing_readme.sha
50+
} | ConvertTo-Json)
51+
52+
# 5. Create GitHub Actions for tests on dev
53+
mkdir .github/workflows -ErrorAction SilentlyContinue
54+
$actions_yaml = @"
55+
name: Test Dev Branch
56+
on:
57+
push:
58+
branches: [dev]
59+
pull_request:
60+
branches: [dev]
61+
jobs:
62+
test:
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v4
66+
- name: Set up Python
67+
uses: actions/setup-python@v5
68+
with:
69+
python-version: '3.11'
70+
- name: Install deps
71+
run: pip install pytest tiktoken
72+
- name: Run tests
73+
run: pytest tests/ -v
74+
"@
75+
$actions_yaml | Out-File -FilePath ".github/workflows/test-dev.yml" -Encoding utf8
76+
77+
# 6. Commit and push
78+
git add .
79+
git commit -m "setup: dev branch workflow, protected main, actions tests"
80+
git push origin dev
81+
82+
Write-Host "All done! Dev branch is ready." -ForegroundColor Green
83+
Write-Host "Contributors now PR to dev, merge after tests, then PR dev to main for release." -ForegroundColor Green

0 commit comments

Comments
 (0)