Thin, typed Python SDK for the Mycelium code-intelligence engine. Wraps the prebuilt mycelium CLI — no Rust/Cargo toolchain required.
Project description
mycelium-rcig
Thin, typed Python SDK for Mycelium — the reactive, AI-native code-intelligence graph. Embed code intelligence in any Python app without a Rust toolchain.
The SDK is a thin wrapper over the prebuilt mycelium CLI: it locates the
binary, spawns it with --format json, and returns parsed objects. Because it
wraps the CLI, it inherits the CLI ↔ MCP byte-identical parity guaranteed by the
Charter's Three-Surface Rule — see
RFC-0111.
Naming. The PyPI distribution is
mycelium-rcig(the short namemyceliumis taken by an unrelated package), mirroring the crates.iomycelium-rcig-*prefix. The import package ismycelium_rcig.
Install
pip install mycelium-rcig
You also need the mycelium CLI on your machine. Install it via npm
(npm install -g @aimasteracc/mycelium), cargo
(cargo install mycelium-rcig-cli), or point the SDK at a binary with the
MYCELIUM_BIN environment variable.
Quickstart
from mycelium_rcig import Mycelium
m = Mycelium(root=".")
m.index() # build/refresh the index
hits = m.query("#login") # Hyphae selector → parsed JSON
info = m.get_symbol_info("src/lib.rs>App>render")
ctx = m.context("trace ServeHTTP to HandlerFunc", max_nodes=30)
API
| Method | CLI twin |
|---|---|
version() |
mycelium version |
index(path=None) |
mycelium index |
query(expr) |
mycelium query --format json |
search_symbol(query, limit=None) |
mycelium search-symbol --format json |
get_symbol_info(path) |
mycelium get-symbol-info --format json |
get_callers(path, edge_kind=None, include_virtual=False, budget=None) |
mycelium get-callers --format json |
get_callees(path, edge_kind=None, budget=None) |
mycelium get-callees --format json |
context(task, max_nodes=None, max_code_blocks=None, budget=None) |
mycelium context --format json |
server_status() |
mycelium server-status --format json |
run(args) |
any subcommand — raw argv escape hatch |
Every command the CLI exposes is reachable via
run(["<subcommand>", ..., "--format", "json"]), even before it has a typed
convenience method.
Binary resolution
The binary is located in this order:
MYCELIUM_BINenvironment variable (explicit override),myceliumon yourPATH,- the bare command name (the OS resolves it at spawn time).
Pass bin="/path/to/mycelium" to the constructor to pin one directly.
Errors
Failures raise a MyceliumError carrying code, signal, stderr, stdout,
and args_ (the CLI argv).
License
MIT
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 mycelium_rcig-0.3.0.tar.gz.
File metadata
- Download URL: mycelium_rcig-0.3.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
369e19efd53dbe2c385ed5433e4bb6e684338422db77a6db53a8cdb414e5b064
|
|
| MD5 |
9cd9bc8d6d17dcb4d61a707146941342
|
|
| BLAKE2b-256 |
6a0a7fc0a22175a97cc4e23098659fe486d64d03e4db979ca2a2b7d5389187ba
|
File details
Details for the file mycelium_rcig-0.3.0-py3-none-any.whl.
File metadata
- Download URL: mycelium_rcig-0.3.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1e81aa9391d314ff0edff5cbd55aa42d47f603346643f0a6f12a23ed4cb1990
|
|
| MD5 |
02744270461695205e7489e3a9148506
|
|
| BLAKE2b-256 |
2499a948abf0b1c3637356478b2f4e6bb94900eae15add445587fc6aaff54403
|