- 打开 https://github.com/new
- Repository name 填:
cursor-mem - 选择 Public,不要勾选 "Add a README"(本地已有)
- 创建后记下仓库 URL,例如:
https://github.com/YOUR_USERNAME/cursor-mem.git
在 cursor-mem 项目根目录执行(把 YOUR_USERNAME 换成你的 GitHub 用户名):
cd cursor-mem
# 添加远程仓库
git remote add origin https://github.com/YOUR_USERNAME/cursor-mem.git
# 推送到 main
git push -u origin main若使用 SSH:
git remote add origin git@github.com:YOUR_USERNAME/cursor-mem.git
git push -u origin main推送成功后,把 pyproject.toml 里的 YOUR_USERNAME 全部替换为你的 GitHub 用户名,然后提交并再推一次:
# 编辑 pyproject.toml 中 [project.urls] 的 YOUR_USERNAME
git add pyproject.toml && git commit -m "chore: set project URLs" && git push- 注册/登录 https://pypi.org
- 进入 Account settings → API tokens → Add API token
- 创建 Token,Scope 选 “Entire account” 或只选 “cursor-mem” 项目
- 复制生成的 token(形如
pypi-...),只显示一次
pip install build twine编辑 pyproject.toml,在 [project] 下可增加或修改 authors = [{name = "你的名字", email = "your@email.com"}]。
cd cursor-mem
# 清理旧的 dist
rm -rf dist/
# 构建 sdist 和 wheel
python -m build完成后 dist/ 下会有 cursor-mem-0.1.0.tar.gz 和 cursor_mem-0.1.0-py3-none-any.whl。
首次发布(正式 PyPI):
twine upload dist/*按提示输入:
- Username:
__token__ - Password: 粘贴你的 PyPI API token
先传到测试 PyPI 验证:
twine upload --repository testpypi dist/*安装测试:
pip install -i https://test.pypi.org/simple/ cursor-mempip install cursor-mem
cursor-mem --version- 在
cursor_mem/__init__.py和pyproject.toml中把version改为新版本(如0.1.1) - 在 cursor-mem 根目录提交并打 tag:
cd cursor-mem git add -A && git commit -m "Release v0.1.1" git tag v0.1.1 git push && git push origin v0.1.1
- 重新构建并上传:
cd cursor-mem rm -rf dist/ && python -m build && twine upload dist/*