Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b90577c
d
Zeeeepa Sep 3, 2025
9f2f5fe
up
Zeeeepa Sep 3, 2025
08a032a
Merge branch 'codegen-sh:develop' into develop
Zeeeepa Sep 5, 2025
bac9125
Integrate graph-sitter SDK with codemods and gsbuild
codegen-sh[bot] Sep 5, 2025
a55b700
feat: Complete graph-sitter SDK integration with dual-package deployment
codegen-sh[bot] Sep 5, 2025
28ffcfe
fix: Resolve type checker warnings for SDK imports
codegen-sh[bot] Sep 5, 2025
e588da7
fix: Apply ruff linting fixes to core module
codegen-sh[bot] Sep 5, 2025
9ebaf29
Merge pull request #149 from Zeeeepa/codegen-bot/complete-graph-sitte…
Zeeeepa Sep 5, 2025
fbb5ca4
Update build.py
Zeeeepa Sep 7, 2025
e5c37be
Add files via upload
Zeeeepa Sep 7, 2025
8252b20
Add files via upload
Zeeeepa Sep 7, 2025
19cc655
Delete test.py
Zeeeepa Sep 7, 2025
cbb0981
Add files via upload
Zeeeepa Sep 7, 2025
7599338
Update README.md
Zeeeepa Sep 7, 2025
673af96
Update README.md
Zeeeepa Sep 7, 2025
6d1e21b
Update README.md
Zeeeepa Sep 7, 2025
b28cf25
Add files via upload
Zeeeepa Sep 10, 2025
1cba256
Add files via upload
Zeeeepa Sep 10, 2025
1ad43db
Add files via upload
Zeeeepa Sep 10, 2025
ca399e7
Add files via upload
Zeeeepa Sep 10, 2025
0269fde
Add files via upload
Zeeeepa Sep 11, 2025
cdc9dfb
Add files via upload
Zeeeepa Sep 11, 2025
704f981
a
Zeeeepa Sep 11, 2025
b81bd7d
aa
Zeeeepa Sep 11, 2025
1b64892
Merge branch 'codegen-sh:develop' into develop
Zeeeepa Sep 12, 2025
907203e
Merge branch 'codegen-sh:develop' into develop
Zeeeepa Sep 16, 2025
fb36dfb
Merge branch 'codegen-sh:develop' into develop
Zeeeepa Sep 16, 2025
509f0f6
feat: consolidate project structure and resolve import conflicts
codegen-sh[bot] Sep 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 11 additions & 1 deletion src/codegen/__init__.py → codegen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
from codegen.agents import Agent
# Optional Agent import to avoid dependency issues during development
try:
from codegen.agents import Agent
except ImportError:
# Fallback Agent class if dependencies are missing
class Agent:
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
def __repr__(self):
return "Agent(placeholder - dependencies missing)"

# Import version information from the auto-generated _version.py
try:
Expand Down
25 changes: 25 additions & 0 deletions codegen/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# C:\Programs\codegen\src\codegen\__main__.py
import sys
import os

# Add the src directory to the path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))

# Import compatibility module first
from codegen.compat import *

# Import only what we need for version
try:
from codegen.cli.cli import main
except ImportError:

def main():
# Fallback version function
import importlib.metadata

version = importlib.metadata.version("codegen")
print(version)


if __name__ == "__main__":
main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
73 changes: 65 additions & 8 deletions src/codegen/cli/cli.py → codegen/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,28 @@

import typer
from rich.traceback import install
import sys

# Import compatibility module first
from codegen.compat import *

# Only import TUI if not on Windows
if sys.platform != "win32":
from codegen.cli.commands.tui.main import tui
else:

def tui():
"""Placeholder TUI for Windows."""
print(
"TUI is not available on Windows. Use 'codegen --help' for available commands."
)

# Import tui_command for Windows
from codegen.cli.commands.tui.main import tui_command as tui


