Skip to content

Commit d06824c

Browse files
fix/clean cli commands (#51)
* fix/clean cli commands * update changelog * remove blackbox
1 parent c2749b4 commit d06824c

19 files changed

Lines changed: 453 additions & 365 deletions

File tree

.pipelex/inference/backends.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ endpoint = "https://inference.pipelex.com/v1"
33
api_key = "${PIPELEX_INFERENCE_API_KEY}"
44

55
[blackboxai]
6-
enabled = true
6+
enabled = false
77
endpoint = "https://api.blackbox.ai/v1"
88
api_key = "${BLACKBOX_API_KEY}"
99

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [v0.2.3] - 2025-09-22
4+
5+
### Changed
6+
7+
- Cleaned cli commands.
8+
39
## [v0.2.2] - 2025-09-18
410

511
### Highlights

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ Some complex pipelines require GCP credentials (See [GCP credentials](https://do
4040
### Automatic Documentation & Release Features
4141
```bash
4242
# Update documentation based on code changes
43-
cocode swe doc-update v1.0.0 path/to/your/local/repository
43+
cocode doc update v1.0.0 path/to/your/local/repository
4444

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

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

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

5454
# GitHub operations
5555
cocode github auth # Check GitHub authentication status
@@ -151,10 +151,10 @@ cocode repox convert --python-rule imports --output-style import_list
151151
#### AI-Powered Analysis
152152
```bash
153153
# Extract project fundamentals
154-
cocode swe from-repo extract_fundamentals . --output-filename overview.json
154+
cocode repo extract_fundamentals . --output-filename overview.json
155155

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

160160
## 🔧 Configuration

cocode/cli/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""CLI modules for cocode."""

cocode/cli/__main__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"""
2+
Entry point for running cocode CLI as a module.
3+
"""
4+
5+
from cocode.cli.main import app
6+
7+
if __name__ == "__main__":
8+
app()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""AI instructions management module."""
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
"""
2+
AI instructions management CLI commands.
3+
"""
4+
5+
import asyncio
6+
from typing import Annotated, List, Optional
7+
8+
import typer
9+
from pipelex.hub import get_pipeline_tracker
10+
11+
from cocode.common import validate_repo_path
12+
from cocode.swe.swe_cmd import swe_ai_instruction_update_from_diff
13+
14+
ai_instructions_app = typer.Typer(
15+
name="ai_instructions",
16+
help="AI instructions management and update commands",
17+
add_completion=False,
18+
rich_markup_mode="rich",
19+
no_args_is_help=True,
20+
)
21+
22+
23+
@ai_instructions_app.command("update")
24+
def ai_instructions_update_cmd(
25+
version: Annotated[
26+
str,
27+
typer.Argument(help="Git version/tag/commit to compare current version against"),
28+
],
29+
repo_path: Annotated[
30+
str,
31+
typer.Argument(help="Repository path (local directory) or GitHub URL/identifier (owner/repo or https://github.com/owner/repo)"),
32+
] = ".",
33+
output_dir: Annotated[
34+
str,
35+
typer.Option("--output-dir", "-o", help="Output directory path"),
36+
] = "results",
37+
output_filename: Annotated[
38+
str,
39+
typer.Option("--output-filename", "-n", help="Output filename"),
40+
] = "ai-instruction-update-suggestions.txt",
41+
ignore_patterns: Annotated[
42+
Optional[List[str]],
43+
typer.Option(
44+
"--ignore-pattern", "-i", help="Patterns to exclude from git diff (e.g., '*.log', 'temp/', 'build/'). Can be specified multiple times."
45+
),
46+
] = None,
47+
) -> None:
48+
"""
49+
Generate AI instruction update suggestions for AGENTS.md, CLAUDE.md, and cursor rules based on git diff analysis.
50+
Supports both local repositories and GitHub repositories.
51+
"""
52+
repo_path = validate_repo_path(repo_path)
53+
54+
asyncio.run(
55+
swe_ai_instruction_update_from_diff(
56+
repo_path=repo_path,
57+
version=version,
58+
output_filename=output_filename,
59+
output_dir=output_dir,
60+
ignore_patterns=ignore_patterns,
61+
)
62+
)
63+
64+
get_pipeline_tracker().output_flowchart()

cocode/cli/changelog/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Changelog management module."""
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
"""
2+
Changelog management CLI commands.
3+
"""
4+
5+
import asyncio
6+
from typing import Annotated, List, Optional
7+
8+
import typer
9+
from pipelex.core.pipes.pipe_run_params import PipeRunMode
10+
from pipelex.hub import get_pipeline_tracker
11+
12+
from cocode.common import get_output_dir, validate_repo_path
13+
from cocode.swe.swe_cmd import swe_from_repo_diff
14+
15+
changelog_app = typer.Typer(
16+
name="changelog",
17+
help="Changelog management and generation commands",
18+
add_completion=False,
19+
rich_markup_mode="rich",
20+
no_args_is_help=True,
21+
)
22+
23+
24+
@changelog_app.command("update")
25+
def changelog_update_cmd(
26+
version: Annotated[
27+
str,
28+
typer.Argument(help="Git version/tag/commit to compare current version against"),
29+
],
30+
repo_path: Annotated[
31+
str,
32+
typer.Argument(help="Repository path (local directory) or GitHub URL/identifier (owner/repo or https://github.com/owner/repo)"),
33+
] = ".",
34+
output_dir: Annotated[
35+
Optional[str],
36+
typer.Option("--output-dir", "-o", help="Output directory path. Use 'stdout' to print to console. Defaults to config value if not provided"),
37+
] = None,
38+
output_filename: Annotated[
39+
str,
40+
typer.Option("--output-filename", "-n", help="Output filename"),
41+
] = "changelog-update.md",
42+
dry_run: Annotated[
43+
bool,
44+
typer.Option("--dry", help="Run pipeline in dry mode (no actual execution)"),
45+
] = False,
46+
ignore_patterns: Annotated[
47+
Optional[List[str]],
48+
typer.Option(
49+
"--ignore-pattern", "-i", help="Patterns to exclude from git diff (e.g., '*.log', 'temp/', 'build/'). Can be specified multiple times."
50+
),
51+
] = None,
52+
) -> None:
53+
"""Generate changelog from git diff comparing current version to specified version. Supports both local repositories and GitHub repositories."""
54+
repo_path = validate_repo_path(repo_path)
55+
output_dir = get_output_dir(output_dir)
56+
to_stdout = output_dir == "stdout"
57+
pipe_run_mode = PipeRunMode.DRY if dry_run else PipeRunMode.LIVE
58+
59+
asyncio.run(
60+
swe_from_repo_diff(
61+
pipe_code="write_changelog",
62+
repo_path=repo_path,
63+
version=version,
64+
output_filename=output_filename,
65+
output_dir=output_dir,
66+
to_stdout=to_stdout,
67+
pipe_run_mode=pipe_run_mode,
68+
ignore_patterns=ignore_patterns,
69+
)
70+
)
71+
get_pipeline_tracker().output_flowchart()

cocode/cli/doc/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Documentation management module."""

0 commit comments

Comments
 (0)