Skip to content

Commit a7f018b

Browse files
authored
Merge branch 'main' into issue-103
2 parents a8fec36 + 5a1755c commit a7f018b

File tree

75 files changed

+9483
-1694
lines changed

Some content is hidden

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

75 files changed

+9483
-1694
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug Report
3+
about: Report something broken in Cortex
4+
title: "[BUG] "
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
## What happened?
10+
11+
Describe the bug clearly.
12+
13+
## How to reproduce
14+
15+
1. Command run: `cortex ...`
16+
2. What you expected
17+
3. What actually happened
18+
19+
## Environment
20+
21+
- OS: Ubuntu 24.04 / Debian 12 / etc.
22+
- Python: 3.11 / 3.12
23+
- LLM Provider: Claude / OpenAI / Ollama
24+
25+
## Error output
26+
27+
```
28+
Paste any error messages here
29+
```

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Questions / Discord
4+
url: https://discord.gg/uCqHvxjU83
5+
about: For general questions or discussion, join our Discord.
6+
- name: Bounty Issues
7+
url: https://github.com/cortexlinux/cortex/labels/bounty
8+
about: Looking to earn? Check open bounty issues.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature for Cortex
4+
title: "[FEATURE] "
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
## Problem
10+
11+
What problem does this solve? Why is it important?
12+
13+
## Proposed solution
14+
15+
Describe the feature. Example commands or behavior:
16+
17+
```bash
18+
cortex <your-idea-here>
19+
```
20+
21+
## Alternatives considered
22+
23+
Any workarounds you've tried.
24+
25+
## Bounty interest
26+
27+
Are you interested in implementing this for a bounty? (Yes/No)

.github/pull_request_template.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
## Summary
2-
<!-- Brief description of changes -->
1+
## Related Issue
2+
Closes #<!-- REQUIRED: Issue number -->
33

4-
## Type of Change
5-
- [ ] Bug fix
6-
- [ ] New feature
7-
- [ ] Documentation update
4+
## Summary
5+
<!-- What does this PR do? -->
86

97
## Checklist
10-
- [ ] Tests passing
11-
- [ ] Docs updated
12-
- [ ] Fixes #XXX
13-
14-
## Testing
15-
<!-- How was this tested? -->
8+
- [ ] Tests pass (`pytest tests/`)
9+
- [ ] PR title format: `[#XX] Description`
10+
- [ ] MVP label added if closing MVP issue

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.11"
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install -U pip
25+
pip install -e .
26+
pip install pytest black ruff
27+
28+
- name: Lint with ruff
29+
run: ruff check . --exit-zero
30+
31+
- name: Check formatting
32+
run: black --check . --exclude venv || true
33+
34+
- name: Run tests
35+
env:
36+
ANTHROPIC_API_KEY: "test-key-for-ci"
37+
run: |
38+
pytest tests/ -v --tb=short || echo "Some tests may require API keys"

.pre-commit-config.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 24.10.0
4+
hooks:
5+
- id: black
6+
language_version: python3
7+
8+
- repo: https://github.com/astral-sh/ruff-pre-commit
9+
rev: v0.8.0
10+
hooks:
11+
- id: ruff
12+
args: ["--fix"]
13+
14+
- repo: https://github.com/pycqa/isort
15+
rev: 5.13.2
16+
hooks:
17+
- id: isort
18+
args: ["--profile", "black"]
19+
20+
- repo: https://github.com/pre-commit/pre-commit-hooks
21+
rev: v5.0.0
22+
hooks:
23+
- id: trailing-whitespace
24+
- id: end-of-file-fixer
25+
- id: check-added-large-files
26+
args: ['--maxkb=1000']
27+
- id: check-yaml
28+
- id: check-json
29+
- id: check-merge-conflict

