Skip to main content

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 清空历史
  • 输入 exitquit 退出

构建与发布

本项目使用标准 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

magiccode123-1.1.0.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

magiccode123-1.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file magiccode123-1.1.0.tar.gz.

File metadata

  • Download URL: magiccode123-1.1.0.tar.gz
  • Upload date:
  • Size: 32.3 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

Hashes for magiccode123-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5ec51614d6493e8abd79cc6522ccf1fdd8c798afa6fa90d0a507001f47c7e002
MD5 ea91aede7f16b77ddb69573af75a0f9b
BLAKE2b-256 a09acef51c0448ff1e8a0b3e78c211e16a3b7a25060572faa4e11949b1f11030

See more details on using hashes here.

File details

Details for the file magiccode123-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: magiccode123-1.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

Hashes for magiccode123-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da8318a59717a744c81efb4b9242e459492704609fa6c42b13703e64ecceee55
MD5 711d7ddc66cc808c2f65eeca5e5023f1
BLAKE2b-256 a83179880459889828d2ecf744b5c807185bf8dc7783280c80d994ca5ae662d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page