A terminal AI coding assistant with ReAct-style tool use.
Project description
MagicCode
MagicCode 是一个终端 AI 编码助手示例,使用 OpenAI 兼容接口和 ReAct 风格循环,让模型可以在对话中调用本地 shell 工具。
安装
pip install magiccode
开发环境可以直接用 uv 运行:
uv run magiccode
配置
发布版本不会内置 API key。运行前请设置环境变量:
export MAGICCODE_API_KEY="你的 API key"
可选配置:
export MAGICCODE_BASE_URL="http://183.147.142.111:30000/v1"
export MAGICCODE_MODEL="glm-4.7"
也可以使用 OPENAI_API_KEY 作为备用变量。
使用
magiccode
进入交互模式后:
- 输入问题或任务开始对话
- 输入
clear清空历史 - 输入
exit或quit退出
构建与发布
本项目使用标准 pyproject.toml 元数据和 Hatchling build backend。使用 uv 构建:
uv build
发布到 TestPyPI:
uv publish --publish-url https://test.pypi.org/legacy/ --token "$TEST_PYPI_TOKEN"
发布到 PyPI:
uv publish --token "$PYPI_TOKEN"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file magiccode123-0.1.0.tar.gz.
File metadata
- Download URL: magiccode123-0.1.0.tar.gz
- Upload date:
- Size: 21.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97d9d387e9b8def65cdaccaa33aa3b7833f0466e3ccffbf0f529a11816697ec4
|
|
| MD5 |
671f01dfe72034a98a081a40e419724c
|
|
| BLAKE2b-256 |
33c80dd0820ed1155054dbc650bcdd8341ae133297ed872a980c4e0779d560c7
|
File details
Details for the file magiccode123-0.1.0-py3-none-any.whl.
File metadata
- Download URL: magiccode123-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ee036fd5002461c462356491db3cf36d229cbc65d5abcaf62eca1fa0dcb1b26
|
|
| MD5 |
ab43dbea73998cf577fc774578d3e1f0
|
|
| BLAKE2b-256 |
cf529df7d32054177d5daae50660a3414c916c7d1265811c22d448ca77251b94
|