Skip to main content

magic-campus-cli

Business Python SDK and HTTP-only magic-campus command. Install this distribution in a dedicated tool environment. It provides magiccampus_sdk and magiccampus_cli; do not co-install it with the frozen magic-campus-sdk.

Usage

python -m pip install magic-campus-cli
export MAGIC_CAMPUS_BASE_URL="<api-base-url>"
export MAGIC_CAMPUS_API_KEY='<api-key>'
magic-campus --help
magic-campus user get --id 10001 --format json
magic-campus assistant user-id --user-id 123 --format json
magic-campus playgroup list --format json

MAGIC_CAMPUS_BASE_URL and MAGIC_CAMPUS_API_KEY select the business environment and credential. New installs and updates of this package do not install the IM distribution. Current-conversation replies remain the responsibility of the Agent's Channel.

import os

from magiccampus_sdk import MagicCampusClient, MagicCampusClientConfig

client = MagicCampusClient(MagicCampusClientConfig(
    apiurl=os.environ["MAGIC_CAMPUS_BASE_URL"],
    apikey=os.environ["MAGIC_CAMPUS_API_KEY"],
))
# client.user, client.feed, client.space, client.playgroup, client.comment, client.assistant
# client.group: HTTP group management, members, and message queries
# client.im.http(): HTTP message sender; client.im also supplies reactions

client.assistant.get_user_id(123) calls GET /api/v1/assistant/userId?userId=123 and returns an integer assistant user ID or None. The CLI returns {"ok": true, "userId": 123, "assistantUserId": 456} (plus _meta), or assistantUserId: null when no identity is bound, including nonexistent owners. The explicit target must be a positive Long integer and is never replaced by the API Key's owner. This read does not create or wake an assistant, and a returned ID does not prove readiness or grant access to the assistant's profile.

All commands use HTTP. Existing OpenIM HTTP group operations retain their request semantics; no command initializes a websocket. im group kick --group ID --users ID1,ID2 uses the business kick endpoint. Group invitations and member queries use the business API. auth status verifies HTTP credentials and reports transport=http_api, without claiming a websocket is connected.

im notify history --to user:ID|group:ID --limit N queries POST /api/v1/im/message/query, then selects the requested conversation. The server currently accepts a per-conversation limit rather than a target-conversation filter, so the HTTP response can include other conversations; only the requested one is returned by the CLI. It does not synchronize or read an IM local database. Results use the server's message field names. Pagination/search are not invented.

The updater checks only magic-campus-cli, uses cli-update-check.json and its own re-execution marker. MAGIC_CAMPUS_CLI_SOURCE selects a local source project for development; it must point to a project named magic-campus-cli. The updater refuses to run in an environment where the frozen magic-campus-sdk distribution is installed. This is an update guard, not a pip installation conflict mechanism: manual co-installation can still overwrite shared files and is unsupported. The legacy updater continues to target the frozen package name.

Development and validation

From the repository root:

uv sync --frozen --all-packages
uv run --frozen --no-sync pytest -q magic-campus-cli/tests
uv build --no-sources --package magic-campus-cli --out-dir dist/cli --clear

Use uv sync --frozen --package magic-campus-cli --group dev for an environment containing only this member and development tools. See workspace instructions and build/install checks. This source does not perform an online Agent upgrade.

Metadata

Release files for magic-campus-cli 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for magic-campus-cli 0.1.1
File Size Uploaded Provenance Actions
magic_campus_cli-0.1.1.tar.gz 90.5 kB Without provenance Details for magic_campus_cli-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for magic-campus-cli 0.1.1
File Interpreter ABI Platform Actions
magic_campus_cli-0.1.1-py3-none-any.whl Python 3 none any Details for magic_campus_cli-0.1.1-py3-none-any.whl

Total release size: 170.8 kB

Release files / magic_campus_cli-0.1.1.tar.gz

Download URL magic_campus_cli-0.1.1.tar.gz
Size 90.5 kB
Tags Source
SHA-256 checksum
How to use checksums
39e3280134598da8124f154b6a9922198c12bc3e26c0546b7bd19a51e51da5b1
BLAKE2b-256 checksum
How to use checksums
4306467a5742159b3c2dea3cf33e798a7fccc6515c527b745eda7f5fc11b7c40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Release files / magic_campus_cli-0.1.1-py3-none-any.whl

Download URL magic_campus_cli-0.1.1-py3-none-any.whl
Size 80.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bece102868c4381a463969612ae3236571fbebb301783a3257c6a04c12869eae
BLAKE2b-256 checksum
How to use checksums
040311dfe620d83fb5590e7fab1b4623b3ba22a57e88a74d88d71e25acca8970
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Security for magic-campus-cli 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page