AGENTS.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Cortex Linux - AI Agent Guidelines
2+
3+
## Project Overview
4+
5+
Cortex Linux is an AI-native package manager for Debian/Ubuntu that understands natural language commands. It wraps `apt` with LLM intelligence to parse requests, detect hardware, resolve dependencies, and execute installations safely.
6+
7+
**Repository**: https://github.com/cortexlinux/cortex
8+
**License**: Apache 2.0
9+
**Primary Language**: Python 3.10+
10+
11+
## Quick Start
12+
13+
```bash
14+
# Clone and setup
15+
git clone https://github.com/cortexlinux/cortex.git
16+
cd cortex
17+
python3 -m venv venv
18+
source venv/bin/activate
19+
pip install -e .
20+
21+
# Configure API key
22+
echo 'ANTHROPIC_API_KEY=your-key-here' > .env
23+
24+
# Verify installation
25+
cortex install nginx --dry-run
26+
```
27+
28+
## Development Environment
29+
30+
### Prerequisites
31+
- Python 3.10 or higher
32+
- Ubuntu 22.04+ or Debian 12+
33+
- Virtual environment (required)
34+
- Anthropic API key or OpenAI API key
35+
36+
### Setup Commands
37+
```bash
38+
python3 -m venv venv
39+
source venv/bin/activate
40+
pip install -e .
41+
pip install -r requirements-dev.txt
42+
pytest tests/ -v
43+
```
44+
45+
## Testing Instructions
46+
47+
```bash
48+
# Run all tests
49+
pytest tests/ -v
50+
51+
# Test dry-run (safe)
52+
cortex install nginx --dry-run
53+
54+
# Test hardware detection
55+
cortex-detect-hardware
56+
```
57+
58+
## Code Standards
59+
60+
- Follow PEP 8
61+
- Type hints required
62+
- Docstrings for public APIs
63+
- >80% test coverage for PRs
64+
65+
## Safety Requirements
66+
67+
1. Dry-run by default for all installations
68+
2. No silent sudo
69+
3. Firejail sandboxing required
70+
4. Audit logging to ~/.cortex/history.db
71+
72+
## PR Guidelines
73+
74+
- Title format: [component] Description
75+
- All tests must pass
76+
- Documentation required for new features
77+
78+
## Contact
79+
80+
- Discord: https://discord.gg/uCqHvxjU83
81+
- Email: mike@cortexlinux.com

Makefile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Cortex Linux - Developer Makefile
2+
# Usage: make [target]
3+
4+
.PHONY: dev test lint format check clean help
5+
6+
PYTHON ?= python3
7+
8+
help:
9+
@echo "Cortex Linux - Development Commands"
10+
@echo ""
11+
@echo " make dev Install development dependencies"
12+
@echo " make test Run test suite"
13+
@echo " make lint Run linters (ruff, black check)"
14+
@echo " make format Auto-format code"
15+
@echo " make check Run all checks (format + lint + test)"
16+
@echo " make clean Remove build artifacts"
17+
@echo ""
18+
19+
dev:
20+
$(PYTHON) -m pip install -U pip
21+
$(PYTHON) -m pip install -e .
22+
$(PYTHON) -m pip install -r requirements-dev.txt
23+
@echo "✅ Dev environment ready"
24+
25+
test:
26+
$(PYTHON) -m pytest tests/ -v
27+
@echo "✅ Tests passed"
28+
29+
lint:
30+
$(PYTHON) -m ruff check .
31+
$(PYTHON) -m black --check .
32+
@echo "✅ Linting passed"
33+
34+
format:
35+
$(PYTHON) -m black .
36+
$(PYTHON) -m ruff check --fix .
37+
@echo "✅ Code formatted"
38+
39+
check: format lint test
40+
@echo "✅ All checks passed"
41+
42+
clean:
43+
rm -rf build/ dist/ *.egg-info/
44+
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
45+
find . -type f -name "*.pyc" -delete
46+
@echo "✅ Cleaned"

0 commit comments

Comments
 (0)