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
2 changes: 1 addition & 1 deletion .pipelex/inference/backends.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ endpoint = "https://inference.pipelex.com/v1"
api_key = "${PIPELEX_INFERENCE_API_KEY}"

[blackboxai]
enabled = true
enabled = false
endpoint = "https://api.blackbox.ai/v1"
api_key = "${BLACKBOX_API_KEY}"

Expand Down
5 changes: 0 additions & 5 deletions .pipelex/inference/deck/cocode_deck.toml

This file was deleted.

5 changes: 3 additions & 2 deletions .pipelex/inference/deck/overrides.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


####################################################################################################
# LLM Deck overrides
####################################################################################################
Expand All @@ -8,3 +6,6 @@
for_text = "disabled"
for_object = "disabled"

[llm_presets]
llm_for_large_text = { llm_handle = "gemini-2.5-pro", temperature = 0.1 }
llm_for_swe = { llm_handle = "claude-4-sonnet", temperature = 0.1 }
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [v0.2.3] - 2025-09-22

### Changed

- Cleaned cli commands.

## [v0.2.2] - 2025-09-18

### Highlights
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ env: check-uv
install: env
$(call PRINT_TITLE,"Installing dependencies")
@. $(VIRTUAL_ENV)/bin/activate && \
uv sync --all-extras && \
uv sync --all-extras --no-cache && \
echo "Installed dependencies in ${VIRTUAL_ENV}";
install-latest: env
$(call PRINT_TITLE,"Installing dependencies with latest versions")
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ Some complex pipelines require GCP credentials (See [GCP credentials](https://do
### Automatic Documentation & Release Features
```bash
# Update documentation based on code changes
cocode swe doc-update v1.0.0 path/to/your/local/repository
cocode doc update v1.0.0 path/to/your/local/repository

# Proofread documentation against codebase
cocode swe doc-proofread --doc-dir docs path/to/your/local/repository # Requires GCP credentials for Gemini
cocode doc proofread --doc-dir docs path/to/your/local/repository # Requires GCP credentials for Gemini

# Generate changelog from version diff
cocode swe from-repo-diff write_changelog v1.0.0 path/to/your/local/repository # Requires Anthropic API key for claude
cocode changelog update v1.0.0 path/to/your/local/repository # Requires Anthropic API key for claude

# Update AI instructions (AGENTS.md, CLAUDE.md, cursor rules) based on code changes
cocode swe ai-instruction-update v1.0.0 path/to/your/local/repository
cocode ai_instructions update v1.0.0 path/to/your/local/repository

# GitHub operations
cocode github auth # Check GitHub authentication status
Expand Down Expand Up @@ -151,10 +151,10 @@ cocode repox convert --python-rule imports --output-style import_list
#### AI-Powered Analysis
```bash
# Extract project fundamentals
cocode swe from-repo extract_fundamentals . --output-filename overview.json
cocode repo extract_fundamentals . --output-filename overview.json

# Generate feature documentation
cocode swe from-file extract_features_recap ./analysis.txt --output-filename features.md
cocode features extract ./analysis.txt --output-filename features.md
```

## 🔧 Configuration
Expand Down
1 change: 1 addition & 0 deletions cocode/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""CLI modules for cocode."""
8 changes: 8 additions & 0 deletions cocode/cli/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""
Entry point for running cocode CLI as a module.
"""

from cocode.cli.main import app

if __name__ == "__main__":
app()
1 change: 1 addition & 0 deletions cocode/cli/ai_instructions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""AI instructions management module."""
64 changes: 64 additions & 0 deletions cocode/cli/ai_instructions/ai_instructions_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
"""
AI instructions management CLI commands.
"""

import asyncio
from typing import Annotated, List, Optional

import typer
from pipelex.hub import get_pipeline_tracker

from cocode.common import validate_repo_path
from cocode.swe.swe_cmd import swe_ai_instruction_update_from_diff

ai_instructions_app = typer.Typer(
name="ai_instructions",
help="AI instructions management and update commands",
add_completion=False,
rich_markup_mode="rich",
no_args_is_help=True,
)


@ai_instructions_app.command("update")
def ai_instructions_update_cmd(
version: Annotated[
str,
typer.Argument(help="Git version/tag/commit to compare current version against"),
],
repo_path: Annotated[
str,
typer.Argument(help="Repository path (local directory) or GitHub URL/identifier (owner/repo or https://github.com/owner/repo)"),
] = ".",
output_dir: Annotated[
str,
typer.Option("--output-dir", "-o", help="Output directory path"),
] = "results",
output_filename: Annotated[
str,
typer.Option("--output-filename", "-n", help="Output filename"),
] = "ai-instruction-update-suggestions.txt",
ignore_patterns: Annotated[
Optional[List[str]],
typer.Option(
"--ignore-pattern", "-i", help="Patterns to exclude from git diff (e.g., '*.log', 'temp/', 'build/'). Can be specified multiple times."
),
] = None,
) -> None:
"""
Generate AI instruction update suggestions for AGENTS.md, CLAUDE.md, and cursor rules based on git diff analysis.
Supports both local repositories and GitHub repositories.
"""
repo_path = validate_repo_path(repo_path)

asyncio.run(
swe_ai_instruction_update_from_diff(
repo_path=repo_path,
version=version,
output_filename=output_filename,
output_dir=output_dir,
ignore_patterns=ignore_patterns,
)
)

get_pipeline_tracker().output_flowchart()
1 change: 1 addition & 0 deletions cocode/cli/changelog/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Changelog management module."""
71 changes: 71 additions & 0 deletions cocode/cli/changelog/changelog_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
"""
Changelog management CLI commands.
"""

import asyncio
from typing import Annotated, List, Optional

import typer
from pipelex.core.pipes.pipe_run_params import PipeRunMode
from pipelex.hub import get_pipeline_tracker

from cocode.common import get_output_dir, validate_repo_path
from cocode.swe.swe_cmd import swe_from_repo_diff

changelog_app = typer.Typer(
name="changelog",
help="Changelog management and generation commands",
add_completion=False,
rich_markup_mode="rich",
no_args_is_help=True,
)


@changelog_app.command("update")
def changelog_update_cmd(
version: Annotated[
str,
typer.Argument(help="Git version/tag/commit to compare current version against"),
],
repo_path: Annotated[
str,
typer.Argument(help="Repository path (local directory) or GitHub URL/identifier (owner/repo or https://github.com/owner/repo)"),
] = ".",
output_dir: Annotated[
Optional[str],
typer.Option("--output-dir", "-o", help="Output directory path. Use 'stdout' to print to console. Defaults to config value if not provided"),
] = None,
output_filename: Annotated[
str,
typer.Option("--output-filename", "-n", help="Output filename"),
] = "changelog-update.md",
dry_run: Annotated[
bool,
typer.Option("--dry", help="Run pipeline in dry mode (no actual execution)"),
] = False,
ignore_patterns: Annotated[
Optional[List[str]],
typer.Option(
"--ignore-pattern", "-i", help="Patterns to exclude from git diff (e.g., '*.log', 'temp/', 'build/'). Can be specified multiple times."
),
] = None,
) -> None:
"""Generate changelog from git diff comparing current version to specified version. Supports both local repositories and GitHub repositories."""
repo_path = validate_repo_path(repo_path)
output_dir = get_output_dir(output_dir)
to_stdout = output_dir == "stdout"
pipe_run_mode = PipeRunMode.DRY if dry_run else PipeRunMode.LIVE

asyncio.run(
swe_from_repo_diff(
pipe_code="write_changelog",
repo_path=repo_path,
version=version,
output_filename=output_filename,
output_dir=output_dir,
to_stdout=to_stdout,
pipe_run_mode=pipe_run_mode,
ignore_patterns=ignore_patterns,
)
)
get_pipeline_tracker().output_flowchart()
1 change: 1 addition & 0 deletions cocode/cli/doc/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Documentation management module."""
134 changes: 134 additions & 0 deletions cocode/cli/doc/doc_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
"""
Documentation management CLI commands.
"""

import asyncio
from typing import Annotated, List, Optional

import typer
from pipelex.hub import get_pipeline_tracker

from cocode.common import validate_repo_path
from cocode.swe.swe_cmd import swe_doc_proofread, swe_doc_update_from_diff

doc_app = typer.Typer(
name="doc",
help="Documentation management and automation commands",
add_completion=False,
rich_markup_mode="rich",
no_args_is_help=True,
)


@doc_app.command("update")
def doc_update_cmd(
version: Annotated[
str,
typer.Argument(help="Git version/tag/commit to compare current version against"),
],
repo_path: Annotated[
str,
typer.Argument(help="Repository path (local directory) or GitHub URL/identifier (owner/repo or https://github.com/owner/repo)"),
] = ".",
output_dir: Annotated[
str,
typer.Option("--output-dir", "-o", help="Output directory path"),
] = "results",
output_filename: Annotated[
str,
typer.Option("--output-filename", "-n", help="Output filename"),
] = "doc-update-suggestions.txt",
ignore_patterns: Annotated[
Optional[List[str]],
typer.Option(
"--ignore-pattern", "-i", help="Patterns to exclude from git diff (e.g., '*.log', 'temp/', 'build/'). Can be specified multiple times."
),
] = None,
doc_dir: Annotated[
Optional[str],
typer.Option("--doc-dir", "-d", help="Directory containing documentation files (e.g., 'docs', 'documentation')"),
] = None,
) -> None:
"""
Generate documentation update suggestions for docs/ directory based on git diff analysis.
Supports both local repositories and GitHub repositories.
"""
repo_path = validate_repo_path(repo_path)

asyncio.run(
swe_doc_update_from_diff(
repo_path=repo_path,
version=version,
output_filename=output_filename,
output_dir=output_dir,
ignore_patterns=ignore_patterns,
)
)

get_pipeline_tracker().output_flowchart()


@doc_app.command("proofread")
def doc_proofread_cmd(
repo_path: Annotated[
str,
typer.Argument(help="Repository path (local directory) or GitHub URL/identifier (owner/repo or https://github.com/owner/repo)"),
] = ".",
output_dir: Annotated[
str,
typer.Option("--output-dir", "-o", help="Output directory path"),
] = "results",
output_filename: Annotated[
str,
typer.Option("--output-filename", "-n", help="Output filename"),
] = "doc-proofread-report",
doc_dir: Annotated[
str,
typer.Option("--doc-dir", "-d", help="Directory containing documentation files"),
] = "docs",
include_patterns: Annotated[
Optional[List[str]],
typer.Option("--include-pattern", "-r", help="Patterns to include in codebase analysis (glob pattern) - can be repeated"),
] = None,
ignore_patterns: Annotated[
Optional[List[str]],
typer.Option("--ignore-pattern", "-i", help="Patterns to ignore in codebase analysis (gitignore format) - can be repeated"),
] = None,
) -> None:
"""
Systematically proofread documentation against actual codebase to find inconsistencies.
Supports both local repositories and GitHub repositories.
"""
repo_path = validate_repo_path(repo_path)

# Set default include patterns to focus on documentation and code
if include_patterns is None:
include_patterns = ["*.md", "*.py", "*.toml", "*.yaml", "*.yml", "*.json", "*.sh", "*.js", "*.ts"]

# Set default ignore patterns to exclude noise
if ignore_patterns is None:
ignore_patterns = [
"__pycache__/",
"*.pyc",
".git/",
".venv/",
"node_modules/",
"*.log",
"build/",
"dist/",
".pytest_cache/",
"*.egg-info/",
]

asyncio.run(
swe_doc_proofread(
repo_path=repo_path,
doc_dir=doc_dir,
output_filename=output_filename,
output_dir=output_dir,
include_patterns=include_patterns,
ignore_patterns=ignore_patterns,
)
)

get_pipeline_tracker().output_flowchart()
1 change: 1 addition & 0 deletions cocode/cli/features/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Feature analysis module."""
Loading