# Import compatibility module first
from codegen.compat import *
from codegen import __version__
from codegen.cli.commands.agent.main import agent
from codegen.cli.commands.agents.main import agents_app
Expand Down Expand Up @@ -51,23 +72,36 @@
def version_callback(value: bool):
"""Print version and exit."""
if value:
logger.info("Version command invoked", extra={"operation": "cli.version", "version": __version__})
logger.info(
"Version command invoked",
extra={"operation": "cli.version", "version": __version__},
)
print(__version__)
raise typer.Exit()


# Create the main Typer app
main = typer.Typer(name="codegen", help="Codegen - the Operating System for Code Agents.", rich_markup_mode="rich")
main = typer.Typer(
name="codegen",
help="Codegen - the Operating System for Code Agents.",
rich_markup_mode="rich",
)

# Add individual commands to the main app (logging now handled within each command)
main.command("agent", help="Create a new agent run with a prompt.")(agent)
main.command("claude", help="Run Claude Code with OpenTelemetry monitoring and logging.")(claude)
main.command(
"claude", help="Run Claude Code with OpenTelemetry monitoring and logging."
)(claude)
main.command("init", help="Initialize or update the Codegen folder.")(init)
main.command("login", help="Store authentication token.")(login)
main.command("logout", help="Clear stored authentication token.")(logout)
main.command("org", help="Manage and switch between organizations.")(org)
main.command("repo", help="Manage repository configuration and environment variables.")(repo)
main.command("style-debug", help="Debug command to visualize CLI styling (spinners, etc).")(style_debug)
main.command("repo", help="Manage repository configuration and environment variables.")(
repo
)
main.command(
"style-debug", help="Debug command to visualize CLI styling (spinners, etc)."
)(style_debug)
main.command("tools", help="List available tools from the Codegen API.")(tools)
main.command("tui", help="Launch the interactive TUI interface.")(tui)
main.command("update", help="Update Codegen to the latest or specified version")(update)
Expand All @@ -80,17 +114,40 @@ def version_callback(value: bool):


@main.callback(invoke_without_command=True)
def main_callback(ctx: typer.Context, version: bool = typer.Option(False, "--version", callback=version_callback, is_eager=True, help="Show version and exit")):
def main_callback(
ctx: typer.Context,
version: bool = typer.Option(
False,
"--version",
callback=version_callback,
is_eager=True,
help="Show version and exit",
),
):
"""Codegen - the Operating System for Code Agents"""
if ctx.invoked_subcommand is None:
# No subcommand provided, launch TUI
logger.info("CLI launched without subcommand - starting TUI", extra={"operation": "cli.main", "action": "default_tui_launch", "command": "codegen"})
logger.info(
"CLI launched without subcommand - starting TUI",
extra={
"operation": "cli.main",
"action": "default_tui_launch",
"command": "codegen",
},
)
from codegen.cli.tui.app import run_tui

run_tui()
else:
# Log when a subcommand is being invoked
logger.debug("CLI main callback with subcommand", extra={"operation": "cli.main", "subcommand": ctx.invoked_subcommand, "command": f"codegen {ctx.invoked_subcommand}"})
logger.debug(
"CLI main callback with subcommand",
extra={
"operation": "cli.main",
"subcommand": ctx.invoked_subcommand,
"command": f"codegen {ctx.invoked_subcommand}",
},
)


if __name__ == "__main__":
Expand Down
File renamed without changes.
33 changes: 33 additions & 0 deletions codegen/cli/commands/tui/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# C:\Programs\codegen\src\codegen\cli\commands\tui\main.py
import sys
import os

# Add the src directory to the path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", ".."))

# Import compatibility module first
from codegen.compat import *

# Try to import the original TUI, fallback to Windows version
try:
from codegen.cli.tui.app import run_tui
except (ImportError, ModuleNotFoundError):
# Try to import the Windows TUI
try:
from codegen.cli.tui.windows_app import run_tui
except (ImportError, ModuleNotFoundError):
# If both fail, create a simple fallback
def run_tui():
print(
"TUI is not available on this platform. Use 'codegen --help' for available commands."
)


def tui():
"""Run the TUI interface."""
run_tui()


def tui_command():
"""Run the TUI interface."""
run_tui()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading