Skip to content

Commit a0f9947

Browse files
zhujian0805James Zhu
authored andcommitted
Adding all the features
1 parent 6abe67a commit a0f9947

File tree

675 files changed

+155591
-1069
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

675 files changed

+155591
-1069
lines changed

.env.example

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
# Example environment variables for ai-toolboxx
1+
# Example environment variables for code-assistant-manager
22
# Copy this file to .env and fill in your secrets. Do NOT commit .env with real keys.
33
# Example:
44
# API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx
55

66
# API key used by endpoints' list_models commands
77
# You can provide per-endpoint keys. If a per-endpoint key is set it will be used;
88
# otherwise `API_KEY` will be used as a fallback.
9-
API_KEY=
9+
# API_KEY=
1010

1111
# Per-endpoint API keys (optional)
12-
API_KEY_LITELLM=
13-
API_KEY_COPILOT=
12+
API_KEY_LITELLM=sk-***
13+
API_KEY_COPILOT=sk-***
14+
15+
GITHUB_TOKEN=ghu_c***
16+
17+
# gemini api key auth
18+
GEMINI_API_KEY=AI***
19+
20+
# vertex api auth
21+
GOOGLE_APPLICATION_CREDENTIALS=~/.config/gcloud/*****
22+
GOOGLE_CLOUD_PROJECT=****
23+
GOOGLE_CLOUD_LOCATION=global
24+
GOOGLE_GENAI_USE_VERTEXAI="true"

.flake8

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[flake8]
2+
# Flake8 configuration for code-assistant-manager
3+
4+
# Compatibility with Black
5+
max-line-length = 88
6+
extend-ignore = E203, W503, E501
7+
8+
# Exclude patterns
9+
exclude =
10+
.git,
11+
__pycache__,
12+
.venv,
13+
venv,
14+
env,
15+
.eggs,
16+
*.egg,
17+
build,
18+
dist,
19+
.tox,
20+
.mypy_cache,
21+
.pytest_cache,
22+
node_modules,
23+
*.egg-info
24+
25+
# Complexity
26+
max-complexity = 15
27+
28+
# McCabe complexity
29+
# Default is 10, we allow slightly more for complex CLI logic
30+
per-file-ignores =
31+
__init__.py:F401,F403
32+
cli.py:C901
33+
tools/base.py:C901,B950,B907
34+
code_assistant_manager/cli/commands.py:C901,F401,F811,B950,B110
35+
code_assistant_manager/cli/doctor.py:C901,B950
36+
code_assistant_manager/cli/upgrade.py:C901,F401,F811,B950
37+
code_assistant_manager/cli/utils.py:F401,C901
38+
code_assistant_manager/mcp/server_commands.py:B008,B950,E731,C901,F541,B907
39+
code_assistant_manager/tools/__init__.py:B950
40+
code_assistant_manager/tools/codebuddy.py:B950
41+
code_assistant_manager/tools/crush.py:B950,B907
42+
code_assistant_manager/tools/droid.py:B950,B907
43+
code_assistant_manager/upgrades/npm_upgrade.py:B950,B907
44+
code_assistant_manager/upgrades/shell_upgrade.py:B950,B907
45+
tests/test_cli.py:F401,F811,F841,B908
46+
tests/test_filtering.py:F401,F841
47+
tests/test_ui.py:F401
48+
tests/test_ui_key_provider.py:F401
49+
tests/test_ui_numeric_fallback.py:F401
50+
tests/test_ui_pexpect_integration.py:F401
51+
tests/test_upgrade_functionality.py:F401,B950
52+
53+
# Plugins configuration
54+
# flake8-bugbear, flake8-comprehensions, flake8-simplify
55+
select = C,E,F,W,B,B9

.github/copilot-instructions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copilot Instructions for Testing
2+
3+
This is a test instruction file for GitHub Copilot CLI custom instructions support.
4+
5+
## Guidelines
6+
7+
- Write clear, maintainable code
8+
- Test everything before committing
9+
- Follow the repository's coding style

.github/workflows/pylint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Pylint
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.8", "3.9", "3.10"]
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python ${{ matrix.python-version }}
14+
uses: actions/setup-python@v3
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install pylint radon
21+
- name: Analysing the code with pylint
22+
run: |
23+
pylint $(git ls-files '*.py')
24+
- name: Check code complexity
25+
run: |
26+
echo "=== Code Complexity Analysis ==="
27+
radon cc --min C --show-complexity --total-average $(git ls-files '*.py')
28+
echo ""
29+
echo "=== Maintainability Index ==="
30+
radon mi --min C $(git ls-files '*.py')
31+
- name: Check file sizes
32+
run: |
33+
python scripts/check_file_sizes.py

.gitignore

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,20 @@
22
.env.local
33
# token files
44
*token*
5-
.serena
6-
endpoints.conf
5+
.qwen
6+
settings.conf
7+
test_*.sh
8+
*_test.sh
9+
*__pycache__*
10+
.serena/
11+
build
12+
*egg-info*
13+
.neovate
14+
*.log
15+
dist
16+
.crush/
17+
.mcp.json
18+
.venv
19+
.claude/*
20+
codebuddy_usage.md
21+
.coverage

.neovate/config.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"mcpServers": {
3+
"context7": {
4+
"type": "stdio",
5+
"command": "npx",
6+
"args": []
7+
},
8+
"memory": {
9+
"type": "stdio",
10+
"command": "npx",
11+
"args": []
12+
},
13+
"sequential-thinking": {
14+
"type": "stdio",
15+
"command": "npx",
16+
"args": []
17+
},
18+
"serena": {
19+
"type": "stdio",
20+
"command": "uvx",
21+
"args": [
22+
"serena",
23+
"start-mcp-server"
24+
]
25+
}
26+
}
27+
}

.pre-commit-config.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
repos:
2+
# Standard pre-commit hooks
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.5.0
5+
hooks:
6+
- id: trailing-whitespace
7+
exclude: '\.patch$'
8+
- id: end-of-file-fixer
9+
exclude: '\.patch$'
10+
- id: check-yaml
11+
- id: check-json
12+
- id: check-added-large-files
13+
args: ['--maxkb=1000']
14+
- id: check-case-conflict
15+
- id: check-merge-conflict
16+
- id: check-toml
17+
- id: debug-statements
18+
- id: mixed-line-ending
19+
args: ['--fix=lf']
20+
21+
# Python code formatting
22+
- repo: https://github.com/psf/black
23+
rev: 24.3.0
24+
hooks:
25+
- id: black
26+
language_version: python3
27+
args: ['--config=pyproject.toml']
28+
29+
# Import sorting
30+
- repo: https://github.com/pycqa/isort
31+
rev: 5.13.2
32+
hooks:
33+
- id: isort
34+
args: ['--profile=black', '--line-length=88']

CLAUDE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# CLAUDE.md — Claude Code Assistant Instructions
2+
3+
This file documents repository-level expectations and instructions intended to guide contributors and AI-assisted editing tools (like Claude Code) when making changes in this project.
4+
5+
- Ask for approval before any git commit and push
6+
- Always run tests before completing all development of new changes
7+
- Always test the CLI usages for the change related
8+
- Never commit credentials, keys, .env files
9+
- After any changes, run the folling to reinstall the project:
10+
```
11+
rm -rf dist/*
12+
./install.sh uninstall
13+
./install.sh
14+
cp ~/.config/code-assistant-manager/providers.json.bak ~/.config/code-assistant-manager/providers.json
15+
```

Makefile

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
.PHONY: help install dev-install clean test lint format type-check security check pre-commit-install pre-commit-run build release
2+
3+
# Default target
4+
help:
5+
@echo "Available commands:"
6+
@echo " make install - Install package for production use"
7+
@echo " make dev-install - Install package with development dependencies"
8+
@echo " make clean - Remove build artifacts and caches"
9+
@echo " make test - Run test suite"
10+
@echo " make lint - Run linting (flake8)"
11+
@echo " make format - Format code (black, isort)"
12+
@echo " make type-check - Run type checking (mypy)"
13+
@echo " make security - Run security checks (bandit)"
14+
@echo " make check - Run all quality checks (lint, type-check, test)"
15+
@echo " make pre-commit-install - Install pre-commit hooks"
16+
@echo " make pre-commit-run - Run pre-commit on all files"
17+
@echo " make build - Build distribution packages"
18+
@echo " make release - Full release workflow (clean, test, build)"
19+
20+
# Installation
21+
install:
22+
pip install -e .
23+
24+
dev-install:
25+
pip install -e ".[dev]"
26+
$(MAKE) pre-commit-install
27+
28+
# Cleaning
29+
clean:
30+
rm -rf build/
31+
rm -rf dist/
32+
rm -rf *.egg-info
33+
rm -rf .pytest_cache/
34+
rm -rf .mypy_cache/
35+
rm -rf .tox/
36+
rm -rf htmlcov/
37+
rm -rf .coverage
38+
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
39+
find . -type f -name "*.pyc" -delete
40+
find . -type f -name "*.pyo" -delete
41+
find . -type f -name "*.orig" -delete
42+
43+
# Testing
44+
test:
45+
pytest tests/ -v
46+
47+
test-cov:
48+
pytest tests/ -v --cov=code_assistant_manager --cov-report=html --cov-report=term
49+
50+
# Code quality
51+
lint:
52+
@echo "Running flake8..."
53+
flake8 code_assistant_manager/
54+
55+
format:
56+
@echo "Running isort..."
57+
isort code_assistant_manager/ tests/
58+
@echo "Running black..."
59+
black code_assistant_manager/ tests/
60+
61+
format-check:
62+
@echo "Checking isort..."
63+
isort --check-only code_assistant_manager/ tests/
64+
@echo "Checking black..."
65+
black --check code_assistant_manager/ tests/
66+
67+
type-check:
68+
@echo "Running mypy..."
69+
mypy code_assistant_manager/
70+
71+
security:
72+
@echo "Running bandit..."
73+
bandit -r code_assistant_manager/ -c pyproject.toml
74+
75+
docstring-check:
76+
@echo "Checking docstring coverage..."
77+
interrogate code_assistant_manager/ -c pyproject.toml
78+
79+
# Combined checks
80+
check: format-check lint type-check test
81+
@echo "All checks passed!"
82+
83+
# Pre-commit
84+
pre-commit-install:
85+
pre-commit install
86+
@echo "Pre-commit hooks installed successfully!"
87+
88+
pre-commit-run:
89+
pre-commit run --all-files
90+
91+
pre-commit-update:
92+
pre-commit autoupdate
93+
94+
# Building
95+
build: clean
96+
python3 setup.py bdist_wheel
97+
98+
# Release workflow
99+
release: clean check build
100+
@echo "Release build completed successfully!"
101+
@echo "Distribution files:"
102+
@ls -lh dist/
103+
104+
# Docker commands (future)
105+
docker-build:
106+
@echo "Docker build not yet implemented"
107+
108+
docker-run:
109+
@echo "Docker run not yet implemented"

0 commit comments

Comments
 (0)