refactorai-cli 0.2.6__tar.gz → 0.2.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/PKG-INFO +1 -1
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/pyproject.toml +1 -1
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/__init__.py +1 -1
- refactorai_cli-0.2.7/refactorai_cli/main.py +160 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli.egg-info/PKG-INFO +1 -1
- refactorai_cli-0.2.6/refactorai_cli/main.py +0 -69
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/README.md +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/auth.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/client.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/commands/__init__.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/commands/auth_cmds.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/commands/engine_cmds.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/commands/model_cmds.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/commands/rules_cmds.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/commands/run_cmds.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/commands/runtime_cmds.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/commands/setup_cmds.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/control_plane.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/credentials.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/local_constitution.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/local_engine_runtime.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/local_paths.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/model_policy.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/runtime_manager.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/settings.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli/setup_flow.py +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli.egg-info/SOURCES.txt +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli.egg-info/dependency_links.txt +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli.egg-info/entry_points.txt +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli.egg-info/requires.txt +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/refactorai_cli.egg-info/top_level.txt +0 -0
- {refactorai_cli-0.2.6 → refactorai_cli-0.2.7}/setup.cfg +0 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"""`refactor` CLI entry point."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from refactorai_cli import __version__
|
|
8
|
+
from refactorai_cli.commands import auth_cmds, engine_cmds, model_cmds, runtime_cmds, setup_cmds
|
|
9
|
+
|
|
10
|
+
app = typer.Typer(
|
|
11
|
+
name="refactor",
|
|
12
|
+
help="Local-first AI code review and refactor, run from your project folder.",
|
|
13
|
+
no_args_is_help=True,
|
|
14
|
+
add_completion=False,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _version_callback(value: bool) -> None:
|
|
19
|
+
if value:
|
|
20
|
+
typer.echo(f"refactor {__version__}")
|
|
21
|
+
raise typer.Exit()
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@app.callback()
|
|
25
|
+
def main(
|
|
26
|
+
version: bool = typer.Option(
|
|
27
|
+
False,
|
|
28
|
+
"--version",
|
|
29
|
+
"-V",
|
|
30
|
+
help="Show the CLI version and exit.",
|
|
31
|
+
callback=_version_callback,
|
|
32
|
+
is_eager=True,
|
|
33
|
+
),
|
|
34
|
+
) -> None:
|
|
35
|
+
"""refactor CLI."""
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _core_feature_unavailable(feature: str) -> None:
|
|
39
|
+
typer.echo(
|
|
40
|
+
f"{feature} is unavailable in this standalone CLI install because "
|
|
41
|
+
"core runtime modules are not installed in Python. Run `refactor setup` "
|
|
42
|
+
"to complete machine bootstrap, then retry."
|
|
43
|
+
)
|
|
44
|
+
raise typer.Exit(code=2)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
from refactorai_cli.commands import run_cmds as _run_cmds
|
|
49
|
+
except ModuleNotFoundError:
|
|
50
|
+
_run_cmds = None
|
|
51
|
+
|
|
52
|
+
try:
|
|
53
|
+
from refactorai_cli.commands import rules_cmds as _rules_cmds
|
|
54
|
+
except ModuleNotFoundError:
|
|
55
|
+
_rules_cmds = None
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# Auth (R7.1)
|
|
59
|
+
app.command()(auth_cmds.login)
|
|
60
|
+
app.command()(auth_cmds.whoami)
|
|
61
|
+
|
|
62
|
+
if _run_cmds is not None:
|
|
63
|
+
# Project / run surface
|
|
64
|
+
app.command()(_run_cmds.init)
|
|
65
|
+
app.command()(_run_cmds.start)
|
|
66
|
+
app.command()(_run_cmds.stop)
|
|
67
|
+
app.command()(_run_cmds.shell)
|
|
68
|
+
app.command()(_run_cmds.review)
|
|
69
|
+
app.command()(_run_cmds.code)
|
|
70
|
+
app.command()(_run_cmds.requests)
|
|
71
|
+
app.command()(_run_cmds.apply)
|
|
72
|
+
app.command()(_run_cmds.revert)
|
|
73
|
+
app.command()(_run_cmds.status)
|
|
74
|
+
app.command()(_run_cmds.diff)
|
|
75
|
+
app.command()(_run_cmds.gc)
|
|
76
|
+
app.command()(_run_cmds.check)
|
|
77
|
+
app.command()(_run_cmds.doctor)
|
|
78
|
+
app.command()(_run_cmds.config)
|
|
79
|
+
else:
|
|
80
|
+
@app.command("init")
|
|
81
|
+
def _init_stub() -> None:
|
|
82
|
+
_core_feature_unavailable("`refactor init`")
|
|
83
|
+
|
|
84
|
+
@app.command("start")
|
|
85
|
+
def _start_stub() -> None:
|
|
86
|
+
_core_feature_unavailable("`refactor start`")
|
|
87
|
+
|
|
88
|
+
@app.command("stop")
|
|
89
|
+
def _stop_stub() -> None:
|
|
90
|
+
_core_feature_unavailable("`refactor stop`")
|
|
91
|
+
|
|
92
|
+
@app.command("shell")
|
|
93
|
+
def _shell_stub() -> None:
|
|
94
|
+
_core_feature_unavailable("`refactor shell`")
|
|
95
|
+
|
|
96
|
+
@app.command("review")
|
|
97
|
+
def _review_stub() -> None:
|
|
98
|
+
_core_feature_unavailable("`refactor review`")
|
|
99
|
+
|
|
100
|
+
@app.command("code")
|
|
101
|
+
def _code_stub() -> None:
|
|
102
|
+
_core_feature_unavailable("`refactor code`")
|
|
103
|
+
|
|
104
|
+
@app.command("requests")
|
|
105
|
+
def _requests_stub() -> None:
|
|
106
|
+
_core_feature_unavailable("`refactor requests`")
|
|
107
|
+
|
|
108
|
+
@app.command("apply")
|
|
109
|
+
def _apply_stub() -> None:
|
|
110
|
+
_core_feature_unavailable("`refactor apply`")
|
|
111
|
+
|
|
112
|
+
@app.command("revert")
|
|
113
|
+
def _revert_stub() -> None:
|
|
114
|
+
_core_feature_unavailable("`refactor revert`")
|
|
115
|
+
|
|
116
|
+
@app.command("status")
|
|
117
|
+
def _status_stub() -> None:
|
|
118
|
+
_core_feature_unavailable("`refactor status`")
|
|
119
|
+
|
|
120
|
+
@app.command("diff")
|
|
121
|
+
def _diff_stub() -> None:
|
|
122
|
+
_core_feature_unavailable("`refactor diff`")
|
|
123
|
+
|
|
124
|
+
@app.command("gc")
|
|
125
|
+
def _gc_stub() -> None:
|
|
126
|
+
_core_feature_unavailable("`refactor gc`")
|
|
127
|
+
|
|
128
|
+
@app.command("check")
|
|
129
|
+
def _check_stub() -> None:
|
|
130
|
+
_core_feature_unavailable("`refactor check`")
|
|
131
|
+
|
|
132
|
+
@app.command("doctor")
|
|
133
|
+
def _doctor_stub() -> None:
|
|
134
|
+
_core_feature_unavailable("`refactor doctor`")
|
|
135
|
+
|
|
136
|
+
@app.command("config")
|
|
137
|
+
def _config_stub() -> None:
|
|
138
|
+
_core_feature_unavailable("`refactor config`")
|
|
139
|
+
|
|
140
|
+
app.command()(setup_cmds.setup)
|
|
141
|
+
|
|
142
|
+
# Runtime/engine/model operations.
|
|
143
|
+
if _rules_cmds is not None:
|
|
144
|
+
app.add_typer(_rules_cmds.app, name="rules")
|
|
145
|
+
else:
|
|
146
|
+
rules_stub_app = typer.Typer(help="Rules commands unavailable in this install.")
|
|
147
|
+
|
|
148
|
+
@rules_stub_app.callback(invoke_without_command=True)
|
|
149
|
+
def _rules_stub_callback() -> None:
|
|
150
|
+
_core_feature_unavailable("`refactor rules`")
|
|
151
|
+
|
|
152
|
+
app.add_typer(rules_stub_app, name="rules")
|
|
153
|
+
|
|
154
|
+
app.add_typer(runtime_cmds.app, name="runtime")
|
|
155
|
+
app.add_typer(engine_cmds.app, name="engine")
|
|
156
|
+
app.add_typer(model_cmds.app, name="model")
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
if __name__ == "__main__":
|
|
160
|
+
app()
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"""`refactor` CLI entry point."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import typer
|
|
6
|
-
|
|
7
|
-
from refactorai_cli import __version__
|
|
8
|
-
from refactorai_cli.commands import auth_cmds, engine_cmds, model_cmds, rules_cmds, run_cmds, runtime_cmds, setup_cmds
|
|
9
|
-
|
|
10
|
-
app = typer.Typer(
|
|
11
|
-
name="refactor",
|
|
12
|
-
help="Local-first AI code review and refactor, run from your project folder.",
|
|
13
|
-
no_args_is_help=True,
|
|
14
|
-
add_completion=False,
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def _version_callback(value: bool) -> None:
|
|
19
|
-
if value:
|
|
20
|
-
typer.echo(f"refactor {__version__}")
|
|
21
|
-
raise typer.Exit()
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@app.callback()
|
|
25
|
-
def main(
|
|
26
|
-
version: bool = typer.Option(
|
|
27
|
-
False,
|
|
28
|
-
"--version",
|
|
29
|
-
"-V",
|
|
30
|
-
help="Show the CLI version and exit.",
|
|
31
|
-
callback=_version_callback,
|
|
32
|
-
is_eager=True,
|
|
33
|
-
),
|
|
34
|
-
) -> None:
|
|
35
|
-
"""refactor CLI."""
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
# Auth (R7.1)
|
|
39
|
-
app.command()(auth_cmds.login)
|
|
40
|
-
app.command()(auth_cmds.whoami)
|
|
41
|
-
|
|
42
|
-
# Project / run surface
|
|
43
|
-
app.command()(run_cmds.init)
|
|
44
|
-
app.command()(run_cmds.start)
|
|
45
|
-
app.command()(run_cmds.stop)
|
|
46
|
-
app.command()(run_cmds.shell)
|
|
47
|
-
app.command()(run_cmds.review)
|
|
48
|
-
app.command()(run_cmds.code)
|
|
49
|
-
app.command()(run_cmds.requests)
|
|
50
|
-
app.command()(run_cmds.apply)
|
|
51
|
-
app.command()(run_cmds.revert)
|
|
52
|
-
app.command()(run_cmds.status)
|
|
53
|
-
app.command()(run_cmds.diff)
|
|
54
|
-
app.command()(run_cmds.gc)
|
|
55
|
-
app.command()(run_cmds.check)
|
|
56
|
-
app.command()(run_cmds.doctor)
|
|
57
|
-
app.command()(run_cmds.config)
|
|
58
|
-
|
|
59
|
-
app.command()(setup_cmds.setup)
|
|
60
|
-
|
|
61
|
-
# Runtime/engine/model operations.
|
|
62
|
-
app.add_typer(rules_cmds.app, name="rules")
|
|
63
|
-
app.add_typer(runtime_cmds.app, name="runtime")
|
|
64
|
-
app.add_typer(engine_cmds.app, name="engine")
|
|
65
|
-
app.add_typer(model_cmds.app, name="model")
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if __name__ == "__main__":
|
|
69
|
-
app()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|