Skip to content

Commit 5d74c4c

Browse files
authored
fix: unauthenticated create (#500)
1 parent bfdc80b commit 5d74c4c

File tree

1 file changed

+2
-3
lines changed
  • src/codegen/cli/commands/create

1 file changed

+2
-3
lines changed

src/codegen/cli/commands/create/main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from codegen.cli.api.client import RestAPI
77
from codegen.cli.auth.constants import PROMPTS_DIR
8-
from codegen.cli.auth.decorators import requires_auth
98
from codegen.cli.auth.session import CodegenSession
109
from codegen.cli.auth.token_manager import get_current_token
1110
from codegen.cli.codemod.convert import convert_to_cli
@@ -14,6 +13,7 @@
1413
from codegen.cli.rich.pretty_print import pretty_print_error
1514
from codegen.cli.rich.spinners import create_spinner
1615
from codegen.cli.utils.default_code import DEFAULT_CODEMOD
16+
from codegen.cli.workspace.decorators import requires_init
1717

1818

1919
def get_prompts_dir() -> Path:
@@ -66,7 +66,7 @@ def make_relative(path: Path) -> str:
6666

6767

6868
@click.command(name="create")
69-
@requires_auth
69+
@requires_init
7070
@click.argument("name", type=str)
7171
@click.argument("path", type=click.Path(path_type=Path), default=Path.cwd())
7272
@click.option("--description", "-d", default=None, help="Description of what this codemod does.")
@@ -86,7 +86,6 @@ def create_command(session: CodegenSession, name: str, path: Path, description:
8686
pretty_print_error(f"File already exists at {format_path(rel_path)}\n\nTo overwrite the file:\n{format_command(f'codegen create {name} {rel_path} --overwrite')}")
8787
return
8888

89-
rich.print("") # Add a newline before output
9089
response = None
9190
code = None
9291
try:

0 commit comments

Comments
 (0)