chatup 0.2.19__tar.gz → 0.2.20__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.
- {chatup-0.2.19/src/chatup.egg-info → chatup-0.2.20}/PKG-INFO +18 -5
- {chatup-0.2.19 → chatup-0.2.20}/README.md +17 -4
- {chatup-0.2.19 → chatup-0.2.20}/pyproject.toml +3 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/__init__.py +1 -1
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/cli.py +2 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/commands/desktop.py +2 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/commands/macos.py +10 -5
- chatup-0.2.20/src/chatup/commands/remotion.py +53 -0
- chatup-0.2.20/src/chatup/setup/assets/remotion/.gitignore +3 -0
- chatup-0.2.20/src/chatup/setup/assets/remotion/package-lock.json +3843 -0
- chatup-0.2.20/src/chatup/setup/assets/remotion/package.json +16 -0
- chatup-0.2.20/src/chatup/setup/assets/remotion/src/index.jsx +22 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/desktop.py +28 -1
- chatup-0.2.20/src/chatup/setup/remotion.py +143 -0
- {chatup-0.2.19 → chatup-0.2.20/src/chatup.egg-info}/PKG-INFO +18 -5
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup.egg-info/SOURCES.txt +6 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_version.py +1 -1
- {chatup-0.2.19 → chatup-0.2.20}/LICENSE +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/setup.cfg +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/chrome_for_testing.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/chromedriver.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/commands/__init__.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/commands/chrome_for_testing.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/commands/chromedriver.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/commands/playwright.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/config.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/const.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/interaction/__init__.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/interaction/command_schema.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/interaction/policy.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/interaction/warnings.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/playwright.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/runtime/__init__.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/runtime/_managed_artifact.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/runtime/chrome_for_testing.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/runtime/chromedriver.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/runtime/playwright.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/__init__.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/assets/hermes/install.sh +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/assets/nvm.sh +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/cc_connect.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/chatgpt.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/claude.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/cli.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/codex.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/crs.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/cursor_agent.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/discourse.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/docker.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/elements.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/frp.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/gitea.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/hermes.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/lark_cli.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/mode_prompt.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/mysql.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/nginx.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/nodejs.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/opencode.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/service_credentials.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/shell_rc.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/twikoo.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/uv.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/workspace/__init__.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/workspace/cli.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/workspace/core.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/workspace/options.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/workspace/render.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/workspace/templates/default/en/AGENTS.md +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/workspace/templates/default/en/discussion/README.md +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/workspace/templates/default/en/projects/README.md +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/workspace/templates/default/zh/AGENTS.md +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/workspace/templates/default/zh/discussion/README.md +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/workspace/templates/default/zh/projects/README.md +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/workspace.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/zsh.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/setup/zulip.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/utils/__init__.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/utils/custom_logger.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/utils/pathing.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup/utils/platforming.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup.egg-info/dependency_links.txt +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup.egg-info/entry_points.txt +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup.egg-info/requires.txt +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/src/chatup.egg-info/top_level.txt +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_browser_backend_cli.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_chatgpt_setup.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_chrome_for_testing.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_chromedriver.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_cli_tree_docs.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_codex_setup.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_crs_setup.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_cursor_agent_setup.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_hermes_model_defaults.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_playwright.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_playwright_cli.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_publish_workflow.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_pyproject_metadata.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_service_installers.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_setup_cli.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_twikoo_setup.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_uv_activation.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_windows_compat.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_workspace_setup.py +0 -0
- {chatup-0.2.19 → chatup-0.2.20}/tests/test_zsh_alias_names.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chatup
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.20
|
|
4
4
|
Summary: ChatArch setup CLI extracted from ChatTool
|
|
5
5
|
Author-email: rexwzh <1073853456@qq.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -79,13 +79,25 @@ chatup crs --install-dir ~/.chatarch/crs/local --port 12392 --redis-port 6379
|
|
|
79
79
|
## macOS 常用应用
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
chatup macos #
|
|
82
|
+
chatup macos # 勾选安装,Apple Silicon 默认全选四项
|
|
83
83
|
chatup macos --app snipaste # 只安装 Snipaste
|
|
84
|
-
chatup macos
|
|
84
|
+
chatup macos --app blender # 安装 Blender 5.2.2 LTS(Apple Silicon)
|
|
85
|
+
chatup macos -I # 不询问,安装当前机器支持的全部选项
|
|
85
86
|
chatup macos --dry-run # 只预览安装计划
|
|
86
87
|
```
|
|
87
88
|
|
|
88
|
-
仅限 macOS
|
|
89
|
+
仅限 macOS。Apple Silicon 默认勾选 Snipaste、iTerm2、Chrome、Blender;Intel 保持前三项。终端中用空格切换勾选,回车安装;取消全部勾选则直接退出。可重复传入 `--app snipaste|iterm|chrome|blender` 选择多个应用。直接使用官方安装包,无需 Homebrew,已有应用验证后复用。详见[macOS 安装入口](https://arch.gh.wzhecnu.cn/ChatUp/commands/#macos)。
|
|
90
|
+
|
|
91
|
+
## Remotion 视频项目
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
chatup remotion ./my-video --dry-run -I
|
|
95
|
+
chatup remotion ./my-video -I
|
|
96
|
+
cd my-video
|
|
97
|
+
npm run studio
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
需要已有 Node.js >=18.12 和 npm >=9。创建带锁文件的 Remotion 4.0.530 项目,检测本机 Chrome 并输出渲染命令;不覆盖已有无关目录,也不替换 Node 或下载浏览器。项目放在指定目录,已有 Blender/Chrome 可通过 `chatup macos --app blender --app chrome` 验证或安装。详见[Remotion 安装约定](https://arch.gh.wzhecnu.cn/ChatUp/commands/#remotion)。
|
|
89
101
|
|
|
90
102
|
## Chrome 与 iTerm2
|
|
91
103
|
|
|
@@ -116,7 +128,8 @@ chatup chatgpt --yes # Windows 首次安装时接受 Store 协议
|
|
|
116
128
|
| --- | --- |
|
|
117
129
|
| 基础运行环境 | `doctor`、`uv`、`nodejs`、`docker`、`zsh`、`chrome-for-testing`、`chromedriver`、`playwright`、`frp` |
|
|
118
130
|
| 工作区脚手架 | `workspace` |
|
|
119
|
-
| 桌面应用 | `macos`(Snipaste/iTerm2/Chrome 多选)、`chrome`、`iterm`(仅 macOS)、`chatgpt`(含 Codex) |
|
|
131
|
+
| 桌面应用 | `macos`(Snipaste/iTerm2/Chrome/Blender 多选)、`chrome`、`iterm`(仅 macOS)、`chatgpt`(含 Codex) |
|
|
132
|
+
| 视频项目 | `remotion` |
|
|
120
133
|
| 本地服务安装 | `gitea`、`discourse`、`zulip`、`mysql`、`nginx`、`crs` |
|
|
121
134
|
| Agent 工具链 | `cc-connect`、`claude`、`codex`、`cursor-agent`、`opencode`、`hermes`、`lark-cli` |
|
|
122
135
|
|
|
@@ -48,13 +48,25 @@ chatup crs --install-dir ~/.chatarch/crs/local --port 12392 --redis-port 6379
|
|
|
48
48
|
## macOS 常用应用
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
chatup macos #
|
|
51
|
+
chatup macos # 勾选安装,Apple Silicon 默认全选四项
|
|
52
52
|
chatup macos --app snipaste # 只安装 Snipaste
|
|
53
|
-
chatup macos
|
|
53
|
+
chatup macos --app blender # 安装 Blender 5.2.2 LTS(Apple Silicon)
|
|
54
|
+
chatup macos -I # 不询问,安装当前机器支持的全部选项
|
|
54
55
|
chatup macos --dry-run # 只预览安装计划
|
|
55
56
|
```
|
|
56
57
|
|
|
57
|
-
仅限 macOS
|
|
58
|
+
仅限 macOS。Apple Silicon 默认勾选 Snipaste、iTerm2、Chrome、Blender;Intel 保持前三项。终端中用空格切换勾选,回车安装;取消全部勾选则直接退出。可重复传入 `--app snipaste|iterm|chrome|blender` 选择多个应用。直接使用官方安装包,无需 Homebrew,已有应用验证后复用。详见[macOS 安装入口](https://arch.gh.wzhecnu.cn/ChatUp/commands/#macos)。
|
|
59
|
+
|
|
60
|
+
## Remotion 视频项目
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
chatup remotion ./my-video --dry-run -I
|
|
64
|
+
chatup remotion ./my-video -I
|
|
65
|
+
cd my-video
|
|
66
|
+
npm run studio
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
需要已有 Node.js >=18.12 和 npm >=9。创建带锁文件的 Remotion 4.0.530 项目,检测本机 Chrome 并输出渲染命令;不覆盖已有无关目录,也不替换 Node 或下载浏览器。项目放在指定目录,已有 Blender/Chrome 可通过 `chatup macos --app blender --app chrome` 验证或安装。详见[Remotion 安装约定](https://arch.gh.wzhecnu.cn/ChatUp/commands/#remotion)。
|
|
58
70
|
|
|
59
71
|
## Chrome 与 iTerm2
|
|
60
72
|
|
|
@@ -85,7 +97,8 @@ chatup chatgpt --yes # Windows 首次安装时接受 Store 协议
|
|
|
85
97
|
| --- | --- |
|
|
86
98
|
| 基础运行环境 | `doctor`、`uv`、`nodejs`、`docker`、`zsh`、`chrome-for-testing`、`chromedriver`、`playwright`、`frp` |
|
|
87
99
|
| 工作区脚手架 | `workspace` |
|
|
88
|
-
| 桌面应用 | `macos`(Snipaste/iTerm2/Chrome 多选)、`chrome`、`iterm`(仅 macOS)、`chatgpt`(含 Codex) |
|
|
100
|
+
| 桌面应用 | `macos`(Snipaste/iTerm2/Chrome/Blender 多选)、`chrome`、`iterm`(仅 macOS)、`chatgpt`(含 Codex) |
|
|
101
|
+
| 视频项目 | `remotion` |
|
|
89
102
|
| 本地服务安装 | `gitea`、`discourse`、`zulip`、`mysql`、`nginx`、`crs` |
|
|
90
103
|
| Agent 工具链 | `cc-connect`、`claude`、`codex`、`cursor-agent`、`opencode`、`hermes`、`lark-cli` |
|
|
91
104
|
|
|
@@ -62,6 +62,9 @@ include-package-data = true
|
|
|
62
62
|
"chatup.setup" = [
|
|
63
63
|
"assets/*.sh",
|
|
64
64
|
"assets/hermes/*.sh",
|
|
65
|
+
"assets/remotion/*.json",
|
|
66
|
+
"assets/remotion/.gitignore",
|
|
67
|
+
"assets/remotion/src/*.jsx",
|
|
65
68
|
"workspace/templates/default/zh/*.md",
|
|
66
69
|
"workspace/templates/default/zh/projects/*.md",
|
|
67
70
|
"workspace/templates/default/zh/discussion/*.md",
|
|
@@ -9,6 +9,7 @@ from chatup.commands.chromedriver import cli as chromedriver_cli
|
|
|
9
9
|
from chatup.commands.desktop import chrome_cli, iterm_cli
|
|
10
10
|
from chatup.commands.macos import macos_cli
|
|
11
11
|
from chatup.commands.playwright import cli as playwright_cli
|
|
12
|
+
from chatup.commands.remotion import remotion_cli
|
|
12
13
|
from chatup.setup.cli import register_setup_commands
|
|
13
14
|
|
|
14
15
|
|
|
@@ -37,6 +38,7 @@ main.add_command(playwright_cli)
|
|
|
37
38
|
main.add_command(chrome_cli)
|
|
38
39
|
main.add_command(iterm_cli)
|
|
39
40
|
main.add_command(macos_cli)
|
|
41
|
+
main.add_command(remotion_cli)
|
|
40
42
|
|
|
41
43
|
|
|
42
44
|
if __name__ == "__main__":
|
|
@@ -17,6 +17,8 @@ def _install(app: str, **kwargs) -> None:
|
|
|
17
17
|
click.echo(f"{result['app']} install plan ({result['platform']}):")
|
|
18
18
|
if "url" in result:
|
|
19
19
|
click.echo(f"Download: {result['url']}")
|
|
20
|
+
if "sha256" in result:
|
|
21
|
+
click.echo(f"SHA-256: {result['sha256']}")
|
|
20
22
|
if "path" in result:
|
|
21
23
|
click.echo(f"Install to: {result['path']} (verify publisher signature)")
|
|
22
24
|
if "command" in result:
|
|
@@ -15,20 +15,25 @@ from chatup.interaction import (
|
|
|
15
15
|
|
|
16
16
|
from .desktop import _install
|
|
17
17
|
|
|
18
|
-
MACOS_APPS = {"snipaste": "Snipaste", "iterm": "iTerm2", "chrome": "Google Chrome"}
|
|
18
|
+
MACOS_APPS = {"snipaste": "Snipaste", "iterm": "iTerm2", "chrome": "Google Chrome", "blender": "Blender"}
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
@click.command(name="macos")
|
|
22
22
|
@click.option("--app", "apps", type=click.Choice(list(MACOS_APPS)), multiple=True,
|
|
23
|
-
help="Install only this app; repeat to select several. Defaults to all
|
|
23
|
+
help="Install only this app; repeat to select several. Defaults to all supported apps.")
|
|
24
24
|
@click.option("--dry-run", is_flag=True, help="Preview selected apps without downloading or installing.")
|
|
25
25
|
@click.option("--log-level", type=click.Choice(["DEBUG", "INFO", "WARNING", "ERROR"], case_sensitive=False), default="INFO")
|
|
26
26
|
@add_interactive_option
|
|
27
27
|
def macos_cli(apps, dry_run, log_level, interactive) -> None:
|
|
28
|
-
"""Install
|
|
28
|
+
"""Install macOS apps; Blender is available on Apple Silicon."""
|
|
29
29
|
if platform.system() != "Darwin":
|
|
30
30
|
raise click.ClickException("chatup macos is supported on macOS only.")
|
|
31
|
-
|
|
31
|
+
available = dict(MACOS_APPS)
|
|
32
|
+
if platform.machine().lower() not in {"arm64", "aarch64"}:
|
|
33
|
+
available.pop("blender")
|
|
34
|
+
if "blender" in apps and "blender" not in available:
|
|
35
|
+
raise click.ClickException("Blender installation supports Apple Silicon macOS only.")
|
|
36
|
+
selected = list(dict.fromkeys(apps)) if apps else list(available)
|
|
32
37
|
_, can_prompt, force, _, need_prompt = resolve_interactive_mode(
|
|
33
38
|
interactive, auto_prompt_condition=not apps and not dry_run,
|
|
34
39
|
)
|
|
@@ -36,7 +41,7 @@ def macos_cli(apps, dry_run, log_level, interactive) -> None:
|
|
|
36
41
|
if need_prompt:
|
|
37
42
|
selected = ask_checkbox(
|
|
38
43
|
"Select macOS apps to install",
|
|
39
|
-
choices=[create_choice(label, name) for name, label in
|
|
44
|
+
choices=[create_choice(label, name) for name, label in available.items()],
|
|
40
45
|
default_values=selected,
|
|
41
46
|
instruction="(Space: toggle, Enter: install selected, Ctrl-C: cancel)",
|
|
42
47
|
)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""CLI for a local, reproducible Remotion video project."""
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
import platform
|
|
4
|
+
import shlex
|
|
5
|
+
import subprocess
|
|
6
|
+
|
|
7
|
+
import click
|
|
8
|
+
|
|
9
|
+
from chatup.interaction import (
|
|
10
|
+
abort_if_force_without_tty,
|
|
11
|
+
add_interactive_option,
|
|
12
|
+
ask_path,
|
|
13
|
+
resolve_interactive_mode,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@click.command(name="remotion")
|
|
18
|
+
@click.argument("project_dir", required=False, type=click.Path(path_type=Path))
|
|
19
|
+
@click.option("--browser-executable", type=click.Path(dir_okay=False, path_type=Path),
|
|
20
|
+
help="Existing Chrome/Chromium executable to use in the suggested render command.")
|
|
21
|
+
@click.option("--dry-run", is_flag=True, help="Preview without downloading, executing or writing files.")
|
|
22
|
+
@click.option("--log-level", type=click.Choice(["DEBUG", "INFO", "WARNING", "ERROR"], case_sensitive=False), default="INFO")
|
|
23
|
+
@add_interactive_option
|
|
24
|
+
def remotion_cli(project_dir, browser_executable, dry_run, log_level, interactive):
|
|
25
|
+
"""Initialize a local Remotion project with locked dependencies."""
|
|
26
|
+
from chatup.setup.remotion import setup_remotion
|
|
27
|
+
|
|
28
|
+
_, can_prompt, force, _, need_prompt = resolve_interactive_mode(
|
|
29
|
+
interactive, auto_prompt_condition=project_dir is None,
|
|
30
|
+
)
|
|
31
|
+
usage = "Usage: chatup remotion PROJECT_DIR [-i|-I]"
|
|
32
|
+
abort_if_force_without_tty(force, can_prompt, usage)
|
|
33
|
+
if need_prompt:
|
|
34
|
+
project_dir = ask_path("Remotion project directory", default=str(project_dir or Path.cwd() / "remotion-video"))
|
|
35
|
+
if not project_dir:
|
|
36
|
+
raise click.UsageError("PROJECT_DIR is required. Example: chatup remotion ./my-video -I")
|
|
37
|
+
try:
|
|
38
|
+
result = setup_remotion(project_dir, dry_run=dry_run, browser_executable=browser_executable, log_level=log_level)
|
|
39
|
+
except RuntimeError as exc:
|
|
40
|
+
raise click.ClickException(str(exc)) from exc
|
|
41
|
+
label = {"planned": "Install plan", "created": "Project ready", "already_initialized": "Already initialized"}[result["status"]]
|
|
42
|
+
click.echo(f"{label}: Remotion {result['version']} at {result['path']}")
|
|
43
|
+
if dry_run:
|
|
44
|
+
click.echo("Requires Node.js >=18.12 and npm >=9; installs project-local locked dependencies.")
|
|
45
|
+
click.echo("Dry run: no download, process execution or directory writes performed.")
|
|
46
|
+
click.echo("From the project directory, start Studio with: npm run studio")
|
|
47
|
+
if result["browser"]:
|
|
48
|
+
command = ["npm", "run", "render", "--", f"--browser-executable={result['browser']}"]
|
|
49
|
+
render = subprocess.list2cmdline(command) if platform.system() == "Windows" else shlex.join(command)
|
|
50
|
+
click.echo(f"Render with the existing browser: {render}")
|
|
51
|
+
else:
|
|
52
|
+
click.echo("No local Chrome detected. Run chatup chrome, then rerun with --browser-executable PATH for render guidance.")
|
|
53
|
+
click.echo("Browser downloads and Studio startup are not part of project initialization.")
|