refactor: keep "cognee" and "cognee-mcp", add deprecation warning for 'cognee' command
This commit is contained in:
parent
52d3870969
commit
aaa9a750d3
2 changed files with 22 additions and 2 deletions
|
|
@ -36,4 +36,5 @@ dev = [
|
||||||
allow-direct-references = true
|
allow-direct-references = true
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
cognee-mcp = "src:main"
|
cognee = "src:main"
|
||||||
|
cognee-mcp = "src:main_mcp"
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,27 @@
|
||||||
from .server import main as server_main
|
from .server import main as server_main
|
||||||
|
import warnings
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main entry point for the package."""
|
"""Deprecated main entry point for the package."""
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
|
# Show deprecation warning
|
||||||
|
warnings.warn(
|
||||||
|
"The 'cognee' command for cognee-mcp is deprecated and will be removed in a future version. "
|
||||||
|
"Please use 'cognee-mcp' instead to avoid conflicts with the main cognee library.",
|
||||||
|
DeprecationWarning,
|
||||||
|
stacklevel=2
|
||||||
|
)
|
||||||
|
|
||||||
|
print("⚠️ DEPRECATION WARNING: Use 'cognee-mcp' command instead of 'cognee'")
|
||||||
|
print(" This avoids conflicts with the main cognee library.")
|
||||||
|
print()
|
||||||
|
|
||||||
asyncio.run(server_main())
|
asyncio.run(server_main())
|
||||||
|
|
||||||
|
|
||||||
|
def main_mcp():
|
||||||
|
"""Clean main entry point for cognee-mcp command."""
|
||||||
|
import asyncio
|
||||||
|
asyncio.run(server_main())
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue