detect-python-command
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePython コマンド判別・実行
Python 命令检测与执行
概要
概要
現在の環境で使用すべき適切なPythonコマンドを判別し、スクリプトを実行します。プロジェクトの設定(pyproject.toml、.venv、uv)を確認し、最適な方法で実行します。
判断当前环境中应使用的合适Python命令,并执行脚本。会检查项目配置(pyproject.toml、.venv、uv),以最优方式执行脚本。
前提条件
前提条件
なし(環境を自動検出します)
无(会自动检测环境)
使用方法
使用方法
方法1: ラッパースクリプトで実行(推奨)
方法1: 通过包装脚本执行(推荐)
run-python.shbash
skills/detect-python-command/scripts/run-python.sh script.py [args...]例:
bash
undefined使用直接执行Python脚本:
run-python.shbash
skills/detect-python-command/scripts/run-python.sh script.py [args...]示例:
bash
undefined設定ファイルの検証
验证配置文件
skills/detect-python-command/scripts/run-python.sh
skills/mixseek-config-validate/scripts/validate-config.py config.toml
skills/mixseek-config-validate/scripts/validate-config.py config.toml
skills/detect-python-command/scripts/run-python.sh
skills/mixseek-config-validate/scripts/validate-config.py config.toml
skills/mixseek-config-validate/scripts/validate-config.py config.toml
引数付きで実行
带参数执行
skills/detect-python-command/scripts/run-python.sh script.py --verbose --output result.json
undefinedskills/detect-python-command/scripts/run-python.sh script.py --verbose --output result.json
undefined方法2: コマンドの確認のみ
方法2: 仅确认命令
使用されるPythonコマンドを確認したい場合:
bash
undefined若只需确认将使用的Python命令:
bash
undefined標準モード(コマンド名のみ)
标准模式(仅显示命令名)
skills/detect-python-command/scripts/detect-python.sh
skills/detect-python-command/scripts/detect-python.sh
詳細モード(判別過程を表示)
详细模式(显示判断过程)
skills/detect-python-command/scripts/detect-python.sh --verbose
undefinedskills/detect-python-command/scripts/detect-python.sh --verbose
undefined判別ロジック
判断逻辑
以下の優先順位で判別します:
| 優先度 | 条件 | 使用するコマンド |
|---|---|---|
| 1 | | |
| 2 | | |
| 3 | | |
| 4 | | |
| 5 | いずれも該当しない | エラー終了 |
将按照以下优先级进行判断:
| 优先级 | 条件 | 使用的命令 |
|---|---|---|
| 1 | 存在 | |
| 2 | 存在 | |
| 3 | 存在 | |
| 4 | 存在 | |
| 5 | 均不满足 | 报错退出 |
例
示例
他のスキルからの参照
从其他技能调用
bash
undefinedbash
undefinedmixseek-config-validate からの使用例
mixseek-config-validate的使用示例
skills/detect-python-command/scripts/run-python.sh
skills/mixseek-config-validate/scripts/validate-config.py config.toml --type team
skills/mixseek-config-validate/scripts/validate-config.py config.toml --type team
undefinedskills/detect-python-command/scripts/run-python.sh
skills/mixseek-config-validate/scripts/validate-config.py config.toml --type team
skills/mixseek-config-validate/scripts/validate-config.py config.toml --type team
undefined環境情報の確認
确认环境信息
User: このプロジェクトでどのPythonコマンドを使えばいい?
Agent: 判別スクリプトを実行します...
$ skills/detect-python-command/scripts/detect-python.sh --verbose
出力:
Detecting Python command...
pyproject.toml: found
uv: installed (0.9.24)
Result: uv run python
このプロジェクトでは `uv run python` が使用されます。
スクリプト実行時は run-python.sh を使用してください。用户:这个项目应该使用哪个Python命令?
Agent:将执行检测脚本...
$ skills/detect-python-command/scripts/detect-python.sh --verbose
输出:
Detecting Python command...
pyproject.toml: found
uv: installed (0.9.24)
Result: uv run python
本项目将使用`uv run python`。
执行脚本时请使用run-python.sh。スクリプト一覧
脚本列表
| スクリプト | 用途 |
|---|---|
| Pythonスクリプトを適切なコマンドで実行(推奨) |
| 使用されるコマンドを確認(情報提供用) |
| 脚本 | 用途 |
|---|---|
| 使用合适的命令执行Python脚本(推荐) |
| 确认将使用的命令(仅用于信息查询) |
トラブルシューティング
故障排除
Pythonが見つからない
找不到Python
Error: No Python interpreter found解決方法:
- Python をインストール
- または を実行して仮想環境を作成
uv sync
Error: No Python interpreter found解决方法:
- 安装Python
- 或执行创建虚拟环境
uv sync
スクリプトが見つからない
找不到脚本
Error: Script not found: script.py解決方法:
- スクリプトのパスが正しいか確認
- 相対パスの場合、カレントディレクトリを確認
Error: Script not found: script.py解决方法:
- 确认脚本路径是否正确
- 若使用相对路径,确认当前目录是否正确
uv が見つからない
找不到uv
uv がインストールされていない場合、フォールバックとして または システムの を使用します。
.venv/bin/pythonpython3uv のインストールが必要な場合は、ユーザーに確認してから公式ドキュメント(https://docs.astral.sh/uv/)を案内してください。
関連スキル
相关技能
このスキルは以下のスキルから参照されます:
- - 設定ファイルの検証
mixseek-config-validate
本技能被以下技能引用:
- - 配置文件验证
mixseek-config-validate