-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add nexuscli project #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| # NexusCLI | ||
|
|
||
| > **A fast, lightweight, Termux-optimized CLI/TUI for agent interactions.** | ||
| > Powered by `curl_cffi` and reverse-engineered DeepSeek API endpoints. | ||
|
|
||
| --- | ||
|
|
||
| ## 🚀 Features | ||
|
|
||
| - **Blazing Fast**: Uses `curl_cffi` for high-performance API calls. | ||
| - **Termux Optimized**: Designed for mobile/Termux environments. | ||
| - **Lightweight**: No Playwright or heavy dependencies. | ||
| - **Phased Architecture**: Modular design for instant execution. | ||
| - **Session Management**: Create, list, and manage chat sessions. | ||
| - **Interactive Chat**: Real-time streaming responses. | ||
| - **Export Capabilities**: Export conversations to Markdown or JSON. | ||
|
|
||
| --- | ||
|
|
||
| ## 📦 Installation | ||
|
|
||
| ### 1. Clone the Repository | ||
|
|
||
| ```bash | ||
| cd ~/termux-monorepo | ||
| git checkout vibe/deepcode-cli_phased-fusion_fc54fa | ||
| ``` | ||
|
Comment on lines
+22
to
+27
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Make the clone step runnable from a clean checkout. This section does not clone the repository. It assumes that 🤖 Prompt for AI Agents |
||
|
|
||
| ### 2. Install Dependencies | ||
|
|
||
| ```bash | ||
| pip install curl_cffi rich | ||
| ``` | ||
|
Comment on lines
+29
to
+33
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Install the local package, not only its dependencies.
🤖 Prompt for AI Agents |
||
|
|
||
| ### 3. Set Up API Token | ||
|
|
||
| ```bash | ||
| export NEXUSCLI_TOKEN="your_deepseek_token_here" | ||
| # Or save in config | ||
| echo '{"token": "your_deepseek_token_here"}' > ~/.nexuscli/config.json | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Create Shell redirection runs before the CLI can create directories. On first use, this command fails if 🤖 Prompt for AI Agents |
||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 🎯 Usage | ||
|
|
||
| ### Basic Commands | ||
|
|
||
| | Command | Description | | ||
| |---------|-------------| | ||
| | `nexuscli sessions` | List all sessions | | ||
| | `nexuscli new-session` | Create a new session | | ||
| | `nexuscli chat --last` | Start interactive chat | | ||
| | `nexuscli send --prompt "Hello" --last` | Send a single message | | ||
| | `nexuscli export --last --format markdown` | Export session history | | ||
|
|
||
| ### Examples | ||
|
|
||
| ```bash | ||
| # List all sessions | ||
| nexuscli sessions | ||
|
|
||
| # Create a new expert session | ||
| nexuscli new-session --model expert --save | ||
|
|
||
| # Start interactive chat with last session | ||
| nexuscli chat --last --thinking | ||
|
|
||
| # Send a single message | ||
| nexuscli send --prompt "Explain Python decorators" --last | ||
|
|
||
| # Export session to Markdown | ||
| nexuscli export --last --format markdown --output conversation.md | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 🏗️ Project Structure | ||
|
|
||
| ``` | ||
| nexuscli/ | ||
| ├── __init__.py | ||
| ├── core/ | ||
| │ ├── __init__.py | ||
| │ └── api.py # Core API wrapper (reverse-engineered) | ||
| ├── cli/ | ||
| │ ├── __init__.py | ||
| │ └── main.py # CLI entry point | ||
| ├── nexuscli.py # Launcher script | ||
| ├── pow_solver.js # POW solver for API challenges | ||
| └── README.md | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 🔧 Configuration | ||
|
|
||
| ### Config File | ||
|
|
||
| Located at `~/.nexuscli/config.json`: | ||
|
|
||
| ```json | ||
| { | ||
| "token": "your_deepseek_token", | ||
| "last_session": "your_last_session_id" | ||
| } | ||
| ``` | ||
|
|
||
| ### Environment Variables | ||
|
|
||
| - `NEXUSCLI_TOKEN` or `DEEPSEEK_TOKEN`: API token | ||
| - `NEXUSCLI_BASE_URL`: Custom API base URL (default: `https://chat.deepseek.com`) | ||
|
|
||
| --- | ||
|
|
||
| ## 🤖 API Endpoints | ||
|
|
||
| The following endpoints are reverse-engineered and used: | ||
|
|
||
| | Endpoint | Description | | ||
| |----------|-------------| | ||
| | `/api/v0/chat_session/create` | Create a new chat session | | ||
| | `/api/v0/chat_session/fetch_page` | Fetch all sessions | | ||
| | `/api/v0/chat/history_messages` | Get session history | | ||
| | `/api/v0/chat/create_pow_challenge` | Get POW challenge | | ||
| | `/api/v0/chat/completion` | Send message (streaming) | | ||
| | `/api/v0/file/upload_file` | Upload a file | | ||
| | `/api/v0/share/create` | Create a share | | ||
| | `/api/v0/share/fork` | Fork a conversation | | ||
|
|
||
| --- | ||
|
|
||
| ## 📜 License | ||
|
|
||
| MIT License. See [LICENSE](../../LICENSE) for details. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Fix the relative From 🤖 Prompt for AI Agents |
||
|
|
||
| --- | ||
|
|
||
| ## 🙌 Contributing | ||
|
|
||
| 1. Fork the repository | ||
| 2. Create a feature branch (`git checkout -b feature/amazing-feature`) | ||
| 3. Commit your changes (`git commit -m 'Add amazing feature'`) | ||
| 4. Push to the branch (`git push origin feature/amazing-feature`) | ||
| 5. Open a Pull Request | ||
|
|
||
| --- | ||
|
|
||
| ## 🔗 Related Projects | ||
|
|
||
| - [termux-monorepo](https://github.com/timerloggedout-spec/termux-monorepo) | ||
| - [deepcli](https://github.com/timerloggedout-spec/termux-monorepo/tree/master/deepcli) | ||
| - [multi-ai-cli](https://github.com/timerloggedout-spec/termux-monorepo/tree/master/multi-ai-cli) | ||
| - [termux-multi-agent](https://github.com/timerloggedout-spec/termux-monorepo/tree/master/termux-multi-agent) | ||
|
|
||
| --- | ||
|
|
||
| ## 🎨 Branding | ||
|
|
||
| **NexusCLI** is part of the **Termux Monorepo** ecosystem. | ||
|
|
||
| > **"All for One; and, One for All!"** 🚀 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/usr/bin/env python3 | ||
| """ | ||
| NexusCLI | ||
| A fast, lightweight, Termux-optimized CLI/TUI for agent interactions. | ||
| Uses curl_cffi for high-performance API calls. | ||
| """ | ||
|
|
||
| __version__ = "0.1.0" | ||
| __author__ = "Termux Monorepo Team" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #!/usr/bin/env python3 | ||
| """ | ||
| CLI module for DeepCode-CLI Phased Nexus. | ||
| """ | ||
|
|
||
| from .main import main | ||
|
|
||
| __all__ = ["main"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: timerloggedout-spec/termux-monorepo
Length of output: 12502
🏁 Script executed:
Repository: timerloggedout-spec/termux-monorepo
Length of output: 2834
Make the interactive chat description match the implementation.
stream_completion()sendsstream=True, butresp.contentis decoded after the response is fully buffered before SSE parsing and printing. The response is not yielded in real time; updatenexuscli/README.md:15or consume and print each SSE chunk as it arrives.🤖 Prompt for AI Agents