Skip to content
Closed
11 changes: 11 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"permissions": {
"allow": [
"Bash(source:*)",
"Bash(ty)",
"Bash(ty check:*)"
],
"deny": [],
"ask": []
}
}
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,12 @@ repos:
- mdformat-ruff
- mdformat-config
- mdformat-pyproject

- repo: local
hooks:
- id: ty-typechecker
name: ty typechecker
entry: bash -c 'source .venv/bin/activate && ty check'
language: system
pass_filenames: false
always_run: true
261 changes: 134 additions & 127 deletions docs/docs.json
Original file line number Diff line number Diff line change
@@ -1,129 +1,136 @@
{
"$schema": "https://mintlify.com/docs.json",
"theme": "maple",
"name": "Codegen Documentation",
"colors": {
"primary": "#a277ff",
"light": "#a277ff",
"dark": "#a277ff"
},
"favicon": "/favicon.svg",
"navigation": {
"tabs": [
{
"tab": "Documentation",
"groups": [
{
"group": "Overview",
"pages": [
"introduction/overview",
"introduction/api",
"introduction/prompting",
"introduction/community",
"introduction/about",
"introduction/faq"
]
},
{
"group": "Capabilities",
"pages": ["capabilities/capabilities", "capabilities/wake-up", "capabilities/interrupts"]
},
{
"group": "Integrations",
"pages": [
"integrations/github",
"integrations/slack",
"integrations/linear",
"integrations/jira",
"integrations/notion",
"integrations/figma",
"integrations/circleci",
"integrations/web-search",
"integrations/postgres",
"integrations/mcp"
]
},
{
"group": "Sandboxes",
"pages": [
"sandboxes/overview",
"sandboxes/setup-commands",
"sandboxes/image-snapshots",
"sandboxes/environment-variables",
"sandboxes/secrets",
"sandboxes/editor",
"sandboxes/web-preview"
]
},
{
"group": "Settings",
"pages": ["settings/repo-rules", "settings/model-configuration"]
}
]
},
{
"tab": "API Reference",
"groups": [
{
"group": "Endpoints",
"openapi": {
"source": "/api-reference/openapi3.json",
"directory": "api-reference"
}
},
{
"group": "Guides",
"pages": ["api-reference/agent-run-logs", "api-reference/github-actions"]
}
]
}
]
},
"logo": {
"light": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45bf55446746125835_Codegen_Logomark_Light.svg",
"dark": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45a3e32761c42b324b_Codegen_Logomark_Dark.svg"
},
"appearance": {
"default": "dark"
},
"background": {
"decoration": "gradient"
},
"navbar": {
"primary": {
"type": "button",
"label": "GitHub",
"href": "https://github.com/codegen-sh/codegen-sdk"
}
},
"seo": {
"metatags": {
"og:site_name": "Codegen Documentation",
"og:title": "Codegen Documentation - 10x Your Engineering",
"og:description": "Complete documentation for Codegen, the AI-powered software engineering agent. Learn how to integrate with GitHub, Slack, Linear, and more.",
"og:url": "https://docs.codegen.com",
"og:locale": "en_US",
"og:logo": "https://i.imgur.com/f4OVOqI.png",
"article:publisher": "Codegen, Inc.",
"twitter:site": "@codegen"
},
"indexing": "navigable"
},
"footer": {
"socials": {
"x": "https://x.com/codegen",
"linkedin": "https://linkedin.com/company/codegen-dot-com"
}
},
"integrations": {
"posthog": {
"apiKey": "phc_GLxaINoQJnuyCyxDmTciQqzdKBYFVDkY7bRBO4bDdso"
}
},
"head": [
{
"tag": "script",
"content": "(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-T7G5S78D');"
}
]
"$schema": "https://mintlify.com/docs.json",
"theme": "maple",
"name": "Codegen Documentation",
"colors": {
"primary": "#a277ff",
"light": "#a277ff",
"dark": "#a277ff"
},
"favicon": "/favicon.svg",
"navigation": {
"tabs": [
{
"tab": "Documentation",
"groups": [
{
"group": "Overview",
"pages": [
"introduction/overview",
"introduction/api",
"introduction/prompting",
"introduction/community",
"introduction/about",
"introduction/faq"
]
},
{
"group": "Capabilities",
"pages": [
"capabilities/capabilities",
"capabilities/wake-up",
"capabilities/interrupts"
]
},
{
"group": "Integrations",
"pages": [
"integrations/github",
"integrations/slack",
"integrations/linear",
"integrations/jira",
"integrations/notion",
"integrations/figma",
"integrations/circleci",
"integrations/web-search",
"integrations/postgres",
"integrations/mcp"
]
},
{
"group": "Sandboxes",
"pages": [
"sandboxes/overview",
"sandboxes/setup-commands",
"sandboxes/image-snapshots",
"sandboxes/environment-variables",
"sandboxes/secrets",
"sandboxes/editor",
"sandboxes/web-preview"
]
},
{
"group": "Settings",
"pages": ["settings/repo-rules", "settings/model-configuration"]
}
]
},
{
"tab": "API Reference",
"groups": [
{
"group": "Endpoints",
"openapi": {
"source": "/api-reference/openapi3.json",
"directory": "api-reference"
}
},
{
"group": "Guides",
"pages": [
"api-reference/agent-run-logs",
"api-reference/github-actions"
]
}
]
}
]
},
"logo": {
"light": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45bf55446746125835_Codegen_Logomark_Light.svg",
"dark": "https://cdn.prod.website-files.com/67070304751b9b01bf6a161c/679bcf45a3e32761c42b324b_Codegen_Logomark_Dark.svg"
},
"appearance": {
"default": "dark"
},
"background": {
"decoration": "gradient"
},
"navbar": {
"primary": {
"type": "button",
"label": "GitHub",
"href": "https://github.com/codegen-sh/codegen-sdk"
}
},
"seo": {
"metatags": {
"og:site_name": "Codegen Documentation",
"og:title": "Codegen Documentation - 10x Your Engineering",
"og:description": "Complete documentation for Codegen, the AI-powered software engineering agent. Learn how to integrate with GitHub, Slack, Linear, and more.",
"og:url": "https://docs.codegen.com",
"og:locale": "en_US",
"og:logo": "https://i.imgur.com/f4OVOqI.png",
"article:publisher": "Codegen, Inc.",
"twitter:site": "@codegen"
},
"indexing": "navigable"
},
"footer": {
"socials": {
"x": "https://x.com/codegen",
"linkedin": "https://linkedin.com/company/codegen-dot-com"
}
},
"integrations": {
"posthog": {
"apiKey": "phc_GLxaINoQJnuyCyxDmTciQqzdKBYFVDkY7bRBO4bDdso"
}
},
"head": [
{
"tag": "script",
"content": "(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-T7G5S78D');"
}
]
}
6 changes: 0 additions & 6 deletions src/codegen/cli/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,3 @@ def _make_request(
except requests.RequestException as e:
msg = f"Network error: {e!s}"
raise ServerError(msg)

def identify(self) -> Identity:
"""Get user identity information."""
# TODO: Implement actual API call to identity endpoint
# For now, return a mock identity with active status
return Identity(auth_context=AuthContext(status="active"))
3 changes: 3 additions & 0 deletions src/codegen/cli/api/endpoints.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from codegen.cli.api.modal import MODAL_PREFIX

# DEPRECATED
RUN_ENDPOINT = f"https://{MODAL_PREFIX}--cli-run.modal.run"
DOCS_ENDPOINT = f"https://{MODAL_PREFIX}--cli-docs.modal.run"
EXPERT_ENDPOINT = f"https://{MODAL_PREFIX}--cli-ask-expert.modal.run"
Expand All @@ -11,3 +12,5 @@
PR_LOOKUP_ENDPOINT = f"https://{MODAL_PREFIX}--cli-pr-lookup.modal.run"
CODEGEN_SYSTEM_PROMPT_URL = "https://gist.githubusercontent.com/jayhack/15681a2ceaccd726f19e6fdb3a44738b/raw/17c08054e3931b3b7fdf424458269c9e607541e8/codegen-system-prompt.txt"
IMPROVE_ENDPOINT = f"https://{MODAL_PREFIX}--cli-improve.modal.run"
# API
API_ENDPOINT = f"https://{MODAL_PREFIX}--rest-api.modal.run/"
2 changes: 1 addition & 1 deletion src/codegen/cli/api/modal.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def get_modal_workspace():
case Environment.STAGING:
return "codegen-sh-staging"
case Environment.DEVELOP:
return "codegen-sh-develop"
return "codegen-sh-develop-jay"
case _:
msg = f"Invalid environment: {global_env.ENV}"
raise ValueError(msg)
Expand Down
11 changes: 1 addition & 10 deletions src/codegen/cli/auth/token_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
import os
from pathlib import Path

from codegen.cli.api.client import RestAPI
from codegen.cli.auth.constants import AUTH_FILE, CONFIG_DIR
from codegen.cli.errors import AuthError


class TokenManager:
Expand All @@ -22,14 +20,7 @@ def _ensure_config_dir(self):
Path(self.config_dir).mkdir(parents=True, exist_ok=True)

def authenticate_token(self, token: str) -> None:
"""Authenticate the token with the api."""
identity = RestAPI(token).identify()
if not identity:
msg = "No identity found for session"
raise AuthError(msg)
if identity.auth_context.status != "active":
msg = "Current session is not active. API Token may be invalid or may have expired."
raise AuthError(msg)
"""Store the token locally."""
self.save_token(token)

def save_token(self, token: str) -> None:
Expand Down
1 change: 1 addition & 0 deletions src/codegen/cli/claude/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Claude Code proxy server and utilities."""
12 changes: 9 additions & 3 deletions src/codegen/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@

from codegen import __version__

# Import the actual command functions
from codegen.cli.commands.claude.main import claude

# Import config command (still a Typer app)
from codegen.cli.commands.config.main import config_command

# Import the actual command functions
from codegen.cli.commands.init.main import init
from codegen.cli.commands.integrations.main import integrations_app
from codegen.cli.commands.login.main import login
from codegen.cli.commands.logout.main import logout
from codegen.cli.commands.mcp.main import mcp
from codegen.cli.commands.profile.main import profile
from codegen.cli.commands.style_debug.main import style_debug
from codegen.cli.commands.tools.main import tools
from codegen.cli.commands.update.main import update

install(show_locals=True)
Expand All @@ -29,16 +32,19 @@ def version_callback(value: bool):
main = typer.Typer(name="codegen", help="Codegen CLI - Transform your code with AI.", rich_markup_mode="rich")

# Add individual commands to the main app
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("mcp", help="Start the Codegen MCP server.")(mcp)
main.command("profile", help="Display information about the currently authenticated user.")(profile)
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("update", help="Update Codegen to the latest or specified version")(update)

# Config is a group, so add it as a typer
# Add Typer apps as sub-applications
main.add_typer(config_command, name="config")
main.add_typer(integrations_app, name="integrations")


@main.callback()
Expand Down
6 changes: 6 additions & 0 deletions src/codegen/cli/commands/claude/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Claude Code integration commands."""

from .hooks import cleanup_claude_hook, ensure_claude_hook, get_codegen_url, wait_for_session_id
from .main import claude

__all__ = ["claude", "cleanup_claude_hook", "ensure_claude_hook", "get_codegen_url", "wait_for_session_id"]
Loading
Loading