Metadata-Version: 2.5
Name: grape-quickstart
Version: 0.1.4
Summary: One-command installer and launcher for the Grape platform
Project-URL: Homepage, https://www.grapedev.cn
Project-URL: Source, https://github.com/grape-dev/grape
Project-URL: Issues, https://github.com/grape-dev/grape/issues
Author: Grape
License: MIT
Keywords: ai-native,devops,grape,installer,quickstart
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# grape-quickstart

一条命令安装并启动 [Grape](https://www.grapedev.cn) 平台。

```bash
uvx grape-quickstart init          # 探测环境 → 装依赖 → 后台启动 → 等 /api/health
uvx grape-quickstart init --check  # 只探测，不安装
```

- 源码默认落在 `~/.grape/src`（可用 `--src` 指向已有仓库、`--no-clone` 禁止自动拉取）
- 不 sudo、不改系统环境；所有安装都发生在仓库自身的 `.venv`
- 其余参数（`--docker` / `--foreground` / `--production` / `--mirror` / `--skip-doctor`）原样透传

## 更新与维护

| 你改了什么 | 要发 PyPI 吗 | 用户怎么拿到 |
| --- | --- | --- |
| Grape 源码（业务代码、依赖、doctor） | ❌ 不用 | `grape update`（git pull --ff-only，不覆盖本地改动） |
| README / 文档 | ❌ 不用 | 直接看仓库 |
| 安装器自身（cli.py / 打包配置） | ✅ 要 bump 版本并 `uv publish` | `uvx` 每次解析最新版；要锁版本用 `uvx grape-quickstart@0.1.2 init` |

```bash
grape update            # 已安装用户更新源码
grape init              # 依赖有变化时再跑一次（复用 .venv 补齐依赖）
```

版本号只用一种规则：**发 PyPI 才 bump**（0.1.2 → 0.1.3…）；源码版本由 git tag 单独管理，两者互不影响。

MIT License.

## 本地构建与验证

```bash
uv build                      # 产出 dist/*.whl + dist/*.tar.gz
uvx twine check dist/*        # 元数据与长描述校验（应 PASSED）
uvx --from dist/grape_quickstart-0.1.0-py3-none-any.whl grape --version
uvx --from dist/grape_quickstart-0.1.0-py3-none-any.whl grape init --check --src /path/to/grape
```

## 在 TestPyPI 上预演（正式发布前必做）

```bash
export UV_PUBLISH_TOKEN=pypi-xxxx          # test.pypi.org 的 token，与正式站不通用
uv publish --publish-url https://test.pypi.org/legacy/

# 注意：uvx 的 --index-url 已废弃且对 tool run 不生效，必须用 --default-index
uvx --default-index https://test.pypi.org/simple/ --refresh --from grape-quickstart grape --version
uvx --default-index https://test.pypi.org/simple/ --from grape-quickstart grape init --check --src /path/to/grape
curl -sS https://test.pypi.org/pypi/grape-quickstart/json | python3 -m json.tool | head -30
```

TestPyPI 与 PyPI 是两个独立站点：账号、2FA、token 都不通用；包名也要各自占位。

## 常见问题

**装的时候报 `grape-quickstart was not found in the package registry`？**

多半是本机把默认索引配成了国内镜像（如清华 `pypi.tuna.tsinghua.edu.cn`、阿里云），而镜像对新包有同步延迟。两种解法：

```bash
uvx --refresh grape-quickstart init                      # 稍等几分钟重试（镜像同步后即可）
uvx --default-index https://pypi.org/simple grape-quickstart init   # 或直接走官方索引
```

注意用 `--default-index`，`--index-url` 在 uv 中已废弃且对 `uvx` 不生效。
