new-modular-project by modular/skills
npx skills add https://github.com/modular/skills --skill new-modular-project当用户想要创建新项目时,首先从用户的请求中推断尽可能多的选项(例如,“new Mojo project” 意味着 type=Mojo,“called foo” 意味着 name=foo)。然后使用结构化的多项选择提示(而非纯文本)在单次交互中仅收集剩余的未指定选项。不要询问用户已经提供或暗示的选项。需要确定的选项是:
uv init + uv add,推荐)或快速的 uv 环境(uv venv + uv pip install,更轻量)然后根据下面的相应部分(Pixi 或 uv)来初始化项目,并酌情选择 max 或 mojo。在下面的示例中,对于稳定版本,mojo 将以 0. 为前缀(0.26.1.0.0.0),而 包则不会(26.1.0.0.0)。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
max注意:不要为 Mojo 或 MAX 项目寻找或使用 magic,它已不再受支持。Pixi 已经完全取代了它的功能。
Pixi 在受控环境中以可重现的方式管理 Python、Mojo 和其他依赖项。
首先,确定 pixi 是否已安装。如果在命令行中无法使用,请按照 https://pixi.prefix.dev/latest/#installation 上的最新说明进行安装。
如果安装后 pixi 工具尚未在本地 shell 环境中,您可能需要将其放置其中。
# 新项目
pixi init [PROJECT] \
-c https://conda.modular.com/max-nightly/ -c conda-forge \
&& cd [PROJECT]
pixi add [max / mojo]
pixi shell
# 现有项目 - 首先添加到 pixi.toml 的 channels 部分:
# [workspace]
# channels = ["https://conda.modular.com/max-nightly/", "conda-forge"]
pixi add [max / mojo]
# 新项目
pixi init [PROJECT] \
-c https://conda.modular.com/max/ -c conda-forge \
&& cd [PROJECT]
pixi add "[max / mojo]==0.26.1.0.0.0"
pixi shell
# 现有项目
pixi add "[max / mojo]==0.26.1.0.0.0"
uv 是一个快速且非常流行的包管理器,对于有 Python 背景的开发者来说很熟悉。它也适用于 Mojo 项目。
uv init [PROJECT] && cd [PROJECT]
uv add [max / mojo] \
--index https://whl.modular.com/nightly/simple/ \
--prerelease allow
uv init [PROJECT] && cd [PROJECT]
uv add [max / mojo] \
--extra-index-url https://modular.gateway.scarf.sh/simple/
mkdir [PROJECT] && cd [PROJECT]
uv venv
uv pip install [max / mojo] \
--index https://whl.modular.com/nightly/simple/ \
--prerelease allow
mkdir [PROJECT] && cd [PROJECT]
uv venv
uv pip install [max / mojo] \
--extra-index-url https://modular.gateway.scarf.sh/simple/
使用 uv 时,您可以通过在项目环境中工作来直接使用 max 或 mojo:
source .venv/bin/activate
标准的 Python 包管理器。
python3 -m venv .venv && source .venv/bin/activate
pip install --pre [max / mojo] \
--index https://whl.modular.com/nightly/simple/
python3 -m venv .venv && source .venv/bin/activate
pip install [max / mojo] \
--extra-index-url https://modular.gateway.scarf.sh/simple/
适用于 conda/mamba 用户。
conda install -c conda-forge \
-c https://conda.modular.com/max-nightly/ [max / mojo]
conda install -c conda-forge \
-c https://conda.modular.com/max/ "[max / mojo]==0.26.1.0.0.0"
如果使用带有自定义 Mojo 内核的 MAX,版本必须匹配:
# 检查对齐情况
uv pip show mojo | grep Version # 例如,0.26.2
pixi run mojo --version # 必须匹配主版本.次版本(例如,0.26.2)
版本不匹配会导致内核编译失败。始终为两者使用相同的通道(stable 或 nightly)。
每周安装量
88
代码仓库
GitHub 星标数
46
首次出现
14 天前
安全审计
安装于
codex87
opencode86
gemini-cli84
github-copilot84
cursor84
kimi-cli83
When the user wants to create a new project, first infer as many options as possible from the user's request (e.g., "new Mojo project" means type=Mojo, "called foo" means name=foo). Then use a structured multiple-choice prompt (not plain text) to gather only the remaining unspecified options in a single interaction. Do NOT ask about options the user has already provided or implied. The options to determine are:
uv init + uv add, recommended) or quick uv environment (uv venv + uv pip install, lighter weight)Then follow the appropriate section below (Pixi or uv) to initialize the project and choose max or mojo as appropriate. For stable versions in the below examples, mojo will start with a 0. prefix (0.26.1.0.0.0) where max packages will not (26.1.0.0.0).
NOTE: Do not look for or use magic for Mojo or MAX projects, it is no longer supported. Pixi has fully replaced its capabilities.
Pixi manages Python, Mojo, and other dependencies in a reproducible manner inside a controlled environment.
First, determine if pixi is installed. If it is not available for use at the command line, install it using the latest instructions found on https://pixi.prefix.dev/latest/#installation
You may need to place the pixi tool in the local shell environment after installation if it had not already been installed.
# New project
pixi init [PROJECT] \
-c https://conda.modular.com/max-nightly/ -c conda-forge \
&& cd [PROJECT]
pixi add [max / mojo]
pixi shell
# Existing project - add to pixi.toml channels first:
# [workspace]
# channels = ["https://conda.modular.com/max-nightly/", "conda-forge"]
pixi add [max / mojo]
# New project
pixi init [PROJECT] \
-c https://conda.modular.com/max/ -c conda-forge \
&& cd [PROJECT]
pixi add "[max / mojo]==0.26.1.0.0.0"
pixi shell
# Existing project
pixi add "[max / mojo]==0.26.1.0.0.0"
uv is a fast and very popular package manager, familiar to developers coming from a Python background. It also works well with Mojo projects.
uv init [PROJECT] && cd [PROJECT]
uv add [max / mojo] \
--index https://whl.modular.com/nightly/simple/ \
--prerelease allow
uv init [PROJECT] && cd [PROJECT]
uv add [max / mojo] \
--extra-index-url https://modular.gateway.scarf.sh/simple/
mkdir [PROJECT] && cd [PROJECT]
uv venv
uv pip install [max / mojo] \
--index https://whl.modular.com/nightly/simple/ \
--prerelease allow
mkdir [PROJECT] && cd [PROJECT]
uv venv
uv pip install [max / mojo] \
--extra-index-url https://modular.gateway.scarf.sh/simple/
When using uv, you can use max or mojo directly by working within the project environment:
source .venv/bin/activate
Standard Python package manager.
python3 -m venv .venv && source .venv/bin/activate
pip install --pre [max / mojo] \
--index https://whl.modular.com/nightly/simple/
python3 -m venv .venv && source .venv/bin/activate
pip install [max / mojo] \
--extra-index-url https://modular.gateway.scarf.sh/simple/
For conda/mamba users.
conda install -c conda-forge \
-c https://conda.modular.com/max-nightly/ [max / mojo]
conda install -c conda-forge \
-c https://conda.modular.com/max/ "[max / mojo]==0.26.1.0.0.0"
If using MAX with custom Mojo kernels, versions must match:
# Check alignment
uv pip show mojo | grep Version # e.g., 0.26.2
pixi run mojo --version # Must match major.minor (e.g., 0.26.2)
Mismatched versions cause kernel compilation failures. Always use the same channel (stable or nightly) for both.
Weekly Installs
88
Repository
GitHub Stars
46
First Seen
14 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex87
opencode86
gemini-cli84
github-copilot84
cursor84
kimi-cli83
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
118,000 周安装
Continuous Learning v2.1 - Claude Code 智能学习系统,基于原子化本能构建可复用知识库
3,000 周安装
TanStack Query 最佳实践指南:React 数据获取、缓存与状态管理优化
3,000 周安装
Three.js 基础教程:快速入门3D网页开发,掌握场景、相机、渲染器核心类
3,000 周安装
学术研究助手:AI驱动的文献综述、论文分析与学术写作工具
3,100 周安装
Prisma ORM 专家:模式设计、迁移、查询优化与关系建模全指南
3,000 周安装
Tauri v2 开发技能:使用 Web 前端和 Rust 构建跨平台桌面/移动应用
3,100 周安装